# Modbus rtu over tcp read failure

**URL:** <https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [June 19, 2020, 5:34am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815 "2020-06-19T05:34:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![huyao](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@huyao](https://forum.inductiveautomation.com/u/huyao)\
**Post date:** [June 19, 2020, 5:34am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/1 "2020-06-19T05:34:24Z")

</div>

Hi all,

I got a problem with modbus rtu over tcp protocal to read some energy device.  
A 485 to tcp servert port was used. I had tried with modbus poll to read those addresses，everything goes well.  
However with ignition modbus rtu over tcp module, the bellowing warnning was continuously loged.

> | ReadHoldingRegistersRequest | 19Jun2020 21:19:40 | Request failed. FailureType==TIMEOUT |
> | --- | --- | --- |
> | TimeoutDaemon | 19Jun2020 21:19:40 | ScheduledRequest[com.inductiveautomation.xopc.drivers.modbus2.requests.ReadHoldingRegistersRequest@2085e362] request with key "937" failed due to timeout. |

I add those nodes 1 by 1 for test, when the number for nodes is 1 or 2, everything is ok, but when the number bigger than 3, the warnning occurs.  
It seems something was wrong with that modbus rtu over tcp module.  
Does anyone else meet the same probelm ?

---

<div class="post-metadata">

**Author:** ![huyao](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@huyao](https://forum.inductiveautomation.com/u/huyao)\
**Post date:** [June 19, 2020, 6:19am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/2 "2020-06-19T06:19:38Z")

</div>

Ignition version :8.0.10  
modbus drvier module version:6.0.13

---

<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:** [June 19, 2020, 12:02pm UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/3 "2020-06-19T12:02:47Z")

</div>

Sounds to me like you are putting too many items in your scan. And/or too fast a group rate. Modbus RTU is a rather slow serial protocol–connecting over TCP doesn’t make it faster. See what happens if you test unit 3 alone.

---

<div class="post-metadata">

**Author:** ![huyao](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@huyao](https://forum.inductiveautomation.com/u/huyao)\
**Post date:** [June 20, 2020, 2:40am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/4 "2020-06-20T02:40:35Z")

</div>

Hi Phil，

Thanks for your suggestion.  
My tag datatype is attached, 10 items for per unit(or node).  
[PD\_HOKO.json](https://forum.inductiveautomation.com/uploads/short-url/pD5WuqjzR3wP2g2SEJp2wGrCgf.json) (3.3 KB)  
If only 1 unit was tested, no matter which unit, everything goes well.  
But if 3 or more units were tested, the quality of all tags was flashed from “Good” to “BAD”.  
The problem is for each device connection, 20 units were listed.  
I will say it is not the problem of modbus rtu protocal or the port convertor , because I tested with other software with the same scan rate (1 second) successfully.  
 ![4nodes](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9b6a8aaf7acd3cf7f32e4bf6435819ebf9e4598f.png)

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [June 20, 2020, 2:59am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/5 "2020-06-20T02:59:16Z")

</div>

Please list the hardware you are using.

If you want to ignore Phil’s advice of contacting support, then please give a lot more detail.

Note this forum is not support. It is ran by volunteers.

---

<div class="post-metadata">

**Author:** ![huyao](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@huyao](https://forum.inductiveautomation.com/u/huyao)\
**Post date:** [June 20, 2020, 5:23am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/6 "2020-06-20T05:23:38Z")

</div>

Hi there,  
Thanks for your coment.  
The modbus salves were some power meters,local brand, I can’t even find an English manual for that.  
The 485 to TCP convertor was Korenix JetPort 5601.  
[[https://www.korenix.com/en/product/show.aspx?num=60](https://www.korenix.com/en/product/show.aspx?num=60)]([http://jetport](http://jetport) 5601)  
Also a ticket was submit for support.  
Just wonder to know if someone else met the same issue.

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [June 20, 2020, 5:30am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/7 "2020-06-20T05:30:47Z")

</div>

No problem, please answer:

1. How many JetPort will be in the final system
2. How many slave power meters are attached to each Jetport
3. How many tags are in each power meter
4. How fast are you polling these tags
5. What is the distance between RS485 slaves and did you follow best practices with the physical RS485 wiring

I will ask more questions based on your response to these first 5

---

<div class="post-metadata">

**Author:** ![huyao](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@huyao](https://forum.inductiveautomation.com/u/huyao)\
**Post date:** [June 20, 2020, 5:52am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/8 "2020-06-20T05:52:20Z")

</div>

1. total will be around 30 Jetports.
2. the number of slaves for each Jetport is differ from 20 to 30.
3. 10 tags for each meter
4. 1 second was prefered
5. Yes, length of each 485 wire is around 100 meters.

* * *

Besides, the problem occured when the first Jetport was connected.

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [June 20, 2020, 6:05am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/9 "2020-06-20T06:05:11Z")

</div>

1. what network setup (architecture), e.g. LAN, WAN, Cellular from server to Jetport
2. what is the RS485 baud rate
3. raw data type? e.g. 32-bit float
4. preferred or essential
5. what cable? shielded? twisted pair? csa? end resistors?  
100 meters between each power meter, maybe 30 slaves max, total rs485 length from AB of Jetport to AB of last meter = 30 \*100 = 3KM??

I am asking more questions perhaps than needed, but you need to consider these points for the final fitted solution

---

<div class="post-metadata">

**Author:** ![huyao](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@huyao](https://forum.inductiveautomation.com/u/huyao)\
**Post date:** [June 20, 2020, 6:19am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/10 "2020-06-20T06:19:55Z")

</div>

1. LAN
2. 19200
3. 32-bit float Little-endian
4. preferred, but when I got first failure, 10 seconds was tried , same problem.
5. shielded twisted pair.  
The power meters was in the same room, so total length for a Jetport 485 wire is around 100 meters.

Agreed, the hardware connection is all good and checked.  
I had tried an IIOT device from Beijer to load the same Jetpot with 1 second scan rate. Everything goes well.  
Now I use IG as an OPC-UA client to read those data from Beijer temporary.

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [June 20, 2020, 6:38am UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/11 "2020-06-20T06:38:17Z")

</div>

OK without knowing your hardware (as in, you can’t provide a manual and I have never used those brands)

Go to the Ignition Gateway  
Go to status  
Go to devices  
Click on the device (“Details”) when only 1 JetPort is connected  
Look at the information  
Now change the min level from info to trace  
Then add more nodes until it fails, look again, compare the information  
Then go into device settings (config section of gateway)  
go to each JetPort and start changing the advanced settings down  
e.g. max holding registers per request  
etc, etc

Other things to try outside of Ignition;  
Increase the baud rate. Note the higher the baud rate, the better your physical cabling needs to be  
Change settings in the JetPort

Remember here, you are not asking for 10 tags every second. You are asking for 200-300 tags per second per JetPort. All floats.

Whilst I haven’t used your power meters, I can tell you there are physical, hardware-based limitations on how many tags you can read at once. @pturmel covered this in his first reply.

Here endeth my advice, good luck!

---

<div class="post-metadata">

**Author:** ![jay](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jay](https://forum.inductiveautomation.com/u/jay)\
**Post date:** [June 20, 2020, 8:05pm UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/12 "2020-06-20T20:05:59Z")

</div>

You should use a Modbus TCP to Modbus RTU gateway (there are many to choose from) instead of a serial device server. Anyway…

Create a unique driven tag group (scan class) for each energy device and assign the tags in that device to the group. Set the scan rate for each tag group that is connected to the same serial device server a little differently. E.g.,

tag group A, 5000 ms  
tag group B, 5210 ms  
tag group C, 5420 ms

and so on.

Now you are not trying to poll all of the end devices at exactly the same time. See how that works. You will still get some errors, but it should work much better.

To get rid of more errors you will have to use driven tag groups and write a script to trigger the reads one end device at a time, waiting for a reasonable timeout period before triggering the next device read.

---

<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:** [June 21, 2020, 5:51pm UTC](https://forum.inductiveautomation.com/t/modbus-rtu-over-tcp-read-failure/35815/13 "2020-06-21T17:51:39Z")

</div>

Your network load is not the problem. Based on your JSON export, most of your tags are contiguous, words 22-35, with three others: 6-7, 44-45, and 66-67. Ideally, you need four requests to read these blocks, satisfying the ten float tags. Per the modbus specification (PI-MBUS-300 from [modbus.org](http://modbus.org)) these requests and their responses should take 62.5ms at 19200-N-8-1 (including the inter-message silent time on the wire). Twenty devices is a modest overload–you won’t get one-second timing.

I believe Ignition will make the requests in the pattern above if the “Span Gaps” setting is turned off in the driver. I suspect that your devices have registers (other than your ten) that respond poorly, and spanning gaps will read unexpected registers. Spanning from word 6 to word 67 would take 75ms, but would read up to 31 floats, which is why it is default “on”. Try turning that setting off.
