
10 80403B_MSW_GFX4-ETHERNET_01-2021_ENG
AdedicatedheaderisusedonTCP/IPtoidentifytheMODBUSApplicationDataUnit.ItiscalledtheMBAPheader
(MODBUSApplicationProtocolheader).
ThisheaderprovidessomedifferencescomparedtotheMODBUSRTUapplicationdataunitusedonserialline:the
MODBUS‘slaveaddress’fieldusuallyusedonMODBUSSerialLineisreplacedbyasinglebyte‘UnitIdentifier’within
theMBAPHeader.
The‘UnitIdentifier’isusedtocommunicateviadevicessuchasbridges,routersandgatewaysthatuseasingleIP
addresstosupportmultipleindependentMODBUSendunits.
AllMODBUSrequestsandresponsesaredesignedinsuchawaythattherecipientcanverifythatamessageisfini-
shed.
ForfunctioncodeswheretheMODBUSPDUhasafixedlength,thefunctioncodealoneissufficient.
Forfunctioncodescarryingavariableamountofdataintherequestorresponse,thedatafieldincludesabytecount.
WhenMODBUSiscarriedoverTCP,additionallengthinformationiscarriedintheMBAPheadertoallowtherecipient
torecognizemessageboundariesevenifthemessagehasbeensplitintomultiplepacketsfortransmission.
Theexistenceofexplicitandimplicitlengthrules,anduseofaCRC-32errorcheckcode(onEthernet)resultsinan
infinitesimalchanceofundetectedcorruptiontoarequestorresponsemessage.
TheMBAPHeadercontainsthefollowingfields:
Theheaderis7byteslong:
1. Transaction Identifier-ItisusedfortransactionpairingtheMODBUSservercopiesintheresponsethe
transactionidentifieroftherequest.
2. Protocol Identifier-Itisusedforintra-systemmultiplexing.TheMODBUSprotocolisidentifiedbythevalue0.
3. Length-Thelengthfieldisabytecountofthefollowingfields,includingtheUnitIdentifieranddatafields.
4. Unit Identifier (Rotary switch value see Geflex Software Manual)-Thisfieldisusedforintra-systemrouting
purpose.ItistypicallyusedtocommunicatetoaMODBUSseriallineslavethroughagatewaybetweenan
EthernetTCP-IPnetworkandaMODBUSserialline.ThisfieldissetbytheMODBUSClientintherequestand
mustbereturnedwiththesamevalueintheresponsebytheserver.
Fields Length Description Client Server
Transaction 2Bytes Identificationofa Initializedbytheclient Recopiedbytheserver
Identifier MODBUSRequest/ fromthereceivedrequest
Responsetransaction
Protocol 2Bytes 0=MODBUS protocol Initializedbytheclient Recopiedbytheserver
Identifier fromthereceivedrequest
Length 2Bytes Numberoffollowingbytes Initializedbytheclient Initializedbytheserver
(request) (Response)
Unit Identifier 1Byte Identificationofaremote Initializedbytheclient Recopiedbytheserver
slaveconnectedonaserial fromthereceivedrequest
lineoronotherbuses