Modbus basic question what to poll for for the master ?

Status
Not open for further replies.

Grossel

Well-Known Member
Hi.

I'm asking here because Google cannot provide an answer on this.

I know a modbus master device are polling each slave device in order for the slave device to either read or write some data. And I know each slave can have many registers to read or write data to.
But what I don't know is if the modbus master is polling each register in each slave per poll, or does it retrieve/send all possible (or possible filtered) data that each modbus slave possible can hold in one big data package?

Example: Say a slave device has 100 different registers. Does the modbus master then poll 100 times against that slave device, one poll for each register?
Or does the modbus master poll one time to the modbus slave and then write to any or all registers and read all registers in one chunk?

Or is it somewhere between ?

That is probably a stupid question, and not relevant in order to get two devices to talk to each other - but I want to drill into this, and it's just frustrating that I cannot find any sources mention this. I feel it's like learning to drive a car, but never actually being able to see the car from outside so you don't know anything about tires nor steering and propulsion concepts.
 
Without digging into my old work archive, from my memory the master can poll a slave for one register address, or, a group of contiguous register addresses.

JimB
 
Yes, you can read several MODBUS contiguous registers (up to 120). In most cases, you can read all necessary registers at once. For example, if your slave device has registers 1, 2, 3, 4, 5, but you need #1 and #5 only, you can read all five registers and discard other values. It will work faster than two separate requests.
 
You can throttle the polling rate on any register in any slave to use up all the bandwidth according to your design needs. But obviously contiguous registers would be more efficient per slave. Just have counters in Master to track your cycle of synchronous and have a stack for async types and a priority queue for the stack. This specs for min/max polling latency.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…