CAL SRCH_Instance (TRIG:=StartsSearch, CONT:=ContinueSearch, SRC:=SourceTable, PATTERN:=BitPatternForSearch, INDEX:=FindingPlace, FOUND=>FoundPattern)
SRCH_Instance (TRIG:=StartsSearch, CONT:=ContinueSearch, SRC:=SourceTable, PATTERN:=BitPatternForSearch, INDEX:=FindingPlace, FOUND=>FoundPattern) ;
Parameter
|
Data type
|
Description
|
---|---|---|
TRIG
|
TRIG detects the rising edge and starts the search for the next element in the table.
|
|
CONT
|
BOOL
|
CONT defines whether to continue the search or to resume it at the beginning of the table.
1 = The search will be continued with the next rising edge of TRIG.
0 = The search position is reset to the beginning of the table with the next rising edge of TRIG and the first element of the table will be compared to the pattern.
|
SRC
|
Source table
|
|
PATTERN
|
PATTERN is the bit pattern to be searched for.
Note: The length of the bit pattern to be searched for is always derived from the length of the data type at the input PATTERN; the length of the Array element is not considered. To enable correct work methods, make sure that the data type of PATTERN is identical to that of the array to be searched for.
|
Parameter
|
Data type
|
Description
|
---|---|---|
INDEX
|
UINT
|
INDEX displays the Array index of the last search process. (This means that when the pattern is found, the INDEX parameter will indicate where the pattern was found in the table). The value of the variables at the input can be changed with the application to change the search position in the table.
Note: INDEX always displays the Array index to which the last comparison was applied. It will always begin counting at 1 for the first Array element, regardless of the actual Array limits that were defined in the data editor. INDEX always counts ascending, even if the index is greater than the number of Array elements.
|
Parameter
|
Data type
|
Description
|
---|---|---|
FOUND
|
BOOL
|
1 = pattern found
|