10.07.2015 Views

Communicator Protocol Appendix Modbus

Communicator Protocol Appendix Modbus

Communicator Protocol Appendix Modbus

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AnyBus ® <strong>Communicator</strong> <strong>Protocol</strong> <strong>Appendix</strong><strong>Modbus</strong>DOC. ABC-APPENDIX-MB Rev.0.91HMS INDUSTRIAL NETWORKS ABPIELEFELTSGATAN 93 - 95S - 302 50 HALMSTADSWEDENPHONE: +46 35 17 29 00FAX: +46 35 17 29 09e-mail: info@hms-networks.comweb: www.hms-networks.com


AnyBus® <strong>Communicator</strong> <strong>Protocol</strong> <strong>Appendix</strong> - <strong>Modbus</strong>DOC. ABC-APPENDIX-MB Rev.0.912001-08-011 <strong>Appendix</strong> for <strong>Modbus</strong>1.1 IntroductionWhen configured for <strong>Modbus</strong> protocols, the AnyBus <strong>Communicator</strong> supports <strong>Modbus</strong> RTU, <strong>Modbus</strong> ASCII and<strong>Modbus</strong> Generic. Some basic knowledge is needed, as to understand how to use the Anybus-C for configuration ofthe <strong>Modbus</strong> network.The <strong>Modbus</strong> standard was created by Modicon for communication between controllers and other devices. The transactionson the <strong>Modbus</strong> network are of master/slave type, and are named “query” and “response”. One single mastersends the queries. All transactions on the network have got a frame structure where one part is common for both<strong>Modbus</strong> RTU and <strong>Modbus</strong> ASCII. This is illustrated in figure 1.Address Function Data Error checkFigure 1: <strong>Modbus</strong> frame layoutThe main difference between <strong>Modbus</strong> RTU and <strong>Modbus</strong> ASCII is that in RTU all hexadecimal values are representedwith one byte and in ASCII they are represented with two bytes. Another difference is the start and stop signs thatenvelope the frame.<strong>Modbus</strong> RTUEach byte in the <strong>Modbus</strong> RTU message represents a hexadecimal value between 0 and 255. The frame looks exactlylike the one mentioned earlier and there is always an interval of 3.5 silent characters between the frames. CRC (CyclicalRedundancy Check) is used for error checking. Multiple <strong>Modbus</strong> transactions would appear on the physical interfacelike this:silent transaction 1 silent transaction 2 silent transaction 3 silentFigure 2: <strong>Modbus</strong> RTU transactions<strong>Modbus</strong> ASCIIEach byte in the <strong>Modbus</strong> ASCII message represents one hexadecimal digit i.e. 0-9, A-F. This means that two bytesare used to represent each hexadecimal value (0x00-0xFF). For example, the value 0x2A is represented like this: 1stbyte: "2" (0x32), 2nd byte: "A" (0x41). Start and stop characters are added to the frame from Figure 1. A colon, ":", isused as start character and "CR""LF" are used as stop characters. Longitudinal Redundancy Check (LRC) is used forerror checking. A complete <strong>Modbus</strong> ASCII transaction would appear on the physical interface like this:Start Address Function Data Error check Stop“:” LRC “CR” “LF”Figure 3: <strong>Modbus</strong> ASCII transactions4 HMS INDUSTRIAL NETWORKS AB


AnyBus® <strong>Communicator</strong> <strong>Protocol</strong> <strong>Appendix</strong> - <strong>Modbus</strong>DOC. ABC-APPENDIX-MB Rev.0.912001-08-017 Read Exception StatusQuery - -Response DataData object with 1 byte. The slave returns the 8 Exception Status Coils inthis byte.Table 10: Read Exception Status11 Fetch Comm. Event CounterQuery - -Response DataData object with 4 bytes. The slave returns Status and Event Count inthese 4 bytes.Table 11: Fetch Comm. Event Counter12 Fetch Comm. Event LogQuery - -Response Byte Count 1 byte value where you enter the number of expected data bytes.DataData object with 6-70 bytes. The slave returns Status, Event Count, MessageCount and the Event Log in these bytes.Table 12: Fetch Comm. Event Log15 Force Multiple CoilsQuery Coil Address 2-byte value where you enter the reference of the first coil to be forced.Quantity of Coils 2-byte value where you enter the number of coils to force.Byte Count 1-byte value where you enter the number of data bytes.DataData object where you enter the length of the data to send and the sourceaddress. The fieldbus master should enter the force data in these bytes.Response DataData object with 4 bytes. The slave returns Coil Address and Quantity ofCoils forced in these bytes.Table 13: Force Multiple Coils16 Preset Multiple RegistersQuery Starting Address 2 byte value where you enter the address of the first register to be preset.No. of Registers 2 byte value where you enter the number of registers to preset.Byte Count 1 byte value where you enter the number of data bytes.DataData object where you enter the length of the data to send and the sourceaddress. The fieldbus master should enter the preset data in these bytes.Response DataData object with 4 bytes. The slave returns Starting Address and No. ofRegisters preset in these bytes.Table 14: Preset Multiple Registers8 HMS INDUSTRIAL NETWORKS AB


AnyBus® <strong>Communicator</strong> <strong>Protocol</strong> <strong>Appendix</strong> - <strong>Modbus</strong>DOC. ABC-APPENDIX-MB Rev.0.912001-08-0117 Report Slave IDQuery - -Response Byte Count 1 byte value where you enter the number of expected data bytes.DataData object where you enter the length of the recieved data and the destinationaddress. The slave returns slave ID, Run Indicator Status andAdditional Data in these bytes.Table 15: Report Slave ID20 Read General ReferenceQuery - -Response - -Table 16: Read General reference21 Write General referenceQuery - -Response - -Table 17: Write General Reference22 Mask Write 4X RegistersQuery Data Data object where you enter the length of the data to send and the sourceaddress. The fieldbus master should enter the Reference Address, ANDmask and OR mask in these bytes.Response DataData object where you enter the number of expected data bytes and thedestination address. The slave returns Reference Address, AND maskand OR mask in these bytes.Table 18: Mask Write 4X Registers23 Read/Write 4X RegistersQuery - -Response - -Table 19: Read/Write 4X Registers24 read FIFO QueueQuery - -Response - -Table 20: Read FIFO QueueHMS INDUSTRIAL NETWORKS AB 9


AnyBus® <strong>Communicator</strong> <strong>Protocol</strong> <strong>Appendix</strong> - <strong>Modbus</strong>DOC. ABC-APPENDIX-MB Rev.0.912001-08-01This page is intentionally left blank.10 HMS INDUSTRIAL NETWORKS AB


If you have any comments about this documentation, please take a few minutes to fill out this form, and letus know about your opinions. These comments will help us improve our work, and make us aware of whatcustomers of our products may find good, faulty or even missing.Document title and revision:_________________________________________________________________Your name and company:____________________________________________________________________Phone:___________________________________________________________________________________E-mail:___________________________________________________________________________________Comments:_________________________________________________________________________________________Text and illustrations:___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________What _________________________________________________________________________________________information is missing or unclear?:____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________Other comments:___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________Send your comments to:HMS Industrial Networks ABSupport DepartmentPilefeltsgatan 93-95302 50 HalmstadSWEDENYou may also mail or fax your comments:E-mail: support@hms-networks.comFax: +46 (0)35 172909

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!