# Add delay between Polls for devices in Modbus RTU

**URL:** <https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591>\
**Category:** Ignition\
**Created:** [November 12, 2020, 5:01pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591 "2020-11-12T17:01:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 12, 2020, 5:01pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/1 "2020-11-12T17:01:49Z")

</div>

Hi  
IN Modbus RTU connection on a single Rs485 bus, there are cases, that master have to poll each device in with some delay in sequence. The delay is important because some times the slave devices need some time to empty their buffer before can get another packet request. As I test ignition Modbus RTU driver I see that it try to poll every device register without any delay. Even I put scan rate to 10s it doesn’t matter the driver try to poll every thing in every 10 s as soon as possible.  
I don’t know if this driver have any option to put some delay between polls.  
Is there any workaround?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 12, 2020, 5:25pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/2 "2020-11-12T17:25:07Z")

</div>

Use a Modbus TCP gateway that has this option or use Kepware.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 12, 2020, 7:13pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/3 "2020-11-12T19:13:48Z")

</div>

Ok I have questions. How modbus RTU driver create queue for different define device ID? For example if I define 3 devices for ID 1, 3 and 8, in which order they will be polled?  
If I know this I can create dummy device with enough timeout between each two consequence device so add some delay.  
For example if the order is 1 -\> 3 -\> 8.  
I can create 2, 4 as dummy device and each time driver poll those ID it has to wait for the timeout.

1 -\> 2 (wait time out) -\> 3 -\> 4(wait timeout) -\> 8

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 12, 2020, 7:26pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/4 "2020-11-12T19:26:47Z")

</div>

> [@nader.chinichian](#):
>
> if I define 3 devices for ID 1, 3 and 8, in which order they will be polled?

If you're talking about creating 3 separate devices in Ignition; you can't. Only one will be able to open the serial port.

If you're talking about 1 device where you've addressed tags on multiple slave/unit IDs, e.g. 1.HR1, 2.HR1, 3.HR1, then there is no defined order, it is basically non-deterministic.

---

<div class="post-metadata">

**Author:** ![Brian](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@Brian](https://forum.inductiveautomation.com/u/Brian)\
**Post date:** [November 12, 2020, 8:46pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/5 "2020-11-12T20:46:30Z")

</div>

Could you create the tags, set them to be not polled at all, and then use scripting and `system.opc.read/write` functions to manually handle the refreshing of the tags and writing new data?

Also, would subscribe vs read mode on the scan class affect the timing? Wasn’t sure if subscribe would spread the traffic out a little more evenly. Still no guarantee that it would wait between reads though.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 13, 2020, 2:29pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/6 "2020-11-13T14:29:33Z")

</div>

Unfortunately I notice today that driver issue all poll request at the same time for all IDs in the bus. So every device try to answer the request base on their ID and we have collisions detection on the RS485 bus. It seems the one who write the driver think it works as TCP connection and doesn’t care about serial limitation.  
I hope IA fix this issue unless the driver is totally useless in serial mode.  
Using system.opc.read is fix the problem and it’s good for small tag count but it ruin rapid development concept here. Even using external modbus TCP TO SERIAL doesn’t solve the problem here.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 13, 2020, 2:39pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/7 "2020-11-13T14:39:02Z")

</div>

> [@nader.chinichian](#):
>
> Unfortunately I notice today that driver issue all poll request at the same time for all IDs in the bus.

Can you offer some proof or logs that show this happening? It should only send one request at a time.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 13, 2020, 2:42pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/8 "2020-11-13T14:42:13Z")

</div>

Sure tommorow I will.  
I use 8.0.12.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 13, 2020, 2:52pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/9 "2020-11-13T14:52:02Z")

</div>

Can this fix the problem?

 ![Screenshot_20201113-180253__01](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/58fd47770ec6f04de76ae768c487ee9f42f40c77.jpeg)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 13, 2020, 2:54pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/10 "2020-11-13T14:54:31Z")

</div>

No, that is an option on the Modbus TCP driver that allows you to configure _more_ than 1 concurrent request allowed.

Until that release all versions of the driver have only allowed 1 request at a time. I’ve never seen any report that it behaves otherwise.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 13, 2020, 3:49pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/11 "2020-11-13T15:49:21Z")

</div>

