Table Data Processing Instructions
Related Memory Area
Words
Flags
Precautions
Examples
724
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.
Note SRCH(181) can be processed in the background. Refer to the SYSMAC CS/
CJ/NSJ Series PLC Programming Manual (W394) for details.
Name
IR00 Output for
Background Execution
DR00 Output for
Background Execution
Equals Flag for
Background Execution
ER/AER Flag for
Background Execution
Name
Error Flag
Equals Flag
If no match is found, the contents of IR00 and DR00 are left unchanged.
If background execution is enabled in the PLC Setup, the PLC memory
address of the first word containing a match will be output to Auxiliary Area
words A595 and A596 instead of IR00.
If background execution is enabled in the PLC Setup and control word C+1 is
set to output the total number of matches to DR00 (C+1 = 8000 hex), the total
number of matches will be output to Auxiliary Area word A597 instead of
DR00.
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.
Address
A595 and
When an index register is specified as the out-
A596
put for an instruction processed in the back-
ground, A595 and A596 receive the output
instead of IR00.
(A595 contains the rightmost digits, and A596
contains the leftmost digits.)
A597
When a data register is specified as the output
for an instruction processed in the background,
A597 receives the output instead of DR00.
A59801
This flag is turned ON if matching data is found
for a SRCH(181) instruction executed in the
background.
A39510
This flag is turned ON if an error or illegal
access occurs during background execution.
Label
ER
ON if the content of C is not 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.
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.
OFF in all other cases.
Section 3-17
Operation
Operation
Need help?
Do you have a question about the SYSMAC CJ - REFERENCE MANUAL 08-2008 and is the answer not in the manual?
Questions and answers