Today is...
Tuesday, September 17, 2019
Welcome to Control.com, the global online
community of automation professionals.
Featured Video...
Featured Video
A demonstration of EtherCAT control of linear motors using the CTC EtherCAT master.
Our Advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive
Modbus RTU Send Message
Trying to work out what response i should get from a Modbus RTU by sending a hex message

I'm hoping someone can help me with this problem I'm having with trying to work out what sort of response I should be getting from this message being transmitted:


0F 03 00 00 00 10 3F 4A

I was thinking something along the lines of

0F 03 20 ?? ?? 0A 8C

The question marks I can't seem to work out, but hopefully the rest is ok .

thanks in advance

Jack ... adamsj_80@hotmail.com

In your query:
* the first byte is the slave node ID, 0f hex or 15 decimal

* the 2nd byte is the function code 03, read holding registers

* the 3rd and fourth bytes are starting address 0000

* the fifth and sixth bytes are the quantity of registers 0010 hex or 16 decimal

* the 7th and 8th are CRC; I did not confirm the accuracy of the CRC bytes

In your reply:

* the first byte is the slave node ID, 0F hex or 15 decimal

* the 2nd byte is the function code 03, read holding registers

* the 3rd byte is the Byte count, 20 hex, which should be double the number of registers.
20 hex is double the number of registers, 10 hex

* You have two sets of double question marks. You should have 32 sets of double question marks for the 32 bytes of data from the 16 registers you requested data from.

You don't know what those ?? data values are - that's why you're using Modbus is to find out what they are. That CRC will depend on the what all the data and header bits are.

I made a mistake above because I learned to start counting with the number 1, not with the number 0.

Registers 0000 through 0010hex (16 decimal) total 17 (decimal) because register 0000 counts, too.

So the reply should have 34 sets of double question marks for 34 bytes of data from the 17 registers identified in the query.