The text of a manual · part 17 of 42
DS/DD Series B Enhanced Bar Code Decoders User Manual (Bulletin 2755): 10 -Configuration: Host Message Replacement Rules, pages 146 to 154
Pages 146 to 154 of 361, from DS/DD Series B Enhanced Bar Code Decoders User Manual (Bulletin 2755)
The original document is the PDF (1.4 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 2755-DD and Allen-Bradley 2755-DS
Page 146
Configuration: Host Message Replacement Rules
10–11
If Scanner A reads the following symbols: AB1
1AB
BA1
Then the host message would be AB1AB1AB1. Since the first symbol read satisfies the search criteria, it will continue passing through the rule until all host fields are filled. Changing the symbol number to 2 would lead to a host message of 1AB1AB1AB. Instead, if the Symbol Number parameter is set to All and the host message field number is set to All, then each symbol that has satisfied a rule is “marked”. That symbol’s marked status prohibits other rules with both Symbol Number and Host Message Field Number parameters set to All from using it. For example, resetting the symbol number to All in the configuration illustrated above results in a host message of AB11ABBA1. This occurs because AB1 (the first symbol read) satisfies the rule and is used for host field one. Since AB1 has now been used, and both symbol number and host message field number are set to All, AB1 won’t be considered for the second pass through the rule. Instead, 1AB will satisfy the rule on the second pass, and will be used for host field two and will be marked so it will not be considered for the third pass. BA1 satisfies the third pass, and will be used for host field three.
Find String Containing Field Type Options Any valid string up to 24 Edit Text characters in length Blank
If not blank, enables the selected rule number and specifies a string for which to search among incoming symbols. The string may consist of any valid combination of ASCII characters and metacharacters. All the Find String Containing fields are empty by default, which disables all host message replacement rules. Only enabled rules will affect decoder performance. All rules are empty – and therefore disabled – at default startup.
Publication 2755-833
Page 147
10–12
Configuration: Host Message Replacement Rules
Replace Entire String With Field Type Options Any valid string up to 24 Edit Text characters in length Blank
Defines the string or expression that should be sent to the host to replace the string that was matched by the search pattern currently in effect. Whenever the search pattern is satisfied, the replacement pattern defined here will be substituted for the entire string. Even if the search pattern is only a portion of the incoming string, the entire incoming string is replaced by the replacement pattern. For an example of how to replace only a portion of the incoming string, see Example 9 at the end of this chapter. The resulting string appears in the field defined by the host message field number. The string or expression may consist of any valid combination of ASCII characters and metacharacters. The default value is Blank.
Minimum Field Length Field Type Options Edit Numeric
0 through 64 0
Specifies the minimum number of characters in any field that satisfies the rule. Fields that are longer than the minimum field length remain unchanged, but fields that are shorter than the minimum length are padded to meet the minimum value. Fill characters appear either before or after the existing field, depending on the field’s alignment. The default value is 0, which means minimum field length, alignment, and fill character functions are all disabled. Allowable values are any number from 0 to 64.
Publication 2755-833
Page 148
Configuration: Host Message Replacement Rules
10–13
Alignment Field Type Options Select
Left Right
Determines whether the data in the host message should align to the left or right edge of the field. The default is Right. As described above, fill characters will be applied before the text (pushing the text to the far right) in right justified fields, and after the text (pushing the text to the far left) in left justified fields.
Fill Character Field Type Options Edit ASCII
Any ASCII Character 0–255 0 = None
Specifies a character to insert in the field when its length is less than the minimum field length selected above. For example, if the result of a successful replacement is the ABCD, with a minimum field length of nine, left alignment, and a fill character of ASCII 35 (#), the resulting field would look like: ABCD##### Appendix I contains a complete chart of ASCII characters and their values.
Host Message Field Number Field Type Options Edit Numeric
1 through 16 All
Specifies to which of the 16 available field numbers the currently displayed rule applies. The default value is All. Other allowable values include the numbers 1 through 16. Since rule processing applies to the rules in numerical order (1 through 16), once a field is satisfied by a rule, no other rule with the same host message field number will be processed. Note: Using a combination of All in the symbol number field and All in the host message field number field within a rule creates a special situation in which the decoder will attempt to match the rule using only those symbols that have not previously satisfied this rule or any other.
Publication 2755-833
Page 149
10–14
Configuration: Host Message Replacement Rules
Assembling a Host Message Some applications demand nothing more than a stream of raw bar code data to be of use. However, interpretation and manipulation of that raw data proves useful in many production situations. Host message replacement rules make that interpretation and manipulation possible. When assembling a host message, the decoder software calls upon the rule processor to fill in each position of the host message beginning with the first host message field, and proceeding in order to the last. Up to 16 fields can be specified for each message. The exact number is determined by the setting in the Host Message Format screen’s number of fields in host message. If the number of fields in host message value is All, then the number of fields in the host message will equal the value appearing in the Symbols per Package parameter on the Scanner Control screen. However, when its value is 1 to 16, then the decoder sends back exactly that number of fields. In a case where the number of fields read does not equal the specified number of symbols per host message, the host replacement rules, if active, will determine which data is sent to the host. If the rules are inactive, symbol data will be sent in the order decoded, up to the value specified in the number of fields in the Host Message parameter. In cases where there are fewer symbols than there are fields specified, then the decoder will send no-read message strings as explained below. If no rule finds a match for a given host message field, it inserts the no-read replacement string for that field number. In cases where the no-read replacement string has not been defined for that particular field number, then the decoder inserts the default no-read string. Finally, if the default no-read string is not defined, then the decoder leaves the field blank.
Publication 2755-833
Page 150
Configuration: Host Message Replacement Rules
10–15
Examples Example 1: Sorting by Data Source Parameter Rule #1 Value
Rule #2 Value
Source A
B
Symbology Any
Any
Symbol Number All
All
Find String Containing .*
.*
Replace Entire String & With
&
Minimum Field Length 0
0
Alignment Right
Right
Fill Character None
None
Host Message Field 1 Number
2
In the decode mode Coordinated 1 or 2, two symbols per package and each scanner reading a single symbol, the data from Scanner A will always appear first, and the data from Scanner B second. Appropriate No-Read messages may be selected for each scanner by using the No-Read Replacement Rules. Example 2: Identifying the Source of Data Parameter Rule #1 Value
Rule #2 Value
Source A|B
Aux
Symbology Any
Any
Symbol Number All
All
Find String Containing .*
.*
Replace Entire String & With
& Aux Data
Minimum Field Length 0
0
Alignment Right
Right
Fill Character None
None
Host Message Field 1 Number
1
All scanner data will be sent to the host as received. Data entered into the AUX Port will be sent with the characters “Aux Data” appended to the data. In a real application, it may be critical to know the source of information. The Host Replacement Rules make this possible. (Also see Source Identifier.)
Publication 2755-833
Page 151
10–16
Configuration: Host Message Replacement Rules
Example 3: Sorting by Symbology By setting up specific rules to check for symbology, different code types may be sent to the host in a predetermined order. Parameter Rule #1 Value
Rule #2 Value
Source A|B
A|B
Symbology Code 128
I 2 of 5
Symbol Number All
All
Find String Containing .*
.*
Replace Entire String & With
&
Minimum Field Length 0
0
Alignment Right
Right
Fill Character None
None
Host Message Field 1 Number
2
In this case, 2 symbols per package will be read. The symbols are sent to the host with the Code 128 symbol first, or its No-read Replacement Message. This technique may be useful in applications where these two symbologies are used together. Example 4: Sorting by Symbol Number Parameter Rule #1 Value
Rule #2 Value
Source A|B
A|B
Symbology Any
Any
Symbol Number 2
1
Find String Containing .*
.*
Replace Entire String & With
&
Minimum Field Length 0
0
Alignment Right
Right
Fill Character None
None
Host Message Field 1 Number
2
The above rules allow the host to receive the symbol data in reverse order from the order it was decoded. The first symbol decoded (symbol number 1) will be sent as field number 2, while symbol number 2 will be sent first.
Publication 2755-833
Page 152
Configuration: Host Message Replacement Rules
10–17
Example 5: Sorting Symbols by Data Identifiers Rule #2 Value
Rule #3 Value
Rule #4 Value
Source A|B
A|B
A|B
A|B
Symbology Any
Any
Any
Any
Symbol Number All
All
All
All
^Q( . * )
^S( . * )
^V( . . . . . )$
Replace Entire \1 String With
Qty = \1
\1
\1
Minimum Field 0 Length
0
0
0
Alignment Right
Right
Right
Right
Fill Character None
None
None
None
Host Message 1 Field Number
2
3
4
Parameter
Rule #1 Value
Find String ^P( . . . . . . . Containing )$
This example illustrates the effects of sorting host data using data identifiers. Specifications such as AIAG and ODETTE use these unique characters to identify specific data within a group of symbols. These characters are embedded into the encoded Bar Code symbol. Although not always printed in the human readable text, they appear as the first character (or group of characters) in the symbol. In this example data are sorted so that the part number, quantity, serial number, and supplier identification are sent to the host in that particular order. By using the parentheses in the search string and the “\1” in the replace string, we are able to strip off the data identifier, and send only the data desired. In this example, if the part number does not have exactly 7 characters after the identifier, it will fail the rule and not be sent. In rule #2, we search for the quantity identifier. If the symbol Q100 was read, we would send “Qty = 100” with the replace string “Qty = \1”
Publication 2755-833
Page 153
10–18
Configuration: Host Message Replacement Rules
Example 6: Sorting by Unique Characters and/or Strings Parameter Rule #1 Value Source A|B Symbology Any Symbol Number All Find String Containing ^6[2–9] | ^[7–9][0–9]$ Replace Entire String With & Minimum Field Length 0 Alignment Right Fill Character None Host Message Field Number 1
This rule checks symbols as they are decoded for values between 62 and 99. All other symbols would be ignored by this rule. Values between 62 and 99 are sent to the host. Note the ^ and $ are required to avoid matching strings such as 562 or 758 that do contain the desired string data (62 and 75), but are not the desired matches. Example 7: Stripping Unwanted Characters Parameter Rule #1 Value Source A|B Symbology Any Symbol Number All Find String Containing
^0*( . * )$ this example)
($ is optional in
Replace Entire String With \1 Minimum Field Length 0 Alignment Right Fill Character None Host Message Field Number 1
This example strips leading zeroes off the decoded symbols. For example, the symbol 00012345678905 would be sent to the host as 12345678905.
Publication 2755-833
Page 154
Configuration: Host Message Replacement Rules
10–19
Example 8: Stripping Unwanted Characters Parameter Rule #1 Value Source A|B Symbology UPC-A Symbol Number All Find String Containing ^( . . . . . . )(. * ) Replace Entire String With \2 Minimum Field Length 0 Alignment Right Fill Character None Host Message Field Number 1
This rule allows the number system character (first character) and the next 5 characters (the manufacturer’s identification code) to be dropped when the data is sent to the host. This technique can be useful in obtaining maximum throughput, as it helps minimize communication and host program sorting time. Example 9: Substituting Characters Within a String Parameter Rule #1 Value Source A|B Symbology Any Symbol Number All Find String Containing ( . * )(123)( . * ) Replace Entire String With \1ABC\3 Minimum Field Length 0 Alignment Right Fill Character None Host Message Field Number 1
This example will substitute “ABC” for “123” within the string. Note that if “123” appears more than once within the incoming data, “ABC” will be substituted only for the last occurrence. For example, “01234567” would become “0ABC4567”, and “01231237” would become “0123ABC7”.
Publication 2755-833