Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: CReese on March 24, 2014, 12:51:51 PM
-
Hello all,
The typical modbus read length for function code 3 should be 256 bytes. The MRX I would use in DoMore, however, limits the input to 125, and passing values by variable of >125 results in a failed read. Is there a reason I cannot read 128 words at a time? It's much more awkward to break up reads of data in 512 and 1024 words this way. I either read evenly in 64 word bunches (twice as many reads as I should need), or break it up into uneven quantities.
Thanks,
Colin
-
I was under the impression the entire PACKET had to be under 256 bytes. I've never seen a setup that would do 128 registers in a shot, unless they could and I just didn't realize it. I usually break up reads of large contiguous blocks in 100-register groups.
-
I CAN do that, but it makes it more difficult to set up loops that way. A 512 words would be split up into 100,100,100,100,100,12, or 64,64,64,64,64,64,64,64. Either is non-ideal. 16 reads to get 1024 words is a bit excessive.
-
So have you seen other masters and slaves that will do 128 registers in one transaction?
-
After reading some more, it does appear the maximum data frame length is 250 bytes after the frame metadata. Boo.
-
The limit is determined by the Modbus specification, which was almost certainly chosen to allow the entire packet (with overhead) to fit in 256 bytes.
-
After reading some more, it does appear the maximum data frame length is 250 bytes after the frame metadata. Boo.
1 WORD REGISTER = 2 BYTES. 250 / 2 = 125
There is a method to our madness ;D
fyi...
The maximum number of registers you can WRITE? 123
The maximum number COILs you can READ? 2008
The maximum number of COILs you can WRITE? 1976
(less overhead in a slave's read response data packet than in a master's write data packet)
These are not Do-more limitations, but Modbus protocol limitations.
-
I'm getting 125 just fine. It was a misread of the protocol on my part for sure.
-
1 WORD REGISTER = 2 BYTES. 250 / 2 = 125
Yes. I stated this above. I understand data size.
The maximum number of registers you can WRITE? 123
The maximum number COILs you can READ? 2008
The maximum number of COILs you can WRITE? 1976
125 registers works fine.