kurt.brinker
Member
I am trying to figure out some communication specifics for a Modbus RTU network that I will be integrating with and could use some help to make sure I am on the right track.
The networks are 2-wire RS485, 19200bps, 8N1.
Each network will accommodate up to 16 slave devices. (Identical units)
I will be using function code 3 to poll for a block of 11 registers from each unit.
I am trying to determine what my actual update rate will be after all nodes are scanned.
In this thread the mighty Ken Roach wrote a reply which is nearly identical to my current request.
Just so i understand, is the 8 byte address based on the following message frame?
Slave Address|Function Code|First Address and Register Count|CRC
1+1+2+2+2
The reply is based on
Slave Address|Function Code|Byte Count|10x2(n*byte count)|CRC
1+1+1+20+2
Assuming that is the case...
A Modbus RTU read of 11 registers using Function Code 0x03 will have an 8-byte Poll and a 27 byte Reply.
At 19200 bits per second, 35 bytes = 350 bits/19200 = 18.2 milliseconds.
I am thinking i also need to include the required 3.5 character inter-frame delay which would bring me up to around 21.7ms
Now, I know that is just the wire time and does not reflect the time it take the slave to reply or other factors I am not considering, however, given that scanning 16 devices per second gives me 62.5ms per device. Is it reasonable to expect that I could receive a full network update each second?
The networks are 2-wire RS485, 19200bps, 8N1.
Each network will accommodate up to 16 slave devices. (Identical units)
I will be using function code 3 to poll for a block of 11 registers from each unit.
I am trying to determine what my actual update rate will be after all nodes are scanned.
In this thread the mighty Ken Roach wrote a reply which is nearly identical to my current request.
The two most time-consuming steps are usually the time it takes for the Slave devices to answer, and the inter-request delay by the Master device.
The actual wire time of the data is straightforward to determine. With ordinary 8/N/1 framing, each byte is encoded in 10 bits.
A Modbus RTU read of 10 registers using Function Code 0x03 will have an 8-byte Poll and a 25 byte Reply.
At 19200 bits per second, 32 bytes = 320 bits/19200 = 16.7 milliseconds.
So the wiretime is not the biggest factor.
If you do any serial analysis work, even with an easy-to-interpret protocol like Modbus RTU, I strongly recommend you get your hands on a Stratus Engineering serial tap. There's nothing quite as powerful as getting the data right off the wire, so you don't have to predict, infer, or guess what each device is doing.
Just so i understand, is the 8 byte address based on the following message frame?
Slave Address|Function Code|First Address and Register Count|CRC
1+1+2+2+2
The reply is based on
Slave Address|Function Code|Byte Count|10x2(n*byte count)|CRC
1+1+1+20+2
Assuming that is the case...
A Modbus RTU read of 11 registers using Function Code 0x03 will have an 8-byte Poll and a 27 byte Reply.
At 19200 bits per second, 35 bytes = 350 bits/19200 = 18.2 milliseconds.
I am thinking i also need to include the required 3.5 character inter-frame delay which would bring me up to around 21.7ms
Now, I know that is just the wire time and does not reflect the time it take the slave to reply or other factors I am not considering, however, given that scanning 16 devices per second gives me 62.5ms per device. Is it reasonable to expect that I could receive a full network update each second?