D.I.P. CDN366 User manual

CDN36X Series
DeviceNet Gateway
User Manual
CDN366 – 1 isolated RS232 channel
CDN367 – 1 isolated RS422/RS485 channel

CDN36X User Manual revision 1.30
Table of Contents
CHAPTER 1 – OVERVIEW......................................................................................................................................4
CHAPTER 2 – INSTALLATION..............................................................................................................................5
MOUNTING ................................................................................................................................................................5
WIRING .....................................................................................................................................................................6
DeviceNet Interface .............................................................................................................................................6
Serial Channel Interface......................................................................................................................................6
Wiring Examples..................................................................................................................................................7
CHAPTER 3 – THEORY OF OPERATION............................................................................................................8
CHAPTER 3 – THEORY OF OPERATION............................................................................................................9
GATEWAY OPERATION ..............................................................................................................................................9
DeviceNet Object Model......................................................................................................................................9
DeviceNet Object Model....................................................................................................................................10
DeviceNet Interface ...........................................................................................................................................10
Serial Channel Interface....................................................................................................................................13
Serial Stream Object .......................................................................................................................................................13
Serial Receive Object......................................................................................................................................................14
Serial Transmit Object ....................................................................................................................................................17
Asynchronous Serial Communictaion.............................................................................................................................18
Data Conversion..............................................................................................................................................................19
Serial Receive Example ..................................................................................................................................................22
Serial Transmit Example.................................................................................................................................................24
Synchronization ..............................................................................................................................................................25
Receive Synchronization ...........................................................................................................................................25
Transmit Synchronization..........................................................................................................................................26
CHAPTER 4 – GATEWAY CONFIGURATION..................................................................................................28
CONFIGURE DEVICENET INTERFACE .......................................................................................................................28
DeviceNet Baud Rate Switch..............................................................................................................................28
MAC ID Switches...............................................................................................................................................28
POWER UP GATEWAY..............................................................................................................................................29
DeviceNet Status LEDs......................................................................................................................................29
Serial Channel Status LEDs...............................................................................................................................29
Register EDS File ..............................................................................................................................................30
CONFIGURE SERIAL CHANNEL ................................................................................................................................31
SERIAL RECEIVE OBJECT SETTINGS.........................................................................................................................34
SERIAL TRANSMIT OBJECT SETTINGS......................................................................................................................37
CONFIGURE DEVICENET MASTER SCANLIST...........................................................................................................40
I/O Consume Size...............................................................................................................................................40
I/O Produce Size................................................................................................................................................41
CHAPTER 5 – DEVICENET SPECIFICATIONS................................................................................................42
DEVICENET MESSAGE TYPES..................................................................................................................................42
DEVICENET CLASS SERVICES..................................................................................................................................42
DEVICENET OBJECT CLASSES .................................................................................................................................42
IDENTITY OBJECT..............................................................................................................................................43
ROUTER OBJECT.................................................................................................................................................44
DEVICENET OBJECT ..........................................................................................................................................45
ASSEMBLY OBJECT............................................................................................................................................46
CONNECTION OBJECT.......................................................................................................................................47
SERIAL STREAM OBJECT..................................................................................................................................49
SERIAL RECEIVE OBJECT .................................................................................................................................50
MKS Instruments, Inc. D.I.P. Products Group 2

CDN36X User Manual revision 1.30
SERIAL TRANSMIT OBJECT..............................................................................................................................51
CHAPTER 6 – RSNETWORXCONFIGURATION EXAMPLE.....................................................................52
CONFIGURE DEVICENET INTERFACE .......................................................................................................................53
CONNECT ®ISTER EDS FILE............................................................................................................................53
CONFIGURE SERIAL CHANNEL ................................................................................................................................61
CONFIGURE SERIAL RECEIVE OBJECT INSTANCES...................................................................................................69
CONFIGURE SERIAL TRANSMIT OBJECT INSTANCES................................................................................................72
CONFIGURE DEVICENET MASTER SCANLIST...........................................................................................................75
CHAPTER 7 – CONFIGURATION EXAMPLES.................................................................................................82
EXAMPLE 1–RECEIVING DATA ..............................................................................................................................82
Barcode Scanner................................................................................................................................................82
CDN366 Gateway..............................................................................................................................................82
EXAMPLE 2–RECEIVING DELIMITED DATA............................................................................................................84
Barcode Scanner................................................................................................................................................84
CDN366 Gateway..............................................................................................................................................84
EXAMPLE 3–TRANSMITTING DATA........................................................................................................................86
Serial Printer .....................................................................................................................................................86
CDN366 Gateway..............................................................................................................................................86
EXAMPLE 4–TRANSMITTING DELIMITED DATA.....................................................................................................88
Serial Printer .....................................................................................................................................................88
CDN366 Gateway..............................................................................................................................................88
CHAPTER 8 – TROUBLESHOOTING .................................................................................................................90
APPENDIX A – PRODUCT SPECIFICATIONS..................................................................................................91
DEVICENET INTERFACE...........................................................................................................................................91
SERIAL CHANNEL....................................................................................................................................................91
ENVIRONMENTAL....................................................................................................................................................91
APPENDIX B – DEVICENET TEMPLATE..........................................................................................................92
APPENDIX C – ASCII CHARACTER CODES....................................................................................................93
MKS Instruments, Inc. D.I.P. Products Group 3

