Knowledge Base / Protocols / Modbus

Why is the bit or coil level data incorrect?

Search KB

Categories

Bit read and write commands are issuing properly, and responses are coming from the slave(s), but the data is not correct.

When setting the intaddress field for a bit or coil Modbus command (Modbus function codes 1, 5, and 15), the internal address specified in the command must be at the bit level.

Example:
If the command is issuing a bit read (function code 1), and you wish to place the data in word 600 of the MCM module, the intaddress field should be set to 9600 (600 * 16 bits per word = intaddress of 9600).
This would place the data in word 600, bit 0 of the MCM module. An intaddress of 9601 would place the data in word 600, bit 1.

Second Example:
If the command is issuing a bit read, and you wish to place the data in word 812 of the MCM module, the intaddress field should be set to 12992 (812 * 16 bits per word = intaddress of 12992).
This would place the data in word 812, bit 0 of the mcm module. An intaddress of 12993 would place the data in word 812, bit 1.