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

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

Advertisement

Index Registers
1,2,3...
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.
Section 6-2
289

Advertisement

Table of Contents
loading

Table of Contents