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.
10.8.2.1
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.
Output NX
I, Q, M, T, G, R, AI, AQ
Holds the one-based position within the array of
the search target.
FD
flow, none
FD indicates that an array element has been
found and the function was successful.
length
1 to 32,767 bytes or
words.
The number of elements starting at AR that make
up the array to be searched.
10.8.2.2
Example 1:
The array AR is defined as memory addresses %R0001 - %R0005. When EN is ON, the
portion of the array between %R0004 and %R0005 is searched for an element whose
value is equal to IN. If %R0001 = 7, %R0002 = 9, %R0003 = 6, %R0004 = 7, %R0005 =
7, and %R0100 = 7, then the search will begin at %R0004 and conclude at %R0004 when
FD is set ON and a 4 is written to %R0101.
182
GFK-1503E
VersaMax PLC User Manual
For public disclosure
Summary of Contents for VersaMax PLC
Page 16: ...Notes 16 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 38: ...Notes 38 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 50: ...Notes 50 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 92: ...Notes 92 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 112: ...Notes 112 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 224: ...Notes 224 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 292: ...Notes 292 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 316: ...Notes 316 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 317: ......