CDN36X User Manual revision 1.30
Chapter 1 – Overview
This document describes how to install, configure, and operate the CDN36X series of serial to
DeviceNet gateways. The following products are covered in this user manual:
Part Number FW Rev. Serial Channel
CDN366 2.04 or higher RS232 full duplex
CDN367 2.04 or higher RS422 full duplex / RS485 half duplex
The CDN36X gateways allow you to easily interface a wide variety of serial devices to any
DeviceNet industrial control network. Each gateway contains the feature-packed D.I.P.
DeviceNet core. Standard CDN36X products are tightly packaged and sealed in a rugged
industrial case. Board-level and customized gateways are also available upon request.
Isolated Serial Channel
(
male DB9 connector
)
Serial Status LEDs
(RX, TX)
Mounting Holes
DeviceNet MAC ID
Rotar
y
Switches
DeviceNet Baud Rate
DeviceNet Status LEDs
(NET, MOD)
Rotar
y
Switch
DeviceNet Channel
(
male 5-
p
in micro connector
)
Product Features CDN366 CDN367
500V isolated serial channel X X
RS232 with RTS/CTS flow control X
RS422 full duplex (4-wire) with terminating resistors X
RS485 half duplex (2-wire) with terminating resistor, repeater control signal X
XON/XOFF software flow control X X
300, 1200, 2400, 4800, 9600, 19200 bps serial data rates X X
Configurable data bits, stop bits, parity X X
128 byte transmit and 128 receive FIFO buffers X X
Receives up to 8 different serial messages X X
Transmits up to 8 different serial messages X X
Powered from DeviceNet 24VDC X X
Loss-of-ground protection circuitry X X
DeviceNet slave mode supports POLL, COS, EXPLICIT messages X X
Rotary switches set DeviceNet baud rate and MAC ID X X
4 bi-color status LEDs X X
I/O Byte-swap I/O option for compatibility with PLC Scanners X X
MKS Instruments, Inc. D.I.P. Products Group 4

CDN36X User Manual revision 1.30
Chapter 2 – Installation
This chapter describes how to install and connect the CDN36X gateway to a DeviceNet network
and your serial device.
Mounting
Mount on a horizontal or vertical surface. While the RTV encapsulation protects its circuitry,
the CDN36X serial channel connector is not rated for NEMA4 / IP65 environments. Mount the
gateway in a suitable location or enclosure for your application. The gateway will generate up to
1.4W of heat, so provide sufficient clearance and airflow to maintain 0°C to 70°C operating
temperature range. Use two screws (not provided) in the 0.19 inch mounting holes shown below
to fasten the CDN36X to the mounting surface.
0.65 0.45
0.50
0.12
Mtg. Holes 1.225
(2) 0.19 DIA.
1.225
0.725 0.625 DIA. On Case Wall
0.70
1.10
1.25
0.542
3.30
4.30
3.80
All dimensions
are inches
MKS Instruments, Inc. D.I.P. Products Group 5

CDN36X User Manual revision 1.30
Wiring
The CDN36X requires two connections – one to the DeviceNet network (male 5-pin micro
connector) and one to the target serial device (male DB9 connector). Follow all applicable
electrical codes in your area when mounting and wiring any electrical device.
All power is received from the DeviceNet network. The CDN36X draws up to 50mA from the
24VDC power supply. Select your DeviceNet cables and power supply so that it can provide
sufficient current for all networked devices at their peak operating power.
DeviceNet Interface
DRAIN
V+
V- CAN
_
H
CAN_L
Male 5-Pin Micro Connector
PIN SIGNAL COLOR DESCRIPTION
1 DRAIN NONE Cable shield or drain wire.
2 V+ RED DeviceNet 24VDC(+) power.
3 V- BLACK DeviceNet 24VDC(-) power.
4 CAN_H WHITE Communication signal.
5 CAN_L BLUE Communication signal.
Serial Channel Interface
1
9
5
6
23
78
4
Male DB9 Serial Connector
CDN366 (RS232)
PIN SIGNAL DESCRIPTION
1 NC No Connect. Do not connect any wires to NC pins.
2 RXD Receive Data. RS232 input signal.
3 TXD Transmit Data. RS232 output signal.
4 NC No Connect.
5 GND Ground. Common for RS232 signals.
6 NC No Connect.
7 RTS Request To Send. RS232 output signal.
8 CTS Clear To Send. RS232 input signal.
9 NC No Connect.
MKS Instruments, Inc. D.I.P. Products Group 6

