EasyManua.ls Logo

Omron CP - PROGRAMMING MANUAL 05-2007 - Page 619

Omron CP - PROGRAMMING MANUAL 05-2007
1175 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...
586
Table Data Processing Instructions Section 3-16
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 IR0 and DR0 are left unchanged.
Examples When CIO 0.00 is ON in the following example, SRCH(181) searches the 10-
word range beginning at D100 for words that have the same content as D200.
The PLC memory address of the first word containing a match is written to
IR0 and the total number of matches is written to DR0.
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 DR0.
3-16-9 SWAP BYTES: SWAP(637)
Purpose Switches the leftmost and rightmost bytes in all of the words in the range.
Ladder Symbol
Name Label Operation
Error Flag ER ON if the content of C is not within the specified range of
0001 through FFFF.
ON if the Communications Port Enabled Flag for the com-
munications port number specified as the Com Port num-
ber for Background Execution is OFF when background
processing is specified (CP1H only).
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.
D200
#8000000A
R1
Cd
10067
00010067
0003
0.00
D100
D200
D100
D101
D102
D103
D104
D105
D106
D107
D108
D109
Search
Number of matches
Number of matches
PLC memory
address
SWAP(637)
N
R1
N: Number of words
R1: First word in range

Table of Contents

Related product manuals