EasyManua.ls Logo

Omron CJ - PROGRAMMING MANUAL 12-2009 - Page 331

Omron CJ - PROGRAMMING MANUAL 12-2009
448 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
291
Index Registers Section 6-2
Basically, record tables are used with the following steps:
1,2,3... 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.
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.
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.

Table of Contents

Related product manuals