CDN36X User Manual revision 1.30
CDN367 (2-WIRE RS485 configuration)
PIN SIGNAL DESCRIPTION
1 RXA RS485 differential data I/O signal.
2 RXB RS485 differential data I/O signal.
3 TR Internal 120Terminating Resistor, connected between pins 1 and 3. Connect
pin 2 to pin 3 to terminate DATA signals. Use at end of long twisted-pair cable.
4 NC No Connect. Do not connect any wires to NC pins.
5 GND Ground.
6 TXA Connect to pin 1 for 2-wire operation.
7 TXB Connect to pin 2 for 2-wire operation.
8 TR2 Internal 120Terminating Resistor, connected between pins 6 and 8. Do not
connect in 2-wire operation.
9 +5VDC Auxiliary 5VDC supply generated by CDN36X.
CDN367 (4-WIRE RS422 configuration)
PIN SIGNAL DESCRIPTION
1 RXA RS422 differential receive data input signal.
2 RXB RS485 differential receive data input signal.
3 TR Internal 120Terminating Resistor, connected between pins 1 and 3. Connect
pin 3 to pin 2 to terminal RX signals. Use at end of long twisted-pair cable.
4 NC No Connect. Do not connect any wires to NC pins.
5 GND Ground.
6 TXA RS422 differential transmit data output signal.
7 TXB RS422 differential transmit data output signal.
8 TR2 Internal 120Terminating Resistor, connected between pins 6 and 8. Connect
pin 7 to pin 8 to terminate TX signals. Use at end of long twisted-pair cable.
9 +5VDC Auxiliary 5VDC supply generated by CDN36X.
Wiring Examples
The following are typical CDN36X gateway wiring configurations. Your RS232 or RS422/485
interface may vary. Refer to your device’s documentation for the required data and control
signals.
CDNx66
2
3
5
RXD
TXD
GND
1
2
3
4
5
DRAIN
VDC+
VDC-
CAN H
CAN L
RXD
TXD
GND
2
3
5
RS232
Serial
Device
Simple RS232 Interface
MKS Instruments, Inc. D.I.P. Products Group 7

CDN36X User Manual revision 1.30
CDNx66
2
3
5
RXD
TXD
GND
1
2
3
4
5
DRAIN
VDC+
VDC-
CAN H
CAN L
RXD
TXD
GND
2
3
5
RS232
Serial
Device
RS232 Interface, HW Flow Control
7
8
RTS
CTS
RTS
CTS
7
8
CDNx67
1
2
3
DATAB
DATAA
TR
1
2
3
4
5
DRAIN
VDC+
VDC-
CAN H
CAN L
DATAB
DATAA
RS485
Serial
Device
Simple RS485 Interface
120
Connect pins 2 & 3
to terminate cable
CDNx67
1
2
3
RXB
RXA
TR
1
2
3
4
5
DRAIN
VDC+
VDC-
CAN H
CAN L
TX B
TX A
RS422
Serial
Device
RS422 4-Wire Interface
120
RX A
RX B
4
5
6
7
8
LOOP
LOOP
TXB
TXA
TR2 120
Connect pins 2 & 3 (RX) and
p
ins 7 & 8 (TX) to terminate cables.
Connect pins 4 & 5.
MKS Instruments, Inc. D.I.P. Products Group 8

CDN36X User Manual revision 1.30
Chapter 3 – Theory of Operation
This chapter describes how the CDN36X gateway operates. You should have a working
knowledge of DeviceNet and asynchronous serial communications before continuing. The Open
DeviceNet Vendors Association (www.odva.com) is a good source for general DeviceNet
information. Refer to your serial device documentation for its protocol information.
Gateway Operation
The CDN36X gateway receives asynchronous serial messages over its serial channel, converts
them to data values, and returns the values as input data to the DeviceNet master. The gateway
receives output data from the DeviceNet master, converts them into serial messages, and
transmits the messages out its serial channel. The following diagram shows the major gateway
components.
Gateway Core
• microcontroller
• RAM
• Flash ROM
DC:DC Power Conversion
• 24VDC DeviceNet power input
• VDC for Core & DeviceNet channel
• isolated VDC for serial channel
DeviceNet Channel
• 24VDC power
• communications
Serial Channel
• c
• flow control
ommunications
5-pin male
micro connector Male DB9
connector
Serial Stream Object
Serial Transmit Object
(up to 8 Instances) Serial Receive Object
(up to 8 Instances)
Devicenet I/O Response
input data
serial
messages
DeviceNet Object
or Rotary Switches
DeviceNet I/O Command
output data
Configures the DeviceNet
interface baud rate and
MAC ID address.
Converts output data from
DeviceNet master to message
packet. Transmits message
packet out the serial channel.
Converts received message
packet to input data. Input
data returned to DeviceNet
master.
Configures the serial channel.
Scans channel for valid message
packets, which are passed to
Serial Receive Object instances.
MKS Instruments, Inc. D.I.P. Products Group 9

