Omron CS1G/H-CPUxxH Instructions Manual page 665

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

Advertisement

Table Data Processing Instructions
Flags
Precautions
Examples
#8000000A
R1
Cd
3-17-9 SWAP BYTES: SWAP(637)
Purpose
Ladder Symbol
644
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.
Name
Label
Error Flag
ER
Equals Flag
=
If no match is found, the contents of IR00 and DR00 are left unchanged.
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.
PC memory
address
10067
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.
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.
Operation
ON if the content of C isn't within the specified range of
0001 through FFFF.
OFF in all other cases.
ON if one or more of the words in the search range con-
tain the comparison data.
OFF in all other cases.
Search
D00200
Number of matches
00010067
0003
SWAP(637)
N
N: Number of words
R1
R1: First word in range
Section 3-17
Number of matches

Advertisement

Table of Contents
loading

Table of Contents