![Omron CJ1G-CPUxx Instructions Manual Download Page 665](http://html1.mh-extra.com/html/omron/cj1g-cpuxx/cj1g-cpuxx_instructions-manual_742491665.webp)
644
Table Data Processing Instructions
Section 3-17
SRCH(181) searches table data that contains one word in each record. For
searching data that contains more than one word per record, use DIM(631),
SETR(635), GETR(636), FOR(512)–NEXT(513), or BREAK(514) together
with an Index Register (IR).
The status of the Equals Flag can be checked immediately after execution to
determine whether or not there was a match.
Flags
Precautions
If no match is found, the contents of IR00 and DR00 are left unchanged.
Examples
When CIO 000000 is ON in the following example, SRCH(181) searches the
10-word range beginning at D00100 for words that have the same content as
D00200. The PLC memory address of the first word containing a match is
written to IR00 and the total number of matches is written to DR00.
If the table length is specified as &10 (10 decimal) or A hexadecimal, the num-
ber of matches will not be output to the data register DR00.
3-17-9 SWAP BYTES: SWAP(637)
Purpose
Switches the leftmost and rightmost bytes in all of the words in the range.
In CS1-H, CJ1-H, and CJ1M CPU Units, this instruction can be run in the
background. Refer to CS/CJ Series Programmable Controllers Programming
Manual for details on background execution.
Ladder Symbol
Name
Label
Operation
Error Flag
ER
ON if the content of C isn’t within the specified range of
0001 through FFFF.
OFF in all other cases.
Equals Flag
=
ON if one or more of the words in the search range con-
tain the comparison data.
OFF in all other cases.
PC memory
address
Search
Number of matches
D00200
Number of matches
#8000000A
R1
Cd
10067
00010067
0003
N: Number of words
R1: First word in range
SWAP(637)
N
R1
Summary of Contents for CJ1G-CPUxx
Page 3: ...iv N o t i c e ...
Page 5: ...vi ...
Page 21: ...xxii Conformance to EC Directives 6 ...
Page 35: ......
Page 1131: ...1110 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...