CDN36X User Manual revision 1.30
DeviceNet Object Model
The DeviceNet Specification defines an Object Model that consists of Objects and Attributes.
An Object is a predefined software process, and an Object Attribute is a data value used or
created by that process. An Object can have multiple Instances, or the same process operating
with different sets of Attributes or data values. For the purpose of this document, an Object
Instance is an independent program or process, and its Attributes are configuration parameters
and data values that are unique to that specific Object Instance.
The CDN36X gateway has eight different Object Classes, or types. Five are standard objects
defined by the DeviceNet Specification (Identity, Router, DeviceNet, Assembly, Connection).
Three are specific objects defines for the CDN36X gateway (Serial Stream, Serial Receive,
Serial Transmit). The Serial Stream Object configures the serial channel, and scans the incoming
serial stream for valid message packets. The Serial Receive Object processes the received
message packet, converts it into input data, and returns it to the DeviceNet master. The Serial
Transmit Object receives output data from the DeviceNet master, converts it into a message
packet, and transmits it out the serial channel. You can configure up to 8 Instances each for the
Serial Receive Object and Serial Transmit Object. Chapter 5 contains detailed information on
each DeviceNet object class.
DeviceNet Interface
The CDN36X gateway operates as a DeviceNet slave. It supports Explicit Messages, Polled I/O
Messages, and Change-of-State (COS) I/O Messages of the predefined master/slave connection
set. The Explicit Unconnected Message Manager (UCMM) is not supported.
The I/O Messaging process consists of the DeviceNet master sending output data to the
CDN36X in the form of a Poll/COS Command Message, and the CDN36X returning input data
to the DeviceNet master in a Poll/COS Response Message. The difference between Poll and
Change-of-State is Polled I/O Messaging is initiated by the DeviceNet master and responded to
by the slave device. Change-of-State I/O Messaging is initiated by changes to the master’s
output data values or the slave’s input data values, causing the master or slave to immediately
transmit its new output or input data when it changes. Please refer to DeviceNet Specification
for detailed information on Polled I/O and Change-of-State I/O Messaging.
The output and input data bytes are typically mapped into data files inside the DeviceNet master.
These data files are exchanged with the user application program, which acts upon the received
input data and writes new output data to the DeviceNet master.
MKS Instruments, Inc. D.I.P. Products Group 10

CDN36X User Manual revision 1.30
Input File
Inputs
DeviceNet I/O Response
input data
Receive
Message Packet
Outputs
Outpu
t File
DeviceNet I/O Command
output data
Transmit
Message Packet
DeviceNet
Master
CDN36X
Serial
Device
Gateway
Application
Program
DeviceNet network
The first 2 output data bytes received from the DeviceNet master contain synchronization bits for
the gateway transmit and receive operations. The remaining output data bytes contain serial
message data to be transmitted out the serial channel. Up to 8 different output data values can be
sent in an I/O Command Message, one for each enabled Serial Transmit Object Instance.
The first 2 input data bytes sent from the gateway contain synchronization bits for the gateway
transmit and receive operations. The remaining input data bytes contain serial message data that
has been received and processed by the gateway. Up to 8 different input data values can be
returned in an I/O Response Message, one for each enabled Serial Receive Object Instance.
The following diagram shows how the gateway’s input and output data bytes map into the
DeviceNet I/O Response and I/O Command Messages. The diagram includes all 8 Serial
Receive Object Instances and 8 Serial Transmit Object Instances. If an instance is not enabled, its
data bytes are not mapped or present in the corresponding I/O Message. The total number of
input or output data bytes required for each Instance is defined by its configuration.
The gateway supports a maximum of 128 data bytes for all 8 Serial Receive Object Instances and
128 bytes for all 8 Serial Transmit Object Instances, regardless of whether an instance is enabled
or not. Unused instances should have their data size set to the smallest number of bytes.
MKS Instruments, Inc. D.I.P. Products Group 11

CDN36X User Manual revision 1.30
DeviceNet Master Mapping of DeviceNet I/O Command and I/O Response Data
DeviceNet Master Outputs DeviceNet I/O Command Message Data
output bytes TX Toggle
Byte RX Ack
Byte STO Inst 1
TX Data STO Inst 2
TX Data STO Inst 3
TX Data STO Inst 4
TX Data STO Inst 5
TX Data STO Inst 6
TX Data STO Inst 7
TX Data STO Inst 8
TX Data
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output byte
output bytes TX Toggle Byte: bits 0-7 contains Transmit Toggle bits from Serial Transmit Object Instances 1-8 respectively.
RX Ack Byte: bits 0-7 contain Receive Acknowledge bits from SerialReceive Object Instances 1-8 respectively.
STO Inst = Serial Transmit Object Instance
TX Data = SerialTransmit Object Transmit Data attribute
DeviceNet Master Inputs DeviceNet I/O Response Message Data
input bytes TX Ack
Byte RX Toggle
Byte SRO Inst 1
RX Data SRO Inst 2
RX Data SRO Inst 3
RX Data SRO Inst 4
RX Data SRO Inst 5
RX Data SRO Inst 6
RX Data SRO Inst 7
RX Data SRO Inst 8
RX Data
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input byte
input bytes TX AckByte: bits 0-7 contain Transmit Acknowledge bits from SerialTransmit Object Instances 1-8 respectively.
RX Toggle Byte: bits 0-7 contains Receive Toggle bits from Serial Receive Object Instances 1-8 respectively.
SRO Inst = SerialReceive Object Instance
RX Data = Serial Receive Object Receive Data attribute
MKS Instruments, Inc. D.I.P. Products Group 12

