Detailed description
Original instructions
Function description
The SRCH function block searches a source table for an entered bit pattern. It increments the directory in the source table in each released cycle marked TRIG and checks whether the Array element displayed with INDEX matches the defined pattern or not. The result is displayed at the FOUND output.
SRC (source) is type ANY which implicates a pre-defined length. This field (array) is interpreted as an ARRAY with the same data type (INT, DINT, UINT, UDINT, REAL) as the data type used at the PATTERN input. To enable correct work methods, make sure that the data type of PATTERN is identical to that of the array to be searched for. A binary comparison is performed in each cycle between PATTERN and an Array element. The length of the comparison is always derived from the length of PATTERN; the length of the Array element is not considered.
TRIG detects the rising edge and starts the search for one cycle. The search will stop after this cycle until the next rising edge is detected at TRIG.
PATTERN is the bit pattern to be searched for.
The CONT parameter defines whether to continue the search or to resume it at the beginning of the table after a pattern has been found.
Once the pattern is found, FOUND is set to "1" and the INDEX parameter shows where in the table the pattern has been found.