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

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

Advertisement

Index Registers
0000
01
,IR0
#1234
ON
Increments IR0 by five with each repetition and compares the first, third,
and fifth words in each record to the comparison data. Writes the record
number to D00000 and breaks the loop if matching data is found.
DIM
1
&5
&1000
E0_00000
SETR
1
&0
IR0
JMP
&1000
FOR
&1000
=
=
+2,IR0
#ABCD
+L
IR0
&5
IR0
NEXT
JME
&1000
Defines record table 1 with 1,000 records of
5 words each.
Stores the PLC memory address of table
number 1's first record (record 0) in IR0.
Jumps past the FOR-NEXT loop if the pro-
cessing conditions haven't been set.
Controls the FOR-NEXT loop for a maximum
of 1,000 repetitions (1,000 records).
GETR
=
&1
+4,IR0
IR0
#9999
D00000
Compares the contents of word 1 to #1234,
word 3 to #ABCD, and word 5 to #9999.
If words 1, 3, and 5 contain the comparison
data, the record number is stored in D00000
and BREAK interrupts the loop.
Adds 5 to the PLC memory address in IR0 to
move to the beginning of the next record.
Returns execution to FOR to continue the loop.
Jump destination if the processing conditions
haven't been set.
Section 6-2
BREAK
283

Advertisement

Table of Contents
loading

Table of Contents