CDN36X User Manual revision 1.30
Serial Channel Interface
The CDN36X serial channel consists of an asynchronous serial transmitter and receiver. The
serial interface is configured and controlled by the Serial Stream Object, Serial Receive Object,
and Serial Transmit Object.
Serial Stream Object
The Serial Stream Object attributes configure the serial channel’s baud rate, number of data bits
and stop bits, parity, and flow control. This configuration applies to both the serial transmitter
and receiver. The gateway has separate 128-byte serial transmit and receive FIFO buffers,
allowing full duplex operation when supported by the physical layer media.
The Serial Stream Object also scans incoming serial data for valid message packets. A message
packet is determined by one of three Delimiter modes. List mode searches for Pre-Delimiter and
Post-Delimiter byte strings at the beginning and end of a message. Length mode captures a
specific number of message bytes, defined by Packet Length. Timeout mode uses an inter-byte
delay (Packet Timeout) to signal the end of a message. When a message packet is received, it is
processed by all enabled Serial Receive Object Instances. The following examples show the
three Serial Stream Object Delimiter modes.
0x45 0x62 0x02 0x31 0x32 0x32 0x42 0x45 0x03 0x0D 0x11 <delay> 0x43 0x56 …
Incoming data stream
0x02 0x31 0x32 0x32 0x42 0x45 0x03 0x0D
List Mode (delimiters)
Pre-Delimiter Message Packet Post-Delimiter
0x45 0x62 0x02 0x31 0x32 0x32 0x42 0x45
Length Mode (fixed #bytes)
Message Packet
Packet Length = 8
0x45 0x62 0x02 0x31 0x32 0x32 0x42 0x45 0x03 0x0D 0x11
Timeout Mode (inter-byte delay)
Packet Timeout = 100 msec
Message Packet
MKS Instruments, Inc. D.I.P. Products Group 13

CDN36X User Manual revision 1.30
Serial Receive Object
The Serial Receive Object processes the Message Packet bytes, converting them into an input
data value that is returned to the DeviceNet master in an I/O Response Message. The Message
Packet bytes can be converted into a Short_String data type (byte array, with 1st byte = length).
ASCII characters within the Message Packet representing a numerical value can also be
converted into signed or unsigned integer or real number data types. The Serial Receive Object
can be configured to search for Pre-String and/or Post-String byte strings at the beginning and/or
end of the desired data bytes. The data bytes framed by the Pre-String and Post-String bytes are
then converted into a Short_String, integer, or real number. The following examples show how
the Serial Receive Object can be configured to process a Message Packet.
Pre-String Data Post-String
Received Message Packet
other bytesother bytes
‘VALUE = 100 F’
Message Packet Bytes (ASCII)
1) Short_String
data size = 14
Use Data Field
2) Short_String
data size = 5
Use Data Field
3) Short_String
data size = 4
Use Pre-String
Use Data Field
Use-Post-String
4) Integer (USINT)
data size = 1
Use Pre-String
Use Data Field
Use-Post-String
13
,
‘VALUE = 100 F’ 4
,
‘VALU’ 8
,
‘VALUE = ‘ 3
,
‘100’ 2
,
‘ F’ 8
,
‘VALUE = ‘ 0x64 2
,
‘ F’
You can configure up to 8 Serial Receive Object Instances, allowing you to process a received
message packet against 8 different filters. Each enabled Instance parses through the message
packet, consuming bytes based on its configuration. When an Instance is finished, the remaining
message packet bytes are passed to the next enabled Instance. The Serial Receive Object
sequentially processes a message packet in order of Instance number, starting with Instance 1.
The processing continues until either all message packet bytes have been consumed or all the
enabled Instances are done. If an Instance cannot find a string of message bytes that matches its
configuration, no message packet bytes are consumed and are passed to the next Instance. The
following examples show how the Serial Receive Object Instances process a received message
packet.
Received Message Packet
unused b
y
tes unused b
y
tes unused b
y
tesDataDataPre-Strin
g
Post-Strin
g
DataPost-Strin
g
DataPre-Strin
g
Instance 1 bytes Instance 2 bytes Instance 3 bytes Instance 4 bytes
MKS Instruments, Inc. D.I.P. Products Group 14

CDN36X User Manual revision 1.30
Example 1
Serial Receive Object instances 1, 4, 5, 7 are configured to use portions of a received message packet.
1) Serial Stream Object configured to capture a 15
byte message packet (Length Mode, Packet Length
= 15).
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x41 0x42 0x43 0x44 0x45
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x41 0x42 0x43 0x44 0x45
2) Serial Receive Object Instance 1 configured to
convert 4 bytes into Short_String, Data Size = 5.
Short_String = [0x05 0x30 0x31 0x32 0x33]. Data
3) Serial Receive Object Instances 2 & 3 not enabled.
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x41 0x42 0x43 0x44 0x45
4) Serial Receive Object Instance 4 configured to
convert 2 bytes into 8-bit unsigned integer. [0x34
0x35] are ASCII chars ‘45’. Converted data = [
0x2D ].
Data
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x41 0x42 0x43 0x44 0x45
5) Serial Receive Object Instance 5 configured to
locate 2 bytes bracketed by Pre-String ‘7’ (0x01
0x37) and Post-String ‘AB’ (0x02 0x41 0x42), and
convert them to 8-bit unsigned integer. [0x38
0x39] are ASCII chars ‘89’. Converted data =
[0x59]. Note 0x36 byte not used, but still
consumed by Instance 5.
DataPre-String Post-String
6) Serial Receive Object Instance 6 not enabled.
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x41 0x42 0x43 0x44 0x45
7) Serial Receive Object Instance 7 configured to
convert 2 bytes into Short_String, Data Size = 3.
Short_String = [0x02 0x43 0x44]. Data
8) Remaining message packet bytes are not used.
MKS Instruments, Inc. D.I.P. Products Group 15

