Transcription of Modicon Modbus Protocol Reference Guide
1 1 ModiconModbus ProtocolReference GuidePI MBUS 300 Rev. JDOK-3 ModiconModbus ProtocolReference GuidePI MBUS 300 Rev. JJune 1996 Modicon , Inc., Industrial automation SystemsOne High StreetNorth Andover, Massachusetts 01845PI-MBUS 300 PrefaceiiiPrefaceThis Guide is written for the person who will use Modicon Modbus protocols andmessages for communication in Modicon programmable controller describes how messages are constructed, and how transactions take placeusing Modbus Guide should be used in conjunction with Modicon user guides for the typesof networks and programmable controllers present in the application.
2 Familiaritywith your network layout, and with your control application, is data and illustrations in this book are not binding. We reserve the right tomodify our products in line with our policy of continuous product in this document is subject to change without notice and should notbe construed as a commitment by Modicon , Inc., Industrial automation , Inc. assumes no responsibility for any errors that may appear in thisdocument. If you have any suggestions for improvements, or have found anyerrors in this publication, please notify part of this document may be reproduced in any form or by any means,electronic or mechanical, without the express written permission of Modicon , Inc.
3 ,Industrial automation Systems. All rights following are trademarks of Modicon , Inc.:Modbus984P190SM85 ModConnectBM85RR85SQ85 ModcomBP85SA85 DEC is a registered trademark of Digital Equipment Corporation. VAX and DECNET are trademarks of Digital Equipment is a registered trademark of International Business Machines Corporation. IBM AT , IBM XT , Micro Channel , and Personal System/2 are trademarksof International Business Machines and MS DOS are registered trademarks of Microsoft Digital is a registered trademark of Western Digital is a trademark of Xerox 1996, Modicon , in U.
4 S. 300 Related PublicationsivRelated PublicationsRefer to the following publication for details about the application of Modicon 984 Programmable Controller systems:GM 0984 SYS984 Programmable Controller Systems , to the following publications for details about the application and installationof the Modbus Plus network and related communications devices:GM MBPL 001 Modbus Plus Network Planning and Installation , BM85 001 Modbus Plus Bridge/Multiplexer User s , to the following publication for details about the Modcom III CommunicationsSoftware Library for host computer applications:GM MC3A 001 Modcom III Communications Software Library User s , MBUS 300 ContentsviiContentsChapter 1 Modbus Protocol1.
5 Introducing Modbus Protocol2.. Transactions on Modbus Networks4.. Transactions on Other Kinds of Networks4.. The Query Response Cycle5.. The Two Serial Transmission Modes6.. ASCII Mode6.. RTU Mode7.. Modbus Message Framing8.. ASCII Framing8.. RTU Framing9.. How the Address Field is Handled10.. How the Function Field is Handled10.. Contents of the Data Field11.. Contents of the Error Checking Field12.. How Characters are Transmitted Serially13.. Error Checking Methods14.. Parity Checking14.. LRC Checking15.. CRC Checking16.. PI MBUS 300 ContentsviiiChapter 2 Data and Control Functions17.
6 Modbus Function Formats18.. How Numerical Values are Expressed18.. Data Addresses in Modbus Messages18.. Field Contents in Modbus Messages18.. Field Contents on Modbus Plus20.. Function Codes Supported by Controllers22.. 01 Read Coil Status24.. 02 Read Input Status26.. 03 Read Holding Registers28.. 04 Read Input Registers30.. 05 Force Single Coil32.. 06 Preset Single Register34.. 07 Read Exception Status36.. 11 (0B Hex) Fetch Comm Event Ctr38.. 12 (0C Hex) Fetch Comm Event Log40.. 15 (0F Hex) Force Multiple Coils44.. 16 (10 Hex) Preset Multiple Regs46.
7 17 (11 Hex) Report Slave ID48.. 20 (14 Hex) Read General Reference58.. 21 (15 Hex) Write General Reference62.. 22 (16 Hex) Mask Write 4X Register66.. 23 (17 Hex) Read/Write 4X Registers68.. 24 (18 Hex) Read FIFO Queue70.. PI MBUS 300 ContentsixChapter 3 Diagnostic Subfunctions73.. Function 08 Diagnostics74.. Diagnostic Codes Supported by Controllers76.. Diagnostic Subfunctions77.. 00 Return Query Data77.. 01 Restart Communications Option77.. 02 Return Diagnostic Register78.. 03 Change ASCII Input Delimiter81.. 04 Force Listen Only Mode81.
8 10 (0A Hex) Clear Counters and Diagnostic Register81.. 11 (0B Hex) Return Bus Message Count82.. 12 (0C Hex) Return Bus Communication Error Count82.. 13 (0D Hex) Return Bus Exception Error Count82.. 14 (0E Hex) Return Slave Message Count83.. 15 (0F Hex) Return Slave No Response Count83.. 16 (10 Hex) Return Slave NAK Count83.. 17 (11 Hex) Return Slave Busy Count84.. 18 (12 Hex) Return Bus Character Overrun Count84.. 19 (13 Hex) Return IOP Overrun Count (884)84.. 20 (14 Hex) Clear Overrun Counter and Flag (884)85.. 21 (15 Hex) Get/Clear Modbus Plus Statistics86.
9 Modbus Plus Network Statistics87.. Appendix A Exception Responses93.. Exception Responses94.. Exception Codes96.. Appendix B Application Notes99.. Maximum Query/Response Parameters100.. Estimating Serial Transaction Timing106.. Notes for the 584 and 984A/B/X108.. Appendix C LRC/CRC Generation109.. LRC Generation110.. CRC Generation112.. PI MBUS 300 ContentsxFiguresFigure 1 Overview of Modbus Protocol Application3.. Figure 2 Master Slave Query Response Cycle5.. Figure 3 ASCII Message Frame8.. Figure 4 RTU Message Frame9.
10 Figure 5 Bit Order (ASCII)13.. Figure 6 Bit Order (RTU)13.. Figure 7 Master Query with ASCII/RTU Framing19.. Figure 8 Slave Response with ASCII/RTU Framing19.. Figure 9 Field Contents on Modbus Plus21.. Figure 10 Read Coil Status Query24.. Figure 11 Read Coil Status Response25.. Figure 12 Read Input Status Query26.. Figure 13 Read Input Status Response27.. Figure 14 Read Holding Registers Query28.. Figure 15 Read Holding Registers Response29.. Figure 16 Read Input Registers Query30.
