CDN36X User Manual
revision 1.30
Chapter 7 – Configuration Examples
This chapter contains four example gateway configurations.
Example 1 – Receiving Data
Read UPC labels into a PLC using a serial barcode scanner, a CDN366 gateway, and a
DeviceNet scanner (master). The barcode scanner RS232 channel is connected to a CDN366
serial channel. The CDN366 DeviceNet channel is connected to the PLC DeviceNet scanner.
The DeviceNet network is powered by an external 24VDC power supply.
Barcode Scanner
PLC & DeviceNet Scanner
Power
Supply
CDN366
Gateway
UPC labels
RS232
DeviceNet network
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 the following ASCII message format. The message
always begins with the ASCII STX start-of-text (0x02) character, and always ends with the
ASCII ETX end-of-text (0x03) and CR carriage return (0x0D) characters. The barcode data will
consist of a variable number of 1 to 12 ASCII characters, depending upon the UPC label being
scanned.
[ STX ] [ ASCII barcode data ] [ ETX ] [ CR ]
CDN366 Gateway
The CDN366 gateway needs to be configured to receive this RS232 message format. The first
step is to determine the
Delimiter Mode
. The barcode scanner transmits a variable-length
message packet, so
Length Mode
cannot be used.
Timeout Mode
may be used, but without
specific timing information for the barcode scanner’s RS232 channel it may be difficult to derive
a suitable
Packet Timeout
value.
List Mode
is best suited for this application, because the serial
message always begins and ends with the same characters. 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. The last two attributes are Short_String data types.
Serial Stream Object Configuration (Class Code 64 or 0x40)
Attribute
Data
Class / Instance / Attribute / Data
Description
3. Baud Rate
9600
0x40 0x01 0x03 0x25 0x80
9600 bps
4. Data Bits
8
0x40 0x01 0x04 0x08
8 data bits
5. Parity
0
0x40 0x01 0x05 0x00
no parity
6. Stop Bits
1
0x40 0x01 0x06 0x01
1 stop bit
7. Flow Control
2
0x40 0x01 0x07 0x02
CTS / RTS
10. Delimiter Mode
1
0x40 0x01 0x0A 0x01
List Mode
11. Pre-Delimiter String
0x01 0x02
0x40 0x01 0x0B 0x01 0x02
Short_String length = 1, STX
12. Post-Delimiter String
0x02 0x03 0x0D
0x40 0x01 0x0C 0x02 0x03 0x0D
Short_String length = 2, ETX CR
MKS Instruments, Inc.
D.I.P. Products Group
82