adccommunitymod (AutomationDirect) asked a question.

Modbus - Many small polls or one large poll?

Created Date: July 18,2017

Created By: tftSam

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

For my application, I am talking to 11 Modbus devices. I need to read four registers from each device, but these registers are all fairly far apart. Is it better to do poll the devices once and read around 60 registers for the 4 I need or to do 4 polls and read only the values I need? Is there any kind of rule of thumb for how many registers to read at a time?


  • adccommunitymod (AutomationDirect)

    Created Date: July 18,2017

    Created by: tftSam

    For my application, I am talking to 11 Modbus devices. I need to read four registers from each device, but these registers are all fairly far apart. Is it better to do poll the devices once and read around 60 registers for the 4 I need or to do 4 polls and read only the values I need? Is there any kind of rule of thumb for how many registers to read at a time?

  • adccommunitymod (AutomationDirect)

    Created Date: July 18,2017

    Created by: kewakl

    For my application, I am talking to 11 Modbus devices.

    Product (controller and the mythical Modbus devices) info would be helpful as someone here may have experience with it (them.)

    I need to read four registers from each device, but these registers are all fairly far apart.

    Does the device support a block transfer? If so, you could map those registers to the block transfer area.

    Is it better to do poll the devices once and read around 60 registers for the 4 I need or to do 4 polls and read only the values I need?

    Can your polling device handle (size and parsing ability) of all 60 registers?

    Will bandwidth be a problem?

    How difficult will the programming/comms interlocking be for multiple reads?

    Personally, I would not bulk-read 60 registers just to retrieve 4.

    Is there any kind of rule of thumb for how many registers to read at a time?

    Depends on your network/bandwidth/loading. RS-485/422, Ethernet?

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 18,2017

    Created by: MikeN

    Is there a way for you to block address them all together in your modbus devices? If you are using Automation Direct VFDs and such you can set various parameters into a sequential block that you use for a single transfer of just the 4 sequential addresses. But whether you can do this or not depends on what hardware you are using.

  • adccommunitymod (AutomationDirect)

    Created Date: July 20,2017

    Created by: OkiePC

    In my estimation it is likely to be more efficient to read a single block of 60 elements than to read a single element 4 times. I 've done some experimentation with Rockwell PLCs on Ethernet years ago to determine how much speed I could gain by reducing the number of messages and reading larger chunk including data I didn't need. However, I am not 100% sure in your example with that number of tags where the break even point will be if choosing between extra messages or larger chunks.

    You could set up a test and actually measure this by starting a timer and start polling and count completeed polling cycles. Stop after say 100 poll cycles (or10?) and capture the timer accumulator. Repeat for the other method of polling.

    But if it is in any way possible to group those values in the slaves, definitely do that.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 21,2017

    Created by: franji1

    If it's Modbus/RTU, you have the issue of framing and inter-packet delays required to help the serial ports frame a packet properly. With fast baud rates (e.g. 115200), it's probably best to do it all in 1 read. If it's "slow " (e.g. 9600), you are probably better off doing multiple requests.

    If it's Modbus/TCP, I'd still do it in 1 request, but it probably does not matter. What may get you with Modbus/TCP is if you have only one TCP Master connection, then you have to re-establish the TCP for EVERY slave device. If you could make 11 simultaneous TCP Master connections, one that is maintained continuously for each slave device, then THAT will help with overall throughput. Think 1 telephone talking to 11 people to ask them "What's in register 40001 " (call slave 1, ask, hang up, call slave 2, ask, hang up, call slave 3, ask, hang up, ...) vs. having 11 telephones where you make the one call on each phone and just keep the call connected (call slave 1 on phone 1, ask, ask, ask, ask, ....). One TCP connection is like one telephone call. Eleven TCP connections are like 11 simultaneous telephone calls.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 21,2017

    Created by: kewakl

    If it's Modbus/RTU, you have the issue of framing and inter-packet delays required to help the serial ports frame a packet properly. With fast baud rates (e.g. 115200), it's probably best to do it all in 1 read. If it's "slow " (e.g. 9600), you are probably better off doing multiple requests.

    If it's Modbus/TCP, I'd still do it in 1 request, but it probably does not matter. What may get you with Modbus/TCP is if you have only one TCP Master connection, then you have to re-establish the TCP for EVERY slave device. If you could make 11 simultaneous TCP Master connections, one that is maintained continuously for each slave device, then THAT will help with overall throughput. Think 1 telephone talking to 11 people to ask them "What's in register 40001 " (call slave 1, ask, hang up, call slave 2, ask, hang up, call slave 3, ask, hang up, ...) vs. having 11 telephones where you make the one call on each phone and just keep the call connected (call slave 1 on phone 1, ask, ask, ask, ask, ....). One TCP connection is like one telephone call. Eleven TCP connections are like 11 simultaneous telephone calls.

    Still, we do not know what 'control ' the OP is using. Maybe an mcu with a 64 byte serial buffer.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 21,2017

    Created by: tftSam

    For my application, I am talking to 11 Modbus devices.

    Product (controller and the mythical Modbus devices) info would be helpful as someone here may have experience with it (them.)

    I am using a P2k PLC as the master and need to read from 11 Acuvim II power meters to monitor power consumption around our plant and eventually control a load shedding system. While speed and efficiency are not very important in this application, I had wondered about this before and wanted to know the best practice.

    I need to read four registers from each device, but these registers are all fairly far apart.

    Does the device support a block transfer? If so, you could map those registers to the block transfer area.

    Unless I missed something in the manual, there is no way to do a block transfer with these power meters.

    Is it better to do poll the devices once and read around 60 registers for the 4 I need or to do 4 polls and read only the values I need?

    Can your polling device handle (size and parsing ability) of all 60 registers?

    Will bandwidth be a problem?

    How difficult will the programming/comms interlocking be for multiple reads?

    Personally, I would not bulk-read 60 registers just to retrieve 4.

    I haven't tested it, but I believe that the P2k PLC and the power meters can handle reading all of the registers in one poll.

    Bandwidth shouldn't be a problem. I don't need to poll the devices frequently enough for it to be a problem.

    Is there any kind of rule of thumb for how many registers to read at a time?

    Depends on your network/bandwidth/loading. RS-485/422, Ethernet?

    All of my limited experience with Modbus has been Modbus RTU over RS-485.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 21,2017

    Created by: kewakl

    I haven't tested it, but I believe that the P2k PLC and the power meters can handle reading all of the registers in one poll.

    Bandwidth shouldn't be a problem. I don't need to poll the devices frequently enough for it to be a problem.

    All of my limited experience with Modbus has been Modbus RTU over RS-485.

    Agreed. add enough characters to appease the forum overlords.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 27,2017

    Created by: OldControl

    We have used Acuvim II power meters with P3K but not P2K

    Are you using RS485 ports on any Remote I/O P2-RS?

    Had good luck with RS485 on main rack but not so much on Remote I/O (Com stops and hard to restart)