CDN36X User Manual revision 1.30
Example 2
Serial Receive Object Instances 1 & 2 are configured to process two different ASCII message strings. Each instance
uses unique Pre-String and Post-String values to identify its message string in the message packet. Instance 1
message string = ‘VALUE = xxx U’. Instance 2 message string = ‘VAR B IS xxx’.
Serial Stream Object configured to capture a message packet delimited by STX (0x02) and ETX (0x03) characters.
Delimiter Mode = List Mode, Pre-Delimiter = 0x02, Post-Delimiter = 0x03. Delimiter characters are not saved in
the message packet.
Serial Receive Object Instance 1 configured to convert 3 ASCII bytes bracketed by Pre-String ‘VALUE = ‘ and
Post-String ‘ U’ into an 8-bit unsigned integer. Receive Mode = Use Pre-String, Use Data, Use Post-String fields.
Pre-String = [ 0x08, ‘VALUE = ‘ ], Post-String = [ 0x02, ‘ U’ ], Data Type = USINT, Conversion = Decimal.
Serial Receive Object Instance 2 configured to convert 3 ASCII bytes bracketed by Pre-String ‘VAR B IS ‘ into an
8-bit unsigned integer. Receive Mode = Use Pre-String, Use Data fields. Pre-String = [ 0x09 ‘VAR B IS ‘ ], Data
Type = USINT, Conversion = Decimal.
Message Packet 1 = [ 0x02, ‘VALUE = xxx UNITS’, 0x03 ]
Message Packet 2 = [ 0x02, ‘VAR B IS xxx’, 0x03 ]
Message Packet 3 = [ 0x02, ‘VALUE = xxx UNITS’, ‘VAR B IS xxx’, 0x03 ]
Message Packet 4 = [ 0x02, ‘VAR B IS xxx’, ‘VALUE = xxx UNITS’, 0x03 ]
‘
V
AL
U
E = 1
00
UN
IT
S
’
1) Serial Stream Object receives Message Packet 1.
Serial Receive Object Instance 1 finds matching Pre-String and Post-
String values, converts ‘100’ data field into [0x64]. ‘
V
AL
U
E = 1
00
U
N
IT
S
’
‘
V
AL
U
E = 1
00
U
N
IT
S
’
Serial Receive Object Instance 2 does not find matching Pre-String field, so it
skips this message packet.
2) Serial Stream Object receives Message Packet 2. ‘
V
AR B I
S
1
0
4’
Serial Receive Object Instance 1 does not find matching Pre-String and Post-
String values, so it skips this message packet. ‘
V
AR B I
S
1
0
4’
Serial Receive Object Instance 2 finds matching Pre-String value, converts
‘104’ data field into [0x68]. ‘
V
AR B I
S
1
0
4’
3) Serial Stream Object receives Message Packet 3. ‘
V
AL
U
E = 122
UN
IT
SV
AR B I
S
080
’
Serial Receive Object Instance 1 finds matching Pre-String and Post-String
values, converts ‘122’ data field into [0x7A]. ‘
V
AL
U
E = 122
U
N
IT
SV
AR B I
S
080
’
Serial Receive Object Instance 2 finds matching Pre-String value, converts
‘080’ data field into [0x50]. Note that Instance 2 consumes the bytes ‘NITS’
while parsing for its Pre-String.
‘
V
AL
U
E = 122
U
N
IT
S
V
AR B I
S
080
’
‘
V
AR B I
S
080V
AL
U
E = 122
UN
IT
S
’
4) Serial Stream Object receives Message Packet 4.
Serial Receive Object Instance 1 finds matching Pre-String and Post-String
values, converts ‘122’ data field into [0x7A]. ‘
V
AR B I
S
080
V
AL
U
E = 122
U
N
IT
S
’
‘
V
AR B I
S
080V
AL
U
E = 122
U
N
IT
S
’
Serial Receive Object Instance 2 does not find matching Pre-String value, so
skips this message packet. Note that Instance 1 consumes the Instance 2
message string bytes when parsing for its message string.
MKS Instruments, Inc. D.I.P. Products Group 16

