Omron SYSMAC CS Series Programming Manual page 237

Hide thumbs Also See for SYSMAC CS Series:
Table of Contents

Advertisement

Index Registers
Range speci-
fied in the
instruction
218
The PC memory address of the result word (word containing the max. value,
min. value, search data, etc.) is automatically stored in IR0. The Index Regis-
ter (IR0) can be used as an operand in later instructions such as MOV(021) to
read the contents of the word or perform other processing.
Max. value
Min. value
The following table lists the range instructions and their functions.
Instruction
SRCH(181)
Finds search data.
MAX(182)
Finds max. value.
MIN(183)
Finds min. value.
SUM(184)
Calculates sum.
FCS(180)
Calculates checksum.
The Index Registers can be combined with other instructions (such as com-
parison instructions) in FOR–NEXT loops to perform more complicated opera-
tions on ranges of words.
Table Processing (Record-table Instructions)
The record-table instructions act on specially defined data tables made up of
equal-length records. The records can be accessed by record number for
easy processing.
Instruction
DIM(631)
Defines a record table. Declares the length of each record and the
SETR(635)
Sets record location.
GETR(636)
Gets record location.
Note Record numbers and word addresses are related through the Index Regis-
ters. Specify a record number in SETR(635) to store the PC memory address
of the beginning of that record in an Index Register. When data is required
from the record, add the required offset to that Index Register to access any
word in the record.
Use the record-table instructions with Index Registers to perform the following
kinds of operations: reading/writing record data, searching records, sorting
record data, comparing record data, and performing calculations with record
data.
Data
Search
Function
Finds the search data in the specified range
and outputs the PC memory address of the
word containing that value to IR0.
Finds the maximum value in the specified
range and outputs the PC memory address of
the word containing that value to IR0.
Finds the minimum value in the specified
range and outputs the PC memory address of
the word containing that value to IR0.
Calculates the sum of the data in the specified
range.
Calculates the frame checksum of the data in
the specified range.
Function
number of records.
Writes the location of the specified record (the
PC memory address of the beginning of the
record) in the specified Index Register.
Returns the record number of the record that
contains the PC memory address in the speci-
fied Index Register.
Section 6-2
SUM calculation
FCS calculation
Description
Description

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cs1g/h-cpu-ev1 seriesCj1g-cpu seriesSysmac cj series

Table of Contents