10.07.2015 Views

Practical Industrial Data Networks:Design, Installation and ...

Practical Industrial Data Networks:Design, Installation and ...

Practical Industrial Data Networks:Design, Installation and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Modbus overview 101The data field of the request frame consists of the relative address of the first holdingregister followed by the number of registers to be read. The data field of the responsetime consists of a count of the register data bytes followed by that many bytes of holdingregister data.The contents of each requested register (16 bits) are returned in two consecutive databytes (most significant byte first).In the following example, the host requests the contents of holding register hexadecimaloffset 0002 or decimal 40003. The controller’s response indicates that the numericalvalue of the register’s contents is hexadecimal 07FF or decimal 2047. The first byte of theresponse register data is the high order byte of the first addressed register.Request MessageAddress01FunctionCode03StartingRegisterHi Lo00 02RegisterCountHi Lo00 01CRC25 CAResponse FrameAddress01FunctionCode03ByteCount02Register<strong>Data</strong>Hi Lo07 FFCRCFA 34Figure 7.3Example of reading holding register7.3.4 Reading input registers (function code 04)This function allows the host to obtain the contents of one or more input registers in thetarget device.The data field of the request frame consists of the relative address of the first inputregister followed by the number of registers to be read. The data field of the responseframe consists of a count of the register data bytes followed by that many bytes of inputregister data.The contents of each requested register are returned in two consecutive register databytes (most significant byte first). The range for register variables is 0 to 4095.

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

Saved successfully!

Ooh no, something went wrong!