CDN36X User Manual
revision 1.30
Example 3 – Transmitting Data
Print an ASCII string from a PLC to a serial printer, using a CDN366 gateway and a DeviceNet
scanner (master). The text message string can be from 1 to 64 characters long, including any
ASCII control characters. The serial printer 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.
PLC & DeviceNet Scanner
CDN366
Gateway
DeviceNet network
Serial Printer
RS232
Power
Supply
Serial Printer
The serial printer’s RS232 channel is set for 300 bps, 7 data bits, even parity, and 2 stop bits. It
uses XON / XOFF software flow control.
CDN366 Gateway
The CDN366 serial channel is configured to transmit this RS232 message format. The
Serial
Stream
Object attributes are shown below 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
3. Baud Rate
300
0x40 0x01 0x03 0x01 0x2C
300 bps
4. Data Bits
7
0x40 0x01 0x04 0x07
7 data bits
5. Parity
2
0x40 0x01 0x05 0x02
Even parity
6. Stop Bits
2
0x40 0x01 0x06 0x02
2 stop bit
7. Flow Control
1
0x40 0x01 0x07 0x01
XON / XOFF
The next step is to configure the CDN366 gateway to transmit data received from the DeviceNet
scanner to the serial printer. To allow the printing of any text message, the gateway is
configured to pass through the ASCII data bytes from the scanner to the printer. The gateway
will receive a Short_String variable from the scanner. Only one
Serial Transmit Object
Instance
will be configured, to process the one data variable. The
Data Type
is Short_String, with a
Data
Size
of 65 (maximum text message size is 64, plus the length byte). The
Transmit Mode
is
Use
Data
.
Serial Transmit Object Instance 1 Configuration (Class Code 66 or 0x42)
Attribute
Data
Class / Instance / Attribute / Data
Description
6. Transmit Mode
1
0x42 0x01 0x06 0x01
Use Data
9. Data Type
218
0x42 0x01 0x09 0xDA
Short_String
10. Data Size
65
0x42 0x01 0x0A 0x41
1 length byte, 64 data bytes
15. Data in I/O Command
1
0x42 0x01 0x0F 0x01
Enable data in I/O command
MKS Instruments, Inc.
D.I.P. Products Group
86