Download Series 90-30/20/Micro PLC CPU Instruction Set
Transcript
10 Search Functions Use the appropriate Search function listed below to search for all array values for that particular operation. Abbreviation Function Description SRCH_EQ Search Equal SRCH_NE Search Not Equal Search for all array values equal to a specified value. Search for all array values not equal to a specified value. SRCH_GT Search Greater Than Search for all array values greater than a specified value. SRCH_GE Search Greater Than or Equal Search for all array values greater than or equal to a specified value. SRCH_LT Search Less Than Search for all array values less than a specified value. SRCH_LE Search Less Than or Equal Search for all array values less than or equal to a specified value. Each function has four input parameters and two output parameters. When the function receives power, the array is searched starting at (AR + input NX). This is the starting address of the array (AR) plus the index into this array (input NX). 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, output parameter (FD) is set ON and output parameter (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, then output parameter (FD) is set OFF and output parameter (output NX) is set to zero. The valid values for input NX are 0 to LEN — 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 LEN. If the value of input NX is out-of-range, (< 0 or ≥ LEN), its value is set to the default value of zero. (enable) (starting address) (input index) (object of search) 10-6 _____ | | —|SRCH_| | | | EQ_ | | | | WORD| | | —|AR FD|— | LEN | |00001| —|NX NX|— (output index) | | | | —|IN | |_____| Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – June 1999 GFK-0467L