Omron CS1G/H-CPUxx-EV1 Programming Manual page 318

Sysmac cs series; sysmac cj series
Hide thumbs Also See for CS1G/H-CPUxx-EV1:
Table of Contents

Advertisement

Index Registers
1,2,3...
282
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.
Record table
Record 1
Record 2
Record N
Basically, record tables are used with the following steps:
1. Define the structure of the record table with DIM(631) and set the PLC
memory address of a record in an Index Register with SETR(635).
2. Offset or increment the PLC memory address in the Index Register to read
or compare words in the record.
3. Offset or increment the PLC memory address in the Index Register to
switch to another record.
4. Repeat steps 2 and 3 as required.
Example
The following example uses Index Registers and the record-table instructions
to compare three values to words 1, 3, and 5 in each record. If a match is
found, the record number is stored in D00000.
DIM(631) defines a record table with 1,000 records of 5 words
each.
SETR(635) stores the PC memory address of the first record in
IR0.
• The first, third, and fifth words in the record are compared to
three different values.
• If all three words match their respective values, the record
number is stored in D00000 by GETR(636) and the loop is
broken.
• If all three words do not match their respective values, 5 is added
to IR0 and the loop continues.
Model A
Model A
Record 2
No. 2
Temperature setting
Pressure setting
Section 6-2

Advertisement

Table of Contents
loading

Table of Contents