
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