CDN36X User Manual
revision 1.30
Example 1 – Data Type = Short_String, Data Size = 9
Received ASCII data is ‘12345678’. The
Serial Receive Object
Instance coverts this to 9 bytes of
Receive Data
,
[0x08, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38] or [0x08, ‘12345678’]. The first byte defines the
Short_String
length as 8 bytes.
Example 2 – Data Type = Short_String, Data Size = 5
Received ASCII data is ‘12345678’. The
Serial Receive Object
Instance converts this to 4 bytes of
Receive Data
,
[0x04, 0x31, 0x32, 0x33, 0x34] or [0x04, ‘1234’]. The first byte defines the
Short_String
length as 4 bytes. With
Data Size
= 5, only the first 4 data bytes are used.
Example 3 – Data Type = Short_String, Data Size = 12
Received ASCII data is ‘ABCDEFGH’. The
Serial Receive Object
Instance converts this to 9 bytes of
Receive
Data
, [0x08, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48] or [0x08, ‘ABCDEFGH’]. The first byte defines the
Short_String
length as 8 bytes. Even though
Data Size
= 12, only the 8 received bytes are returned.
Example 4 – Data Type = SINT, Width = 5, Conversion = Hex
Received ASCII data is ‘18’. The
Serial Receive Object
Instance converts this to 1 byte of
Receive Data
, [0x18].
Example 5 – Data Type = INT, Width = 4, Conversion = Decimal
Received ASCII data is ‘-25’. The
Serial Receive Object
Instance converts this to 2 bytes of
Receive Data
, [0xFF
0xE7]. The ASCII ‘-25’ decimal number converts to 0xFFE7.
Example 6 – Data Type = REAL, Width = 13
Received ASCII data is ‘-1.2345E-16’. The
Serial Receive Object
Instance converts this to 4 bytes of
Receive Data
,
[0xNN, 0xNN, 0xNN, 0xNN]. This is the 32-bit floating-point representation for ‘–1.2345E-16’.
Example 7 – Data Type = REAL, Width = 7
Received ASCII data is ‘-1.2345E-16’. The
Serial Receive Object
Instance converts this to 4 bytes of
Receive Data
,
[0xNN, 0xNN, 0xNN, 0xNN]. This is the 32-bit floating-point representation for ‘-1.2345’. With
Width
= 7, only
the first 7 ASCII bytes are converted.
Example 8 – Data Type = Short_String, Data Size = 8
Transmit Data
is [0x08, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38]. The
Serial Transmit Object
Instance
converts this into 8 ASCII bytes ‘12345678’. Note the first
Transmit Data
byte defines the
Short_String
length in
bytes. This length byte is not transmitted.
Example 9 – Data Type = SINT, Width = 5, Conversion = Hex, Leading Zeros
Transmit Data
is [0x18]. The
Serial Transmit Object
Instance converts this into 5 ASCII bytes ‘00018’. Leading
zeros are added to match the
Width
= 5.
Example 10 – Data Type = INT, Width = 6, Conversion = Decimal, No Leading Zeros
Transmit Data
is [0xFF 0xE7]. The
Serial Transmit Object
Instance converts this into the ASCII string
‘-25’. The
Width
is 3 bytes greater than ‘-25’, but leading zeros are not selected.
Example 11 – Data Type = REAL, Width = 13, Precision = 6, Conversion = No Leading Zeros
Transmit Data
is [0xNN 0xNN 0xNN 0xNN], representing the real number –1.2345E-16.
The Serial Transmit
Object
Instance converts this into the ASCII string ‘-1.234500E-16’. The
Precision
is 2 bytes greater than needed,
so trailing zeros are added after the decimal point.
MKS Instruments, Inc.
D.I.P. Products Group
21