
User Manual
Chapter 10
GFK-1503F
Jan 2020
Instruction Set Reference
162
10.8.2
Table Functions Search for Array Values
Use the Search functions listed below to search for values in an array.
▪
Search Equal
▪
Equal to a specified value.
▪
Search Not Equal
▪
Not equal to a specified value.
▪
Search Greater Than
▪
Greater than a specified value.
▪
Search Greater Than or Equal
▪
Greater than or equal to a specified value.
▪
Search Less Than
▪
Less than a specified value.
▪
Search Less Than or Equal
▪
Less than or equal to a specified value.
When the Search function receives power, it searches the specified array. Searching begins
at the starting address (AR) plus the index value (NX).
Figure 151
The search continues until the array element of the search object (IN) is found or until the
end of the array is reached. If an array element is found, the Found Indication (FD) is set ON
and the Output Index (output NX) is set to the relative position of this element within the
array. If no array element is found before the end of the array is reached, the Found
Indication (FD) is set OFF and the Output Index (output NX) is set to zero.
Valid values for input NX are 0 to (length)- 1. NX should be set to zero to begin searching at
the first element. This value increments by one at the time of execution. Therefore, the
values of output NX are 1 to (length). If the value of input NX is out-of-range, (< 0 or >
length), its value defaults to zero.
Parameters of the Search Functions
Input/
Output
Choices
Description
enable
flow
When the function is enabled, the search is performed.
AR
For all: R, AI, AQ
For INT, BYTE,
WORD: I, Q, M, T, G,
For BYTE, WORD: S
Contains the starting address of the array.
Input NX
I, Q, M, T, G, R, AI,
AQ, constant
Contains the zero-based index into the array at which
to begin the search
IN
For all: R, AI, AQ,
constant
For INT, BYTE,
WORD: I, Q, M, T, G,
For BYTE, WORD: S
IN contains the object of the search.