CDN36X User Manual revision 1.30
Serial Transmit Object
The Serial Transmit Object receives an output data value from the DeviceNet master in the I/O
Command Message. The object converts the output data into a serial message packet to transmit
out the serial channel. The output data format can be a Short_String (byte array, with 1st byte =
length), a signed or unsigned integer, or a real number data type. An integer or real number can
be converted into ASCII characters that represent the numerical value before it is transmitted.
String1 and String2 character strings can be placed before and/or after the converted data in the
message packet, allowing you to build and transmit complex messages. The following examples
show how the Transmit Serial Object can be configured to convert a data value into a message
packet.
You can configure up to 8 Serial Transmit Object Instances, allowing you to transmit up to 8
different serial messages. You can also build complex messages by linking together each
instance’s message packet. The Serial Transmit Object sequentially processes the I/O Command
Message output data in order of instance number, starting with Instance 1. Each enabled
instance converts its output data bytes into a message packet that is loaded into the transmit
buffer. The following examples show how the Serial Transmit Object Instances create
messages.
Instance Message Packet
String1 DataString2 String1 String2
0x03 0x41 0x42 0x43
‘ABC’
1) Output Data Bytes
Short_String, data size = 4.
Use Data Field.
[ 0x41 0x42 0x43 ] = ‘ABC’
Transmitted Message Packet
0x08
‘8’
2) Output Data Byte
USINT integer, data size = 1,
width = 1, conversion = D.
Use Data Field.
[
0x08
]
Æ‘8’
(
0x38
)
Transmitted Message Packet
0xFF 0x47
‘VAL = -185 F’
3) Output Data Bytes
INT integer, data size = 2,
width = 4, conversion = D.
Use String1 Before [ 0x06, ‘VAL = ‘].
Use Data Field.
Use String2 After [0x02, ‘ F’].
[ 0xFF 0x47 ] = -185 Æ‘-185’
Transmitted Message Packet
Transmitted Message
Strin
g
1 Before Data Strin
g
2 Afte
r
Data Strin
g
2 Afte
r
Data Strin
g
1 Afte
r
Strin
g
2 Before
Instance 1
message packet Instance 2
message packet Instance 3
message packet Instance 4
message packet
MKS Instruments, Inc. D.I.P. Products Group 17

CDN36X User Manual revision 1.30
Example 1
Serial Transmit Object Instances 1 & 2 configured to transmit two different serial messages.
1)Serial Transmit Object Instance 1 configured to convert a Short_String data output value into message bytes.
DeviceNet output bytes = [ 0x04 0x30 0x31 0x32 0x33 ]
Transmitted message packet = [ ‘0123’ ]
2) Serial Transmit Object Instance 2 configured to convert an 8-bit unsigned integer (USINT) data output value into
3 ASCII characters. String1 ‘A EQUALS ‘ is placed before data, and String2 ‘ UNITS’ is placed after data.
DeviceNet output byte = [0x10]
Transmitted message packet = [ ‘A EQUALS 016 UNITS’ ]
Example 2
Serial Transmit Object Instances 1, 2, 3 are configured to transmit a complex serial message using 3 output data
values.
1)Serial Transmit Object Instance 1 Transmit Mode = Use String1 Before, Use
Data, Use String2 After. String1 = [ 0x02, ‘V ‘ ]. String2 = [ 0x01, ‘ =’ ].
Data Type = USINT, width = 1, conversion = D with no leading zeros.
Converts output data byte [ 0x08 ] into one ASCII char [ 0x38 ].
STX
,
‘V8 = ’
2)Serial Transmit Object Instance 2 Transmit Mode = Use Data. Data Type =
USINT, width = 3, conversion = D with leading zeros. Converts output data
byte [ 0x22 ] into three ASCII chars [ 0x30 0x33 0x34 ].
‘034’
3)Serial Transmit Object Instance 3 Transmit Mode = Use String1 Before, Use
Data, Use String2 After. String1 = [ 0x04, ‘ REF ‘ ]. String2 = [0x01, 0x03].
Data Type = USINT, width = 2, conversion = D with leading zeros. Converts
output data byte [ 0x13 ] into two ASCII chars [ 0x31 0x39 ].
‘ REF 19’
,
ETX
The three message packets are transmitted sequentially, so complete message is: STX
,
‘V8 = 034 REF 19’ ETX
Asynchronous Serial Communictaion
Devices communicating on an asynchronous serial link exchange information one bit at a time.
Each bit is transmitted for a specific period of time, defined by the baud rate. Devices use
internal timing circuitry to measure the baud rate. There is no clocking signal between devices
to synchronize the serial data flow, hence the term asynchronous serial communications.
Serial data bits are organized into bytes. When a data byte is asynchronously transmitted, it is
preceded by a start bit, followed by the data bits, an optional parity bit, and one or more stop bits.
There can be a variable transmission delay between successive serial data bytes, since each byte
is framed by its own start and stop bits. The receiver starts saving serial bits after is receives a
valid start bit (0), and stops when it receives the expected number of stop bits (1). The data
byte’s least-significant bit is transmitted first (data bit 0), and the most-signficant bit is
transmitted last (data bit N).
[ start bit ] [ data bit 0 ] [ data bit 1 ] … [ data bit N ] [ optional parity bit ] [ stop bit(s) ]
MKS Instruments, Inc. D.I.P. Products Group 18

