Chapter 4. Ladder Diagram (LD) Programming
GFK-2950C
February 2018
185
Operands for the Search Function
Note:
For each mnemonic, use the corresponding data type for the AR and IN operands. For
example, SEARCH_EQ_BYTE requires AR and IN to be BYTE variables.
Parameter
Description
Allowed Operands Optional
Length (??)
The number of registers starting at AR that make up the
memory block to search. 1
Length
32,767 8-bit or 16-bit
registers.
Constants
No
AR (must be the
same type as
IN)
The starting address of the memory block to search; the
address of the first register in the memory block.
All except constants No
INX
The zero-based index into the memory block at which to
begin the search. Zero points to the first reference.
Valid range: 0
INX
(Length-1).
If INX is out of range, it is set to the default value of 0.
All except constants No
IN (must be the
same type as
AR)
The value that the search is based on. For example:
SEARCH_GT_DINT searches for a DINT value that is greater
than IN.
SEARCH_NE_UINT searches for a UINT value that is not equal
to IN.
SEARCH_GE_WORD searches for a WORD value that is
greater than or equal to IN.
All
No
ONX
The one-based position within the memory block of the
search target. A value of 1 points to the first reference.
Valid range: 1
ONX
Length
data flow, I, Q, M, T,
G, R, P, L, AI, AQ
No
FD
Found indicator. This power flow indicator is energized when
a register that satisfies the search criteria is found and the
function was successful.
Power flow
No
Example for the Search Function
To search the memory block %AI00001 - %AI00016, AR is set as
%AI00001 and Length is set as 16. The values of the 16
registers are 100, 20, 0, 5, 90, 200, 0, 79, 102, 80, 24, 34, 987, 8,
0, and 500. Initially, the search index into AR, %AQ0001, is 5.
When power flow input is ON, each scan searches the memory
block looking for a match to the IN value of 0. The first scan
starts searching at %AI00006 and finds a match at %AI00007,
so FD turns ON and %AQ00001 becomes 7. The second scan
starts searching at %AI00008 and finds a match at %AI00015,
so FD remains ON and %AQ0001 becomes 15. The next scan
starts at %AI00016. Since the end of the memory block is
reached without a match, FD is set OFF and %AQ0001 is set to
zero. The next scan starts searching at the beginning of the
memory block.
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...