# Modbus TCP device goes disconnect

**URL:** <https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228>\
**Category:** Ignition\
**Created:** [March 28, 2014, 10:31am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228 "2014-03-28T10:31:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Serhii](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Serhii](https://forum.inductiveautomation.com/u/Serhii)\
**Post date:** [March 28, 2014, 10:31am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/1 "2014-03-28T10:31:37Z")

</div>

Hello again.  
We have Modbus TCP device. Values from this device we can take from Modbus Scanner (DAQFactory) perfectly.  
[attachment=4]Station.png[/attachment]  
But in Ignition this device goes to connect\disconnect state every 3-5 seconds when i try to add the tag. And tag goes to bad quality.  
[attachment=0]Device\_part1.JPG[/attachment]  
[attachment=3]Device\_part2.JPG[/attachment]  
[attachment=2]Device1.JPG[/attachment]  
[attachment=1]Device2.JPG[/attachment]

---

<div class="post-metadata">

**Author:** ![Serhii](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Serhii](https://forum.inductiveautomation.com/u/Serhii)\
**Post date:** [March 28, 2014, 10:32am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/2 "2014-03-28T10:32:44Z")

</div>

[attachment=2]TagConfig.JPG[/attachment]  
[attachment=3]Scan.JPG[/attachment]  
[attachment=1]Tags.JPG[/attachment]

Here is the logs

[attachment=0]logs.bin.gz[/attachment]

---

<div class="post-metadata">

**Author:** ![Serhii](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Serhii](https://forum.inductiveautomation.com/u/Serhii)\
**Post date:** [April 2, 2014, 7:00am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/3 "2014-04-02T07:00:10Z")

</div>

Answer from support:  
"I noticed that the scan class of your tags (5000 ms) are longer than the timeout for the device (2000 ms). Try increasing the timeout for the device to something larger, or set your scan class to something smaller. "

Making Scan class 5000 and timeout 10000 - same result  
15000 and 20000 - same result  
15000 and 30000 - same result  
3000 and 5000 - same result  
5000 and 5000 - same result

---

<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:** [April 2, 2014, 4:58pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/4 "2014-04-02T16:58:08Z")

</div>

You’ve also got incorrect values for all the ‘Max XX Per Request’ settings… if you’re requesting 32-bit values then you’ll need to be able to read at least 2 per request, not 1. You should probably just leave those at the default values for now.

---

<div class="post-metadata">

**Author:** ![Serhii](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Serhii](https://forum.inductiveautomation.com/u/Serhii)\
**Post date:** [April 2, 2014, 5:38pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/5 "2014-04-02T17:38:55Z")

</div>

Trying this: 10, 30, 60 - same result

---

<div class="post-metadata">

**Author:** ![Serhii](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Serhii](https://forum.inductiveautomation.com/u/Serhii)\
**Post date:** [April 4, 2014, 5:13am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/6 "2014-04-04T05:13:09Z")

</div>

Any ideas?

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [April 4, 2014, 7:00am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/7 "2014-04-04T07:00:08Z")

</div>

Try setting the poll rate to 1000ms. Your device might have a short validation time. Post back your results.

---

<div class="post-metadata">

**Author:** ![Serhii](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Serhii](https://forum.inductiveautomation.com/u/Serhii)\
**Post date:** [April 7, 2014, 12:16pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/8 "2014-04-07T12:16:39Z")

</div>

Same result ☹

---

<div class="post-metadata">

**Author:** ![Serhii](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Serhii](https://forum.inductiveautomation.com/u/Serhii)\
**Post date:** [April 8, 2014, 1:50pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/9 "2014-04-08T13:50:50Z")

</div>

Any ideas?

---

<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:** [April 8, 2014, 2:55pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/10 "2014-04-08T14:55:38Z")

</div>

When you’re troubleshooting like this it’s helpful to only be subscribed to ONE tag on the device, and to be using direct/SQLTags to address the tag, not using the address mapping feature of the driver to browse and drag them in.

So remove the address map if you have one, remove all SQLTags pointing to this device, and make one single tag:

[BaseStation]1.IRF0

Make sure ‘Max Input Registers Per Request’ is 2 or greater.  
Make sure ‘One-based Addressing’ is false (this allows you to start your addresses at zero like you are).

After doing this, if there’s still no good value in that tag, on the console in the gateway, under the Levels tag, search for ‘ReadInputRegistersRequest’, turn the logger(s) to TRACE, then wait ~15-20s and export the logs.bin.gz again.

---

<div class="post-metadata">

**Author:** ![Serhii](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Serhii](https://forum.inductiveautomation.com/u/Serhii)\
**Post date:** [April 17, 2014, 6:39am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-goes-disconnect/8228/11 "2014-04-17T06:39:15Z")

</div>

Problem solved with Direct scan class and 15000 slow rate, and OPC Data Mode = Read.

Also, timeout = 10000.
