GE VersaMax PLC User Manual page 182

Table of Contents

Advertisement

Input/ Output
enable
AR
Input NX
IN
Output NX
FD
length
182
GFK-1503E
For public disclosure
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
Choices
flow
When the function is enabled, the search is
performed.
Contains the starting address of the array.
For all: R, AI, AQ
For INT, BYTE, WORD:
I, Q, M, T, G,
For BYTE, WORD: S
I, Q, M, T, G, R, AI, AQ,
Contains the zero-based index into the array at
constant
which to begin the search.
IN contains the object of the search.
For all: R, AI, AQ,
constant
For INT, BYTE, WORD:
I, Q, M, T, G,
For BYTE, WORD: S
I, Q, M, T, G, R, AI, AQ
Holds the one-based position within the array of
the search target.
flow, none
FD indicates that an array element has been
found and the function was successful.
1 to 32,767 bytes or
The number of elements starting at AR that make
words.
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.
Description
VersaMax PLC User Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents