The text of a manual · part 3 of 7
Single/Dual-Head Enhanced Bar Code Decoders (Catalog No. 2755-DS1A, -DS4A, -DD1A, -DD4A) Series B Product Data, pages 14 to 20
Pages 14 to 20 of 40
The original document is the PDF (230 KB). 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-DS
Page 14
Product Data Bulletin 2755 Single/Dual-Head Enhanced Bar Code Decoders
AUX and LCD Display Parameters The decoder can display the following on an auxiliary terminal or an optional 2 line x 20 character per line alphanumeric LCD display to monitor:
• bar code data • output counters • decoder performance values • host messages The AUX terminal and LCD display can each display bar code data, output counter values and decoder performance indicators. The parameters on the screen shown below control how this data is formatted.
14
Page 15
Product Data Bulletin 2755 Single/Dual-Head Enhanced Bar Code Decoders
Host Message Replacement Rules Function 5 on the Select Operation menu accesses the Host Message Replacement Rules configuration screen. Use this function to modify the message sent to the host. Rule Status Each number represents an available host message replacement rule. Currently enabled rules are marked with an asterisk ( * ), Rules are enabled by assigning a value to the Find String Containing field. Host Message Replacement Rule Definition Displays the current search rule criteria (Source, Symbology, Symbol Number, and Find String Containing) and the replacement string to send to the host when matches are found. The rule definition also includes parameters to fix the field length, character used to “fill” the field, and the alignment of the string within the field. Example Testing Provides a “worksheet” where you can insert sample bar code strings to test your rules. Allows you to “debug” your replacement rule expressions for structural and logical errors before going on-line. Just input the test bar code string on the left. The string that appears in the host message after application of the displayed rule appears on the right. If your test string does not create a match, you will be notified of that fact on the right side of the screen.
Host message replacement rules may not be required in every application. They are unnecessary when your needs include simple object counting, or collection of raw bar code data. However, host message replacement rules will prove useful when you need to substitute a predetermined output message for specific bar code data during decoding. With them you can:
• send data in a particular, predefined order regardless of the order in which the labels were read
• mask bar code characters to simplify operations and speed processing • truncate or pad the length of the data package • substitute a predetermined text string for one or more expected values • convert abstract bar code contents into more easily understood text form • categorize labels based upon selected portions of their contents. Both the search and replacement strings that make up a Host Message Replacement Rule can consist of a combination of standard ASCII characters and special characters known as metacharacters. Metacharacters are used to perform logic functions on the incoming data string. 15
Page 16
Product Data Bulletin 2755 Single/Dual-Head Enhanced Bar Code Decoders
Metacharacters The decoder provides a complete set of special purpose characters you can use to perform logical functions on characters, expressions, or even entire strings. These characters are known as metacharacters. Metacharacters are string manipulation commands consisting of standard ASCII characters which you can embed within search or replacement strings. Each metacharacter conveys a specific instruction to the decoder software, and acts upon a clearly defined range within the string. Metacharacters can be used with standard alphanumeric characters to describe and manipulate even the most complex substitution scenarios with ease. Table 2 Search Pattern Metacharacters – Position Dependent Character
Description and Use Note: The following two metacharacters are position-dependent. They must appear in the location specified to be matched.
^
$ .
If the circumflex ( ^ ) is used as the first character in the search pattern, it indicates that the characters, other metacharacters, expressions, or strings must occur at the beginning of the string to be matched. Note that the circumflex has a special meaning if used within square brackets, as explained elsewhere in this chapter. When the dollar sign is used as the last character in the search pattern, it indicates that the characters, other metacharacters, expressions or strings must occur at the end of the string to be matched. The period represents any single character, and is used as a single-character “wildcard”. Note: These metacharacters refer to the character, metacharacter, string, or expression that immediately precedes them.
16
?
The question mark instructs the rule to match either no occurrence or one occurrence of what precedes it. This metacharacter is used in a search string where the character may not appear at all, or may appear once.
+
The plus sign instructs the rule to match one or more occurrences of what precedes it. This metacharacter is used in a search string where the character will be present, but you are unsure how many times it appears.
*
The asterisk instructs the rule to match none or more occurrences of what precedes it. This metacharacter is used in a search string in cases where the character may not appear, or may appear one or more times.
Page 17
Product Data Bulletin 2755 Single/Dual-Head Enhanced Bar Code Decoders
Table 3 Search Pattern Metacharacters – Logical Operators and Other Special Functions Character
Description and Use
[ ]
Square brackets ( [ ] ) instructs the rule to match an incoming string if any character enclosed within the brackets appears in the string. A range of values can be represented within the brackets by separating the first and last characters in the range by a hyphen. Square brackets must be used in pairs. Note: The circumflex ( ^ ) can be used as the first character within the square brackets to reverse the sense of the expression. Examples
( )
[ABC]
Matches “A”, “B”, or “C”
[L–P]
Matches “L”, “M”, “N”, “O”, or “P”
[0 – 9]
Matches “0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, or “9”
[^A – Z]
Matches any character that is not upper case alphabetic
Parentheses can be used in two different ways. They can be used in search patterns to group characters and metacharacters to form expressions. Parentheses must be used in pairs. Examples (AB)+
The plus sign applies to the expression (AB). Strings that would match this expression include: “AB”, “ABAB”, “123AB”, and “AB123”. Parentheses can also be used to identify strings for use in the Replace Entire String With field. If a character, string, or expression is surrounded by parentheses in a search pattern, then it can be later recalled in a replace pattern with the “\n” metacharacter described elsewhere in this chapter. Note: Parentheses may be nested to form complex expressions. |
A vertical bar (the shifted “\” character on the keyboard) instructs the rule to match an incoming string if the character or expression on the left or right of the vertical bar appears in the string. Examples
\
A|B
Matches “A” or “B” abc|123
Matches “abc” or “123”
The backslash indicates that the following character, which would normally be interpreted as a metacharacter, should instead be interpreted as a literal ASCII character. Note: The backslash is used differently in the Replace Patterns. Example \.
The period ( . ) will be interpreted as a period rather than a single character wildcard. 17
Page 18
Product Data Bulletin 2755 Single/Dual-Head Enhanced Bar Code Decoders
Table 4 Replacement String Metacharacters Character
Description and Use
\n
The backslash plus a number 1 through 9 recalls a previously saved string. Any character, string or expression that is surrounded by parentheses in the search pattern (as described earlier) can be recalled by the replace pattern using the “\n” format. Since the parentheses may be nested, the number “n” represents the order of the groupings as defined by the order of the left parenthesis in the search pattern. Examples Search Pattern = Replace Entire String With = Incoming String = Result for Host Message =
123(ABC) \1 123ABC456 ABC
The search pattern above matches the incoming string. The Replace Entire String With value states that the string identified within the first parentheses should be sent to the host. Search Pattern = Replace Entire String With = Incoming String = Result for Host Message =
(123(ABC)) \1\2 123ABC456 123ABCABC
The search pattern above matches the incoming string. The Replace Entire String With value states that the string identified within the first parentheses (123ABC), plus the string identified by the second parentheses(ABC) should be sent to the host. &
When the ampersand ( & ) is used in a replacement pattern, it indicates that the part of the string that matches the search pattern should be sent to the host. Therefore, if the string read contains more characters than the search pattern, then the additional characters are discarded. Examples Search Pattern = Replace Entire String With = Incoming String = Result for Host Message =
123ABC & 123ABC 123ABC
The search pattern matches the incoming string. The Replace Entire String With value states that the string identified in the search pattern should be sent to the host. Search Pattern = Replace Entire String With = Incoming String = Result for Host Message =
123ABC & 123ABC456 123ABC
The search pattern matches the incoming string. The Replace Entire String With value states that the string identified in the search pattern should be sent to the host. This does not include the digits 456.
18
Page 19
Product Data Bulletin 2755 Single/Dual-Head Enhanced Bar Code Decoders
Examples of Host Message Replacement Rules Example 1: Sorting the Host Message Contents by the Source of Data 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 & Minimum Field Length 0
& Aux Data 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 possible using optional Source Identifiers.)
19
Page 20
Product Data Bulletin 2755 Single/Dual-Head Enhanced Bar Code Decoders
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.
20