Are you not specifying the unit numbers? If you leave the unit off in the OPC item, it defaults to zero I believe, which is the broadcast address. On a real serial line, that will cause all slaves to respond. The broadcast address should only be used with fire-and-forget write operations.

(FWIW, I think I will implement this delay on the client side of my coming combined Client & Server Modbus driver. Should be ready by end of the year. I’ll make an announcement soon for beta testers.)

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 13, 2020, 4:24pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/12 "2020-11-13T16:24:37Z")

</div>

Hi Paul  
Yes I use unit number for different device on the same serial port on RS485 BUS.  
This is standard method to access several device on a share media.  
I’m not using zero ID. The problem with deriver is it send all poll request at the same time and doesn’t queue them. This problem only happens for serial and not TCP so your client server driver doesn’t help me.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 13, 2020, 4:29pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/13 "2020-11-13T16:29:26Z")

</div>

You aren’t trying to use different device names pointing at the same serial port, are you?

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 13, 2020, 4:57pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/14 "2020-11-13T16:57:46Z")

</div>

No same device name connection. only differentiate devices with ID.  
[meter]1.HR102  
[meter]2.HR102  
[meter]3.HR102  
[meter]4.HR102

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/3/c38bb97395f1b32badebbb5120f478c1653cdd3a.png)

---

<div class="post-metadata">

**Author:** ![robwarren](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@robwarren](https://forum.inductiveautomation.com/u/robwarren)\
**Post date:** [November 17, 2020, 9:11pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/15 "2020-11-17T21:11:33Z")

</div>

I recommend using a communications tool such as Kepware (or any other) like Mr. Herron suggested.  
Best of luck!

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 18, 2020, 3:34am UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/16 "2020-11-18T03:34:47Z")

</div>

It’s not possible for linux system and also it add cost to projects.  
So the best option using system.opc as Brain suggest.

---

<div class="post-metadata">

**Author:** ![ldb.techxpert](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ldb.techxpert/32/6293_2.png) [@ldb.techxpert](https://forum.inductiveautomation.com/u/ldb.techxpert)\
**Post date:** [November 19, 2020, 5:50pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/17 "2020-11-19T17:50:36Z")

</div>

Did you try to create a “driven scanclass” to read each tag one after the other?

I’m just brainstorming… But RTU is like a telephone line.

The first command must be completed before issuing the second.

[meter]1.HR102 - Read  
[meter]1.HR102 - Done drive [meter]2.HR102 - Read  
[meter]2.HR102 - Done drive [meter]3.HR102 - Read  
[meter]3.HR102 - Done drive [meter]4.HR102 - Read  
[meter]4.HR102 - Done drive [meter]1.HR102 - Read

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 19, 2020, 7:17pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/18 "2020-11-19T19:17:22Z")

</div>

Could you be more specific how to do that with driven scan class for 600 tag across 10 device?

---

<div class="post-metadata">

**Author:** ![ldb.techxpert](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ldb.techxpert/32/6293_2.png) [@ldb.techxpert](https://forum.inductiveautomation.com/u/ldb.techxpert)\
**Post date:** [November 19, 2020, 7:58pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/19 "2020-11-19T19:58:27Z")

</div>

Memory Tag with value change every X sec 1 to 10…

Scan Class = Value 1 Trig ALL [meter]1.HR102  
Wait  
Scan Class = Value 2 Trig ALL [meter]2.HR102

Probably the Modbus TCP to Modbus RTU adapter do this automatically

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 8, 2020, 9:00pm UTC](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591/20 "2020-12-08T21:00:07Z")

</div>

Beta announcement for my new Modbus module. It implements this inter-request delay in its Client driver type:

> [@Automation Professionals' Advanced Modbus Driver](http://forum.inductiveautomation.com/t/automation-professionals-advanced-modbus-driver/41312):
>
> Automation Professionals is pleased to announce the first beta for its Advanced Modbus Driver, for Ignition version 7.9. Key features: Server mode, emulating one or more slave [devices](https://www.automation-pros.com/modbus/UserManual.pdf), using any of the three typical connection types, including simultaneous connections of multiple types. Client mode, incorporating all three connection modes in one driver. Support for Modbus Function Codes 20 and 21, File Records. Configure protocol tweaks for troublesome devices per slave unit, enabling suppor…

[Next page](https://forum.inductiveautomation.com/t/add-delay-between-polls-for-devices-in-modbus-rtu/40591.md?page=2)
