Omron CJ - PROGRAMMING MANUAL 08-2008 Programming Manual page 326

Programmable controllers
Hide thumbs Also See for CJ - PROGRAMMING MANUAL 08-2008:
Table of Contents

Advertisement

Index Registers
288
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 oper-
ations 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 PLC 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.
A typical application of record tables is storing manufacturing data for different
models of a product (such as temperature and pressure settings) in record
form and switching from model to model just by changing the record number.
Function
Finds the search data in the specified range
and outputs the PLC memory address of the
word containing that value to IR0.
Finds the maximum value in the specified
range and outputs the PLC memory address
of the word containing that value to IR0.
Finds the minimum value in the specified
range and outputs the PLC 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
PLC memory address of the beginning of the
record) in the specified Index Register.
Returns the record number of the record that
contains the PLC memory address in the
specified Index Register.
Model A
Record table
No. 2
Record 1
Record 2
Record N
Section 6-2
Description
Description
Model A
Record 2
Temperature setting
Pressure setting

Advertisement

Table of Contents
loading

Table of Contents