Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Modbus
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Modbus transaction and PDU === A Modbus transaction between client and server includes:{{Sfn|MODBUS Application Protocol|2012|p=4|ps=, "4.1 Protocol description"}}{{Sfn|MODBUS Application Protocol|2012|p=9|ps=, "Figure 9 MODBUS Transaction state diagram"}} * Step 1: Client initiates a request with PDU = Function code + data request * Step 2: Server receives the request from client. Server will then read/parse the function code, get the address of the data field of the PDU, then get this data field value and finally perform the action based on the function code. If there is no error during those steps, the server will respond with PDU = Function code + data response. As long as there is no error during those steps, the server's responding function code will also be the function code sent from the client. If there is any error during those steps, the server will respond with PDU = Exception Function code + Exception code (Reference to PDU mb_excep_rsp_pdu defined below). * Step 3: Client receives the response and ends the transaction. Based on that, Modbus defines 3 PDU types:{{Sfn|MODBUS Application Protocol|2012|p=5|ps=, "4.1 Protocol description"}} * MODBUS Request PDU, mb_req_pdu * MODBUS Response PDU, mb_rsp_pdu * MODBUS Exception Response PDU, mb_excep_rsp_pdu :mb_req_pdu = Function code (1 byte) + request data (n bytes) ::''request data'' field's size depends on the function code and usually includes values like variable values, data offset, and sub-function codes.{{Sfn|MODBUS Application Protocol|2012|p=5|ps=, "4.1 Protocol description"}} :mb_rsp_pdu = Function code (1 byte) + response data (n bytes) ::As in mb_req_pdu, ''response data'' field's size depends on the function code and usually includes values like variable values, data offset, and sub-function codes.{{Sfn|MODBUS Application Protocol|2012|p=5|ps=, "4.1 Protocol description"}} :mb_excep_rsp_pdu = Exception Function code (1 byte) + exception code (1 byte) ::''Exception Function code'' = Function code (1 byte) + 0x80. ''Exception Function code'' is equal to the Function code, except that its MSB is set to 1. ::Exception code (1 byte) of mb_excep_rsp_pdu is defined in the [[Modbus#Exception responses|MODBUS Exception Codes]] table.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)