Omron CJ - REFERENCE MANUAL 10-2009 Reference Manual page 608

Table of Contents

Advertisement

3. Instructions
Function
DIM(631) registers the words from TB to TB+LR NR-1 as table number N. Table number N has NR
records and each record is LR words long. The data within this region cannot be changed once the
region has been declared as records.
Records in a registered table are identified by their record numbers, which range from 0 to NR-1.
Hint
• Use DIM(631) in combination with SETR(635) (SET RECORD NUMBER) or GETR(636) (GET
RECORD NUMBER) to simplify the calculation of addresses in data tables. Use DIM(631) to divide
data into records and then use SETR(635) to store the first address of the desired record in an Index
Register. The Index Register can then be used as a pointer in other instructions, such as read, write,
search, or compare instructions.
• As an example, if temperatures, pressures, or other set values are stored as records and the records
for various models are combined into a table, it is easy to read the set values for each models for any
particular conditions.
Related instructions
• SETR(635) sets the leading PLC memory address of the specified record number in the specified
Index Register.
• GETR(636) outputs the record number of the record that includes the specified Index Register value
(PLC memory address).
Sample program
When CIO 0.00 is ON in the following example, DIM(631) defines record table number 2 with three 10-
word records. The table begins at D300.
0.00
570
Table number (N)
Number of records
N
LR: D100
D100
LR
NR: D200
D200
NR
TB
D300
Record 0
Record 1
Record 2
Record 0
Record 1
LR
NR words
Record NR–1
Record length: 10 words
Number of records: 3
Table number 2
D300
D301
10 words
D309
D310
10 words
D319
D320
10 words
D329
CS/CJ/NSJ Series Instructions Reference Manual (W474)

Advertisement

Table of Contents
loading

Table of Contents