CDN36X User Manual revision 1.30
The parity bit is used to detect single-bit errors in the transmission. The parity bit is
automatically calculated and inserted by the transmitter. The receiver calculates the parity of an
incoming byte, and compares it to the parity bit sent by the transmitter. If the two bit values do
not match, then at least one serial bit value was corrupted during transmission.
Flow control allows the receiving device to regulate the rate of incoming data. Hardware flow
control uses RTS/CTS signals between the devices to control the rate of transmission. Software
flow control uses serial characters XON/OFF to control the rate. Flow control helps protect
against lost data, if the receiving device cannot store incoming data fast enough, or if the
receiving device's buffer is full and cannot accept more data until it processes existing data.
Data Conversion
The CDN36X gateway can either pass through received serial message bytes to your application,
or pre-process an ASCII string into a numerical value. The gateway can transmit a string of
message bytes sent by the application, or it can convert a numerical value into an ASCII string to
be transmitted. Using the gateway’s data conversion feature offloads this cumbersome task from
your application program, especially if it is a PLC ladder-logic application. It also reduces the
required number of DeviceNet input and output bytes, since converted values instead of entire
message strings are transferred over DeviceNet.
The gateway conversion process supports the following data types:
Data Type Data Size Value Range
SINT signed 8-bit integer 1 -128 to 127
INT signed 16-bit integer 2 -32768 to 32767
USINT unsigned 8-bit integer 1 0 to 255
UINT unsigned 16-bit integer 2 0 to 65535
REAL 32-bit floating point 4 +1.175E-38 to +3.4028E+38
Short_String (byte array) 2 to 128 string of bytes, 1st byte defines length
The Serial Transmit Object and Serial Receive Object Instances’ attributes configure the
conversion process for transmitted and received messages. The Data Type attribute selects the
desired data type for an instance’s Receive Data or Transmit Data value. The Data Size attribute
represents the number of bytes used by the selected data type. You must select the maximum
data size expected for your application if using the Short_String data type. The Short_String
byte array format is a length byte followed by data bytes, so you must add one to the expected
number of bytes. The table above defines the data size for all other data types.
The CDN36X gateway supports a maximum of 128 bytes for the 8 Serial Transmit Object
Instances’ Transmit Data values and 128 for the 8 Serial Receive Object Instances’ Receive Data
values, regardless of whether an instance is enabled or not. Configure all unused instances to
USINT or SINT Data Type, because it has a 1 byte Data Size.
The Width attribute defines the number of ASCII bytes (1 to 16) used to represent a real or
integer number. For received messages, Width defines the number of ASCII bytes that will be
converted into a number. For transmitted messages, Width defines how many ASCII bytes will
be generated to represent the number. The Width value must include ASCII sign (+/-), exponent
(E), and decimal point (.) characters. Width is not used for Short_String data types.
MKS Instruments, Inc. D.I.P. Products Group 19

CDN36X User Manual revision 1.30
The Precision attribute is only used for transmitted messages. It defines the number of digits (1
to 6) after the decimal point for a floating-point number. The gateway will automatically add
trailing zeros to the converted number if needed. Precision is only used for the REAL data type.
The following examples show how to calculate the Data Size, Width, and Precision attributes for
the different Data Types. Remember to add a length byte to the Short_String Data Size.
Data Type ASCII chars Data Size Width Precision
SINT ‘-12’ 1 3 not used
INT ‘-12345’ 2 6 not used
USINT ‘123’ 1 3 not used
UINT ‘1234’ 2 4 not used
REAL ‘1.23E+4’ 4 7 2
REAL ‘-1.1234E-12’ 4 11 4
Short_String ‘ABCDEF’ 7 (length=6) not used not used
The Conversion attribute is different for Serial Receive Object and Serial Transmit Object. For
the Serial Receive Object, the Conversion attribute denotes if the ASCII bytes represent a
decimal integer or a hexadecimal integer. If decimal is selected, then the gateway converts the
ASCII bytes as a decimal number. If hexadecimal is selected, then the gateway converts the
ASCII bytes as a hex number.
‘1234’ ÆIf decimal, integer = 1234.
‘1234’ ÆIf hexadecimal (0x1234), integer = 4660.
For the Serial Transmit Object, the Conversion attribute also denotes if the ASCII bytes
represent a decimal or hexadecimal integer. If decimal is selected, then the gateway converts the
integer into a decimal ASCII representation. If hexadecimal is selected, then the gateway
converts the integer into a hex ASCII representation.
Integer = 1234 ÆIf decimal, ASCII representation = ‘1234’
Integer = 1234 ÆIf hexadecimal, ASCII representation = ‘04D2’
The Serial Transmit Object Conversion attribute can also be used to insert leading zeros into a
converted number. If the ASCII representation of a number contains fewer characters than the
selected Width, then leading zeros can added in front of the number.
Integer = 1234, Width = 7 ÆIf leading zeros enabled, ASCII representation = ‘0001234’
Integer = 1234, Width = 7 ÆIf leading zeros disabled, ASCII representation = ‘1234’
The following examples show a variety of different gateway data conversions for received and
transmitted data values.
MKS Instruments, Inc. D.I.P. Products Group 20
This manual suits for next models
1
Table of contents