EasyManuals Logo
Home>Omron>Controller>CJ - INSTRUCTIONS

Omron CJ - INSTRUCTIONS User Manual

Omron CJ - INSTRUCTIONS
1308 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #664 background imageLoading...
Page #664 background image
3. Instructions
626
CS/CJ/NSJ Series Instructions Reference Manual (W474)
z Operand Specifications
Flags
Function
The number of records specified by C starting from the record specified by S1 are searched for the data
specified by S2 and S2+1. If a record that matches the search conditions is found, the Equals Flag will
turn ON, the record number of the matching record will be output to D1 and the matching record data
will be output starting from D1+1. If outputting to an index register is specified in C+3, the PLC memory
address of the first word of the matching record is output to the specified index register. When this
happens, the Equals Flag is turned ON. If more than one matching record is found, the record closest to
the first record that is searched will be output.
If a matching record is not found, nothing will be output starting from D1 (the previous values will be
maintained).
The search is performed by the method specified in C+3. There are two search methods.
• Linear Search
For a linear search, the records are searched in order from the specified first record. Linear searching
is used when the search data has not been sorted. If a matching record is found before the maximum
number of records specified in C is searched, the Carry Flag will be turned ON. (This is to indicate
that there are records that were not searched.)
• Split Search (Ascending or Descending)
If the records that are being searched have been sorted in ascending or descending order, a split
search can be used to reduce the instruction execution time.
Precautions
• If the records being searched have not been sorted in ascending or descending order when a split
search is specified, the results of the search will not be accurate.
• A split search cannot be specified if using search end data has been enabled. If using search end
data is enabled, a linear search will be performed even if a split search is specified.
Area
Word addresses
Indirect DM/EM
addresses
Con-
stants
Registers Flags
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
TK CF
C
OK OK OK OK OK OK OK OK OK OK
---
---
--- OK
--- --- --- ---
S1
S2
OKD1
D2 --- --- --- --- --- --- --- --- --- --- OK ---
Name Label Operation
Error Flag P_ER • ON when the record length in C+1 is not between 2 and 1,024, inclusive.
• ON when the number of records specified in C times the record length in C+1 is greater than
32,768.
• ON when the number of records specified in C times the record length in C+1 is 0.
• ON when the search data offset in C+2 is greater than two less than the record length in C+1.
• OFF in all other cases.
Equals Flag P_EQ • ON when the search data is found.
• OFF when the search data is not found.
Carry Flag P_CY Linear Search
• ON when a matching record is found before the final record and before the condition for the set-
ting to end the search is met.
• OFF when the search is completed through the final record or until the condition for the setting to
end the search is met.
Split Search
•Always OFF.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CJ - INSTRUCTIONS and is the answer not in the manual?

Omron CJ - INSTRUCTIONS Specifications

General IconGeneral
BrandOmron
ModelCJ - INSTRUCTIONS
CategoryController
LanguageEnglish

Related product manuals