
BRONKHORST®
Page13RS232interface 9.17.027
3.3.4 Enhancedbinaryprotocol
Theenhancedprotocolisbinarycoded.Controlsequencesareusedtorecognisethebeginningandendofamessage
inabytestream.AcontrolsequencestartswithaDLEbyte(0x10)andisfollowedbyacontrolbyte.Thefollowing
controlsequencesaredefined:
Firstbyte Secondbyte Function
DLE(0x10) STX(0x02) Startofmessage
DLE(0x10) ETX(0x03) Endofmessage
DLE(0x10) DLE(0x10) Databyte0x10
DLE(0x10) anyother
character
Notallowed.Messagesthatcontainsuchasequencewillbe
ignored.ThereceiverwaitsuntilanewDLESTXsequence.
The[DLEDLE]sequenceisusedtopreventpossibleDLEbytesinthetransmittedbinarydatastreamfrombeing
recognisedasthestartofacontrolsequence.ThesenderreplacesanyDLEbytesinthedatabytwoDLEbytes.The
datalinkofthereceiverwillconverta[DLEDLE]sequencestooneDLEbyte.
IfaRS232error(receiveroverrun,framingerror,notallowedcontrolsequence)occurs,thedatalink
frameisignored.
TheenhancedbinarycodedmessagesbetweenPCandHOSTarestructuredasfollows:
DLE STX seq node len data DLE ETX
Byte Explanation
DLE,STX startsequence
seq messagesequencenumber
node nodeaddressofdestination(PCtoHOST)
nodeaddressofsource(HOSTtoPC)
len lengthofdatafieldinbytes
data messagefield
DLE,ETX endsequence
Theenhancedprotocolallows the transmissionofmore thanone requestat a time.Thesequence numbermakes it
possible to associate the answer to the according request. The HO ST has more than one message buffer where
messagesmaybestored(typical5).Whenthemessagebuffersarefull,theHOSTrespondswithanerrormessage.
TheresponsesfromtheHOSTtothePChavethesamemessageformatastherequest.Anerrormessagehasaspecial
format:
DLE STX seq node 0x00 error DLE ETX
Byte Explanation
DLE,STX startsequence
seq messagesequencenumber,asinrequest
node nodeaddressofsource,asinrequest
error errorcode
DLE,ETX endsequence
Theerrorcodecanhavethefollowingvalues:
Value Meaning
3 proparprotocolerror
4 proparprotocolerror(orCRCerror)
5 destinationnodeaddressrejected
9 responsemessagetimeout
Commentaires sur ces manuels