The text of a manual · part 17 of 27
AdaptaScan Software (Cat. No. 2755-ASN) User Manual: 10 - Defining Messages
Pages 138 to 152 of 224, from AdaptaScan Software (Cat. No. 2755-ASN) User Manual
The original document is the PDF (2.8 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 Accu-Sort 2755-SN3, Accu-Sort 2755-SN5, Allen-Bradley 2755-SN5, Accu-Sort 2755-SN8 and Allen-Bradley 2755-SN8
Page 138
Chapter
Chapter Objectives
10
This chapter describes the message data the Reader transmits after decoding bar code symbols. Section
Page
What is a Message?
10–2
Message Samples
10–3
Defining Messages
10–4
Configuring the Bar Code Contents of a Message
10–6
Configuring Optional Fields for a Message
10–8
Configuring the Format of a Message
10–10
DeviceNet Messages
10–12
Using Pass-Through to DeviceNet
10–15
Page 139
10–2
What is a Message?
A message is a series of data strings that the Reader transmits when bar code symbols are decoded. These fields contain decoded bar code data and other information such as package count. Messages are sent to a host at the end of a trigger or after a valid package. The message format is shown below. The length of the fields (number of ASCII characters) is shown in parentheses. ASCII BAR CODE DATA
13. Transmission Check (0 to 2) 12. End Message (0 to 3) 11. Counter (10) 10. Scan Count (0 or 2) 9. Field Delimiter (0 or 1) 8. Field Delimiter (0 or 1)
7. Bar Code Data or No-Read Message, 0 to 64 characters, including start, stop, and check characters. Up to 64 characters will be sent for each field read (fields separated by a delimiter). Codabar Stop Character follows Codabar Check Characters, if sent.
6. Margin (0 or 2) 5. Symbology (0 or 2) 4. Source (0 or 2) contains DeviceNet Address (MAC ID) 3. Field Delimiter (0 or 1) 2. Header Message (0 to 32) 1. Source Identifier (0 to 8)
Some fields are provided by the decoded bar code symbol. However, most of the fields are specified by the Message Format and Field Edit dialogs.
Publication 2755-838
Page 140
10–3
Message Samples
This section shows some sample messages. Example 1: If one Code 39 label is decoded, the decoder transmits:
Header Message
End Message Characters Package Count Bar Code Data End of Package Double Delimiter Code 39 Symbology Type Indicator
Source Identifier
Source Field Delimiter
Example 2: If two Code 39 labels are scanned on a single package, the decoder transmits:
Header Message Source Identifier
End Message Characters Package Count End of Package Double Delimiter Bar Code Data Code 39 Symbology Type Indicator Source Field Delimiter Bar Code Data Code 39 Symbology Type Indicator Source Field Delimiter
Example 3: If a No-Read occurs, the decoder transmits:
End Message Characters Package Count End of Package Double Delimiter No-Read Message
Header Message Source Identifier
Source Field Delimiter
Note: Message packages can consist of both bar code strings and no-read strings.
Publication 2755-838
Page 141
10–4
Defining Messages
From the Message dialog, you configure the content and format of bar code messages sent to the host. Open the Message dialog by selecting the Message button on the main Project dialog.
Note: If Triggered By is not enabled, data will not be transmitted to a host.
Field Definitions Displays a list of defined message fields. Initially, the Field Definitions area is blank. Select
To
New
Open the Message Field dialog allowing you to create a new message field. Open the Message Field dialog for the highlighted message field.
Edit
Publication 2755-838
Cut
Cut the highlighted message field to the clipboard.
Paste
Move the message field from the clipboard to Field Definitions listing. Select Paste to make copies of the field.
Page 142
10–5
Triggered By Specifies the trigger that sends a message to the host. The Reader sends messages at the end of a trigger or when data is available. Note: If DeviceNet is selected as the host (page 10–10), messages are queued until requested by the DeviceNet master (see Message Flow Control page 10–13). The trigger controls when messages are placed in the queue. Select
To
Enable
Enable the message trigger. If not selected, messages are not sent. Select the Reader that is the source of the trigger. Select the input on the specified device (Reader) to trigger a message send. Send a message at the end of a trigger.
Device Input Send at End of Trigger Send When All Fields Are Satisfied.
Send a message immediately when all of the expected fields have been decoded or at the end of the trigger.
Any configured input is available as a message trigger, including: Select
To
Package Detect
Use the package detect input as the trigger source.
Timer
Use the internal Reader timer as the trigger source.
ASCII Command Input Timer
Use an ASCII command as the trigger source. Use the input timer as the message trigger.
DeviceNet Inputs 1!7
Use a DeviceNet input as the message trigger.
[Decoder]
Use the decode trigger as the trigger source.
[Package]
Use the package trigger as the trigger source.
[Match Table]
Use the match table trigger as the trigger source.
[Message]
Use the same message trigger used by another Reader.
Publication 2755-838
Page 143
10–6
Configuring the Bar Code Contents of a Message
The Message Field dialog defines the bar code contents of messages sent to another device. Open this dialog by selecting the New or Edit button on the Message dialog.
Important: If you leave the find String blank and select Match Exactly, all decoded data is sent.
☞ Configure a message so that it contains only data required by the application to increase response times.
Field Name Specifies a unique name for the bar code data field. Find String Specifies the bar code data string for which the Reader searches. When the string is found, the Reader replaces the bar code data with the replacement strings (see Message Field Edit Dialog). The find string may contain search metacharacters, refer to Appendix C. Important: If you leave the Find String blank and select Match Exactly, all decoded bar code data is sent. This functions the same as using the .* metacharacters in the Find String and deselecting Match Exactly. Select
To
Match Exactly
Enable/Disable metacharacters. When selected, metacharacters are normal ASCII characters. Disable the find and replace function. When selected, the Reader will not search for strings within the decoded bar code data.
Disable
Publication 2755-838
Page 144
10–7
Symbol Source Specifies the source(s) of the bar code data in the message field. Field data may come from several sources. To select more than one Reader, hold down the [Shift] or [Ctrl] keys while making the selection. [Shift] selects a group of consecutive listings and [Ctrl] selects nonconsecutive listings. Bar Code Labels & Symbols Specifies the label or symbol data to include in the message field. Only the symbol and label data available from the selected Readers is displayed. The message field may contain data from one or more Readers. To select more than one label or symbol, hold down the [Shift] or [Ctrl] keys while making the selection. [Shift] selects a group of consecutive listings and [Ctrl] selects nonconsecutive listings.
Publication 2755-838
Page 145
10–8
Configuring Optional Message Parameters
The Message Field Edit dialog configures optional data fields and parameters to include in messages sent to the host. Open this dialog by selecting the Edit button on the Message Field dialog.
Include in Field Displays a list of data fields to include in the message. Select:
To:
Source
Include the DeviceNet Address (MAC ID) in a message.
Margin
Include 2 digit margin of the decoded symbol in a message.
Symbology
Include the 2-digit symbology code in the message. 01 = Code 39 02 = I 2 of 5 03 = Codabar 04 = UPC-A 05 = UPC-E 06 = EAN-8 07 = EAN-13
08 = Code 128 09 = Pharma Code 10 = Code 93 11 = Discrete 2 of 5 12 = USPS 2 of 5 13 = Matrix 2 of 5
Type Determines the data type in which to send messages.
Publication 2755-838
Select:
To:
Text
Send data in an ASCII format.
Page 146
10–9
Alignment Determines the alignment of data in messages. Select:
To:
Left
Align data with the left side of a field.
Right
Align data with the right side of a field.
Minimum Length Specifies the minimum number of characters (0-64) required in a message field. Message fields less than the minimum length are padded with a fill character. Fill Character Specifies the character to use for padding positions in a message field that is less than the minimum length. Use any ASCII character (0 to 255) as a fill character. The default = 32 (Space). Refer to Appendix A for an ASCII conversion chart. Replacement Strings Specifies the exact string and/or metacharacters to use in the replacement string. Important: If you leave the Pass string blank and Match Exactly checked, all decoded data is placed in the message field (functions same as & metacharacter). Some earlier firmware releases required a Pass rule. Note: Replacement string fields support metacharacters. Refer to Appendix C for a description of the available metacharacters. Make sure that the characters you enter are not misinterpreted as a metacharacter string or unintended operation may result. Select:
To:
Pass
Specify a string to replace the bar code data field when the find string is located in the message. If no string is provided and Match Exactly is checked, all decoded data is placed in the message. Specify a string to replace the bar code data field when the find string is not located in the message. If no string is provided, fill characters are inserted into the message; the number of fill characters depends upon the minimum message length.
Fail
Publication 2755-838
Page 147
10–10
Configuring the Message Format
The Message Format dialog configures the format of messages sent by the Reader. Open this dialog by selecting the Format button on Message dialog.
Header Specifies the ASCII string to send as a message header. Enter 1 to 32 characters, a blank field indicates that no header is sent. The header may contain non-printable characters, see page A-3. Trailer Specifies the ASCII string to send as a message trailer. Enter 1 to 32 characters, a blank field indicates that no trailer is sent. The trailer may contain non-printable characters, see page A-3. Source ID Specifies an identifier to indicate the source of the data. Each Reader can use a different identifier to track the source of each message, for example “Reader #3”. Swap and Pad When selected, high and low data bytes swap positions. Select swap bytes when sending the message to a PLC/SLC. An odd number of bytes is padded with a zero so that messages always contain an even number of bytes. Note: Pass-Through data is not swapped.
Publication 2755-838
Page 148
10–11
Field Delimiter Specifies a 3-digit decimal equivalent of an ASCII character to indicate the start and end of bar code label data. When Disable is selected, delimiters are not inserted into the message data. Field Data When selected, bar code field data is included in the message. Scan Count When selected, sends the number of scans decoded within the decoder trigger period (up to 99). Counter Select:
To:
Include
Include counter data in each message.
Device
Specify the Reader source of the counter data.
Counter
Specify the counter data (package or match entry) to include in the message.
Message Destination Specifies the communications port connector through which bar code messages are sent. Select:
To:
DeviceNet
Send messages out through the DeviceNet port. See next page for additional information. Send messages out through the RS-232, RS-422, or RS-485 port connectors.
Serial Port
Handshaking When selected, allows the PLC or SLC to control the transfer of message data. Refer to DeviceNet messages (next page). Current Message Size Displays the message size in bytes as it is configured. Size is updated as selections are made. Use the message size when setting up your DeviceNet scanner message addressing (see page 10–13).
Publication 2755-838
Page 149
10–12
DeviceNet Messages
DeviceNet Master-Slave Communications The AdaptaScan Reader connects to other DeviceNet slave devices through either a PLC (Catalog No. 1771-SDN) or SLC (Catalog No. 1747-SDN) DeviceNet Scanner. The AdaptaScan operates as a slave device to the DeviceNet scanner.
Message Formatting Bar code message data sent to an SDN (DeviceNet) scanner is formatted the same as messages sent through the serial port. Note the following when formatting messages:
• If a replacement string is longer than the length specified in the SDN scanner addressing, the message is truncated. • If a replacement message is shorter than the length specified in the SDN scanner addressing, the message is padded with the specified fill character. • If a pass/fail replacement string is longer than the length specified in the SDN scanner addressing, the least significant bytes are truncated. Note: You must select DeviceNet option as the message destination on the Message Format dialog.
Publication 2755-838
Page 150
10–13
Message Addressing Message Data is formatted the same as messages sent through the serial port. When setting up the DeviceNet scanner for addressing message data, use the following table. Description
Word #
Byte #
➀➁
Number of Characters (LSB) 2 2 Number of Characters (MSB) 3 First Message Character 4 (Beginning of Message) 3 Other Message Characters 5! from left to right Last Message Character 3+ N where N is the number of characters in (End of Message) the message. ➀ Bytes #0 and #1 (word 1) are reserved for Discrete I/O. See Page 9–14. ➁ Poll Rx Size = 4 + (# of Characters in string).
Message data is addressed and sent to other DeviceNet devices through a DeviceNet scanner (Catalog No. 1771-SDN or 1747-SDN). To configure the scanner, you will need to provide the size of the message data (see page 10–11), the beginning byte and bit number of the message and the destination of the message data.
Message Flow Control (Handshaking) DeviceNet Input #8 and Output #16 control the transmission of bar code messages when using DeviceNet master-slave. Refer to DeviceNet I/O in Chapter 9. Message flow control (handshaking) lets the controller know that data is available and keeps the Reader from sending out messages faster than they can be received. Your controller logic program must initiate transfers of the message data and set the DeviceNet Input #8 (Send Next Data) for message flow control. New Data Is indicated by changing the state of Discrete Output #16 of the DeviceNet I/O. A change of state (0$1) indicates that message data is new. Send Next Data By changing the state of Discrete Input #8 of the DeviceNet I/O, the PLC/SLC program control indicates the controller is ready to receive the next message. Note: The Application Guide (Publication 2755-6.8) included with this manual contains an application note for using DeviceNet Master / Slave communications.
Publication 2755-838
Page 151
10–14
Flow Control Example The following shows how DeviceNet Input #8 and Output #16 control the transmission of messages. Output #16 is changed by the Reader and Input #8 is changed by the controller. DeviceNet Scan Number 1 - Poll 1 - Response 2 - Poll 2 - Response 3 - Poll 3 - Response
Message Data
DeviceNet Output #16
No Message Sent
OFF (0)
Message 1 Sent
ON (1) ON (1)
Message 2 Sent
DeviceNet Input #8 OFF (0)
OFF (0) OFF (0)
Note: You can disable handshaking by deselecting the handshake checkbox (see page 10–11). With handshaking disabled, it may be possible to miss data if the Reader decodes data too fast for the controller. In addition, identical data may not be read unless data that changes such as package count is added to the message sent by the Reader.
Publication 2755-838
Page 152
10–15
Using Pass-Through to DeviceNet
The Serial Port dialog (page 8–5) contains a check box for Enable Pass-Through to DeviceNet. With this box selected, data from the serial port is passed through to a DeviceNet master-slave network. Hand-Held Scanner User Supplied Cable to AdaptaScan RS-232 Port
PLC-5 with 1771-SDN (DeviceNet Scanner)
To AdaptaScan DeviceNet Port
To Other DeviceNet Devices
To connect a device such as a decoded hand-held scanner, you will need to create a custom cable. The AdpataScan Reader user manual (Publication 2755-837) shows the AdaptaScan serial port connections. In the above example, the scanner data is input directly into the AdaptaScan RS-232 serial port. The AdaptaScan reader outputs the data to its DeviceNet port. To the rest of the DeviceNet network it appears that the data is coming directly from the reader. Note: If the serial port receives more characters than the controller is configured to accept, 0s will appear in the data field. The 0s indicate that the file size is being exceeded.
Publication 2755-838