News:

  • August 27, 2026, 07:16:39 PM

Login with username, password and session length

Author Topic: MRX Read Size  (Read 14305 times)

CReese

  • Hero Member
  • *****
  • Posts: 184
MRX Read Size
« 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

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: MRX Read Size
« Reply #1 on: March 24, 2014, 01:04:20 PM »
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 retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: MRX Read Size
« Reply #2 on: March 24, 2014, 01:11:43 PM »
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.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: MRX Read Size
« Reply #3 on: March 24, 2014, 01:13:06 PM »
So have you seen other masters and slaves that will do 128 registers in one transaction?
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: MRX Read Size
« Reply #4 on: March 24, 2014, 01:15:00 PM »
After reading some more, it does appear the maximum data frame length is 250 bytes after the frame metadata. Boo.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6174
  • Yes Pinky, Do-more will control the world!
Re: MRX Read Size
« Reply #5 on: March 24, 2014, 02:37:57 PM »
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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: MRX Read Size
« Reply #6 on: March 24, 2014, 04:33:10 PM »
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.

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: MRX Read Size
« Reply #7 on: March 24, 2014, 07:21:02 PM »
I'm getting 125 just fine. It was a misread of the protocol on my part for sure.

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: MRX Read Size
« Reply #8 on: March 24, 2014, 07:22:35 PM »
1 WORD REGISTER = 2 BYTES.  250 / 2 = 125

Yes. I stated this above. I understand data size.

Quote
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.