Match-pattern – ProSoft Technology PS-QS-1x10-0781 User Manual
Page 29

FieldServer Configuration Manual
Page 29 of 90
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262-2299 Fax: (408) 262-2269 Toll Free: (888) 509-1970 email: [email protected]
5.2.9 Match-pattern
The match pattern move is used at run time to move a customized single value based on combinations of values in
a Data Array as compared with preloaded customized criteria.
The user builds a table of patterns (strings of tokens separated by “-“) each linked to a particular location
in a target Data Array.
A “PATTERN DID NOT MATCH” string may also be defined and linked to a Data Array location.
A pattern is built based on the values in the Data Array at run time by the move function.
The pattern built at run time is compared with the preloaded table of patterns. The tokens in each
pattern must match exactly. If the preloaded pattern contains a wildcard (*), that token would not be
compared.
If the pattern matches a pattern in the table, its value will be stored in the target Data Array at the
specified location.
If the pattern does not match any of the preloaded patterns in the table a check is done for a “PATTERN
DID NOT MATCH” string in table. If found, the corresponding value will be stored in the target Data Array.
If a “PATTERN DID NOT MATCH” string is not defined, a default value of –1 will be stored and an SDO will
be generated prompting the user to add a “PATTERN DID NOT MATCH” record to the table.
In the example below, a combination of 4 values in a “Tokens” Data Array shows the status. The FieldServer can
perform “match-pattern” arithmetic and store the status as a single number 0 thru 8.
Data_Arrays
Data_Array_Name , Data_Format , Data_Array_Length
Tokens
, Byte
, 4
Status
, Int
, 1
Consider the following combinations of 4 values, here * is a wildcard. The token starting with the wildcard will not
be compared.
Data Array Values
Status Description
Status Value for Device
37 46 46 20 Good
0
36 * * 20 Channel disabled
1
* 45 * 20 Fault indicated2
2
* 43 * 20 Fault, aeration indicated 3
* * 45 20 Spacing indicator
4
* * 43 20 Zeromatc channel fault
5
* * 42 20 Empty Pipe
6
* * 37 20 hi/lo flowrate
7
00 00 00 00 comm. Error
8
None of the above
111