1.33k likes | 3.33k Views
Modbus Essential. Prepared by: Ray Chen Date: 11-09-2012. Training Essential. Serial Communication TCP/IP Networking. Modbus Essential. What Modbus is How Modbus Works One Request and One Response Modbus RTU/ASCII vs Modbus TCP What a Modbus Gateway is. What Modbus is.
E N D
Modbus Essential Prepared by: Ray Chen Date: 11-09-2012
Training Essential Serial Communication TCP/IP Networking Confidential
Modbus Essential • What Modbus is • How Modbus Works • One Request and One Response • Modbus RTU/ASCII vs Modbus TCP • What a Modbus Gateway is Confidential
What Modbus is Confidential
What Modbus is • Fieldbus, IEC 61158 • CAN (Controller Area Network) • PROFIBUS (Process Field Bus) • Modbus • … Confidential
Modbus History • Developed by Modicon in 1979 to exchange information between products on the factory floor. • Modbus Organization, Inc. • http://www.modbus.org Confidential
Where You can Find Modbus Confidential
How Modbus Works Confidential
Request Response Modbus Communication Confidential
Physical Media of Modbus Modbus RTU/ASCII devices Modbus TCP devices Confidential
Modbus Variations Confidential
Request Modbus RTU/ASCII Message Frame ASCII Message Frame Maximum size of ASCII Message Frame is 513 Bytes RTU Message Frame >= 3.5 char Maximum size of RTU Message Frame is 256 Bytes >= 3.5 char Confidential
Function Code Codes are listed in decimal Confidential
Modbus Data Model Confidential
Request Response Normal Request & Response Modbus RTU Request Modbus RTU Response Confidential
Request Response Abnormal Request & Response Modbus RTU Request Modbus RTU Response Confidential
Exception Code Confidential
Exception Code (cont.) Confidential
Request Modbus TCP Message Frame Modbus TCP Frame 7-byte MBAP header Confidential
Request Response Normal Request & Response Modbus TCP Request Modbus TCP Response Confidential
Request Response Abnormal Request & Response Modbus TCP Request Modbus TCP Response Confidential
Mixed Modbus Requirement • Modbus Gateway • Modbus TCP devices to work with Modbus RTU/ASCII devices Confidential
Modbus Gateway Solutions ① Master Slave ①RTU to RTU ② TCP to TCP ③ RTU to TCP ④ TCP to RTU ④ ③ ② Confidential
How a Modbus Gateway Works Modbus RTU Frame Modbus TCP Frame Confidential
You should Remember • One Request & One Response • Modbus Gateway communicates between • Modbus RTU/ASCII • Modbus TCP Confidential
Appendix Confidential
Modbus Plus (Modbus+ or MB+) 7 6 5 4 3 2 1 Application Modbus TCP Modbus Modbus+ Presentation Session Transport TCP Network IP 802.4 Token passing Master - Slave Link Ethernet (CSMA/CD 802.3) Physical RS232/422/485 Confidential Physical layer works with HDLC (High-level Data Link Control), which is different from standard RS-232, RS-422, and RS-485.
Modbus Message Frame – Example of Request and Normal Response Master Query, ASCII and RTU Framing Slave Response, ASCII and RTU Framing Confidential
Slave Address Field • Address • 0: Broadcast • 1 – 247: Slave address • 248 – 255: Reserved Confidential
Data Field • Data • Request • Start address • Length • Response • Length • Data • Address starts at 0x0000 Confidential
OSI vs Modbus Confidential
State Machine – Modbus Master Confidential
State Machine – Modbus Slave Confidential