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 ]
‘VALUE = 100 UNITS’
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].
‘VALUE = 100 UNITS’
‘VALUE = 100 UNITS’
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.
‘VAR B IS 104’
Serial Receive Object
Instance 1 does not find matching Pre-String and Post-
String values, so it skips this message packet.
‘VAR B IS 104’
Serial Receive Object
Instance 2 finds matching Pre-String value, converts
‘104’ data field into [0x68].
‘VAR B IS 104’
3)
Serial Stream Object
receives Message Packet 3.
‘VALUE = 122 UNITSVAR B IS 080’
Serial Receive Object
Instance 1 finds matching Pre-String and Post-String
values, converts ‘122’ data field into [0x7A].
‘VALUE = 122 UNITSVAR B IS 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.
‘VALUE = 122 UNITSVAR B IS 080’
‘VAR B IS 080VALUE = 122 UNITS’
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].
‘VAR B IS 080VALUE = 122 UNITS’
‘VAR B IS 080VALUE = 122 UNITS’
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