Add delay between Polls for devices in Modbus RTU

Hi Phil
It’s games changer for specially when you add slave mode in ignition.
Could I know the price?
Does your serial lib work in ARM like raspberry PI?

Tentatively, $400.

It should. It is in the list:

Note that this is the same library that IA switched to in the midst of v8.0, and made part of the platform before v8.1 came out. I'll be leveraging that when I release support for v8.1.

I test that lib and it works.
Can we have separate timeout setting for each ID on the same serial link?
Can we access setting via opc ua? Like timeout and dynamicly change it?

No, the timeout is per-link. Sorry. But the minimum time between requests is per-unit.

No, the architecture requires the settings be in place at device startup, so they are part of the settings record.

Does this RS-485 Mode new feature solve this issue in v8.1.25 rc1?

Added an "RS-485 mode" setting to Modbus RTU driver.

No, just turns on “RS-485 Mode” on the underlying serial library, which I think just enables tx/rcv on the RTS pin.

I also want to read 25 power analyzers with rs485 communication. I can read sequentially into the TGW 700 (modbus rtu to tcp) gateway and into Kepserver.
Is it possible to read this directly with Ignition?

Should be possible. Have you tried? (Ignition's two-hour free trial mode should let you confirm this on your hardware.)

I think it doesn't work, I did many tests.
"In queries on Kepserver"
ID1 - query-answer
wait 1 second
ID2 -
wait 1 second
ID3 -
wait 1 second
ID4 -
wait 1 second
........
ID25
I can do this in Kepserver.

"Queries in Ignition"
The device becomes busy. Where should I set the waiting time?

Ignition's native driver doesn't have such an option. My alternate driver (linked above) has something close to that, that forces a delay between requests to the same ID. Note that you'll need to have all of your tags in a tag group that is set to 25000 ms pace.

1 Like

For anyone finding this, note that the Modbus Broadcast function using slave ID zero supports a write function code only, like when Lt. Rip Masters (of Rin Tin Tin fame) tells the sergeant to get the cavalry troops mounted up and the Sergeant yells out, “Saddle up, men”. The sergeant is not expecting a reply and neither is the Modbus RS-485 bus, the expectation is the completion of some universal action. An RS-485 bus would be chaos with multiple slaves attempting to reply all at once.

https://modbus.org/docs/Modbus_over_serial_line_V1.pdf

In broadcast mode, the master can send a request to all slaves.
No response is returned to broadcast requests sent by the master. The broadcast requests are necessarily writing commands. All
devices must accept the broadcast for writing function. The address 0 is reserved to identify a broadcast exchange.

I'm aware. Due to shared code between serial Modbus and Modbus TCP, I don't actually support broadcasts on unit zero. (Modbus TCP expects unit zero to work like any other unit.)

I’m looking at an application where we have 6 slave devices connected to a gateway, some of which are through slower radio links. We’re trying to control the rate at which the tags are polled and hoping to scan each device in a round-robin to avoid overwhelming the modbus gateway. From this post and from the documentation, it does appear that your driver handles the round-robin nature of the scanning internally.

We’ve done some testing and so far the results are promising however the relationship between the Tag Group, Timeout Delay (device setting) and Request Delay (Slave device) aren’t clear to me. With the settings for two of the slave devices listed below, I’m seeing requests/responses between the Ignition and Modbus gateways in the ~150ms range. The tags associated with each slave device are on their own direct tag group, both set to 2 seconds. With this and the 1000ms request delay, I would expect more along the lines of a 3 second delay.

If I increase the tag group to 25 seconds, I’ll see responses come in at around 25-28 seconds in wireshark. It seems like the tag group has more of an influence at this rate than it does at a faster rate.

If the goal is to poll each device at a predictable rate, say 5 seconds, is there anything special that needs to be set up in terms of tag groups or device configuration?

  • Gateway
    • Timeout Delay - 3000ms
    • Devices
      • ID28
        • Request Delay - 1000ms
      • ID31
        • Request Delay - 1000ms

Set your tag groups to 5000ms. This sets how fast Ignition will try to read the tags.

Set your request delay (per unit) to get the desired spread for each unit, if necessary. This limits how hard that specific unit can be hammered.

Your timeout might need to be shorter, as a timeout stalls the entire link.

The delay and timeout settings cannot make the link go faster. They can only make things go slower.

Also, if your gateway is presenting Modbus TCP, make sure concurrency is set to 1.

1 Like