Bronkhorst RS232 interface User Manual
Page 13
BRONKHORST
®
Page 13
RS232 interface
9.17.027
3.3.4 Enhanced binary protocol
The enhanced protocol is binary coded. Control sequences are used to recognise the beginning and end of a message
in a byte stream. A control sequence starts with a DLE byte (0x10) and is followed by a control byte. The following
control sequences are defined:
First byte
Second byte Function
DLE (0x10)
STX (0x02)
Start of message
DLE (0x10)
ETX (0x03)
End of message
DLE (0x10)
DLE (0x10)
Data byte 0x10
DLE (0x10)
any other
character
Not allowed. Messages that contain such a sequence will be
ignored. The receiver waits until a new DLE STX sequence.
The [DLE DLE] sequence is used to prevent possible DLE bytes in the transmitted binary data stream from being
recognised as the start of a control sequence. The sender replaces any DLE bytes in the data by two DLE bytes. The
data link of the receiver will convert a [DLE DLE] sequences to one DLE byte.
If a RS232 error (receiver overrun, framing error, not allowed control sequence) occurs, the data link
frame is ignored.
The enhanced binary coded messages between PC and HOST are structured as follows:
DLE
STX
seq
node
len
data
DLE
ETX
Byte
Explanation
DLE, STX
start sequence
seq
message sequence number
node
node address of destination (PC to HOST)
node address of source (HOST to PC)
len
length of data field in bytes
data
message field
DLE, ETX
end sequence
The enhanced protocol allows the transmission of more than one request at a time. The sequence number makes it
possible to associate the answer to the according request. The HOST has more than one message buffer where
messages may be stored (typical 5). When the message buffers are full, the HOST responds with an error message.
The responses from the HOST to the PC have the same message format as the request. An error message has a special
format:
DLE
STX
seq
node
0x00
error
DLE
ETX
Byte
Explanation
DLE, STX
start sequence
seq
message sequence number, as in request
node
node address of source, as in request
error
error code
DLE, ETX
end sequence
The error code can have the following values:
Value
Meaning
3
propar protocol error
4
propar protocol error (or CRC error)
5
destination node address rejected
9
response message timeout