
DN120 DeviceNet Gateway User’s Manual
Microscan Systems, Inc.
63
Example 3 – Receiving Post-Delimited Data
Same configuration as Example 1.
Barcode Scanner
The barcode scanner’s RS232 channel is set for 9600 bps, 8 data bits, no parity, and 1 stop bit.
When it reads a UPC label, it transmits following ASCII message format. The message always
begins ends with the ASCII ETX end-of-text (0x03) character. The barcode data will consist of
a variable number of 1 to 14 ASCII characters, depending upon the UPC label being scanned. It
will not transmit a 0x03 in the barcode data field.
[ ASCII barcode data ] [ ETX ]
DN120 Gateway
The receive mode will be
Post-Delimiter Mode
, because the barcode messages always end with
the same character. The
Delimiter
is 0x03 (ETX), and will not be included in the receive data.
The
Maximum Receive Size
is 15, because the largest message contains 14 ASCII bytes and 1
ETX byte. The received bytes will be returned a Short String. The gateway will only return new
data bytes once in the Poll Response Message. The
Status
byte will be enabled.
The
Serial Stream Object
can now be configured. The following shows the
Serial Stream Object
attribute settings for this application. The 3rd column lists the address string if using
Set_Attribute_Single commands to write the attribute values.
Serial Stream Object
Configuration (Class Code 64 or 0x40)
Attribute
Data
Class / Instance / Attribute / Data
Description
6. Baud Rate
0
0x40 0x01 0x06 0x00
0 = 9600 bps
7. Parity
0
0x40 0x01 0x07 0x00
0 = no parity
10. Flow Control
2
0x40 0x01 0x0A 0x02
2 = CTS / RTS
13. Max Receive Size
15
0x40 0x01 0x0D 0x0F
Receive messages up to 15 bytes
14. Data Format
00000001
0x40 0x01 0x0E 0x01
String Format = Byte Array
15. Block Mode
00000110
0x40 0x01 0x0F 0x06
Delimiter = enabled
Strip Delimiter enabled
Post-Delimiter
16. Delimiter
ETX
0x40 0x01 0x10 0x03
0x03 = ASCII ETX character
The gateway will return up to 16 bytes of Receive Data, because the Maximum Receive Size is
set to 15 and the data format is Short String (add 1 for length byte). The Status byte is enabled.
The Receive Sequence Number byte is not enabled. The Poll Produce Size can now be
calculated for this DN120 configuration.
Status byte
1
Receive Sequence Number byte
0
Short_String length byte
1
+
Maximum Receive Size
15
Poll Produce Size
17