# Modbus TCP device unstable connection

**URL:** <https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [December 18, 2023, 1:21pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254 "2023-12-18T13:21:01Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilan](https://avatars.discourse-cdn.com/v4/letter/i/ecae2f/32.png) [@ilan](https://forum.inductiveautomation.com/u/ilan)\
**Post date:** [December 18, 2023, 1:21pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/1 "2023-12-18T13:21:01Z")

</div>

Hi guys,  
We having strange problem with connecting to Modbus device, We are using Ignition v7.9.  
The device connected for a sec and afterword it disconnected again over and over.  
We have tried to use 3rd party software (Modscan32) without any problem.  
Also we are able to connect another Modbus device without any problem.  
What could be the problem?

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

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8be5745ae942385e36aac29bb99dd0d6849223e6.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:** [December 18, 2023, 1:34pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/2 "2023-12-18T13:34:47Z")

</div>

Are you actually successfully reading at least one tag? Most Modbus devices will time out if nothing is being polled.

---

<div class="post-metadata">

**Author:** ![ilan](https://avatars.discourse-cdn.com/v4/letter/i/ecae2f/32.png) [@ilan](https://forum.inductiveautomation.com/u/ilan)\
**Post date:** [December 18, 2023, 1:46pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/3 "2023-12-18T13:46:06Z")

</div>

Yes I am able to read and also write with modscan32.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/8/b827d8eba4f48f2e733b9812199a61926a978db3.png)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [December 18, 2023, 1:50pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/4 "2023-12-18T13:50:00Z")

</div>

any logs?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [December 18, 2023, 1:50pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/5 "2023-12-18T13:50:39Z")

</div>

can you post an example of how you have this tag setup in Ignition as well as the device configuration?

---

<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 18, 2023, 1:58pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/6 "2023-12-18T13:58:55Z")

</div>

This screenshot shows Modscan32 targeting slave/node address #1. Ignition defaults to using node zero if not specified in its manual addresses.

---

<div class="post-metadata">

**Author:** ![ilan](https://avatars.discourse-cdn.com/v4/letter/i/ecae2f/32.png) [@ilan](https://forum.inductiveautomation.com/u/ilan)\
**Post date:** [December 18, 2023, 2:36pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/7 "2023-12-18T14:36:30Z")

</div>

The problem is at a higher stage with the connection itself (before I added a tag I am able to connect to the device at the gateway)

---

<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:** [December 18, 2023, 2:43pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/8 "2023-12-18T14:43:12Z")

</div>

First you create a device connection.

Secondly, then you create a tag and poll.

If you don't do the second operation, the first will disconnect as a result.

---

<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 18, 2023, 2:47pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/9 "2023-12-18T14:47:10Z")

</div>

> [@Matrix\_Engineering](#):
>
> the first will disconnect

Some devices are also badly behaved (abrupt disconnect) when asked for addresses or queried with functions they don't support. Instead of replying with the error code(s) required by the specification.

A wireshark capture may be required to definitively diagnose this device's behavior. (Captures of both the working Modscan and the non-working Ignition.)

The OP has also not yet provided the OPC Item Path involved here. It might be something simple, but we aren't magicians.

---

<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:** [December 18, 2023, 2:55pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/10 "2023-12-18T14:55:54Z")

</div>

> [@pturmel](#):
>
> we aren't magicians.

**We** aren't. **You** are. 🙂

---

<div class="post-metadata">

**Author:** ![ilan](https://avatars.discourse-cdn.com/v4/letter/i/ecae2f/32.png) [@ilan](https://forum.inductiveautomation.com/u/ilan)\
**Post date:** [December 18, 2023, 3:00pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/11 "2023-12-18T15:00:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ilan](https://avatars.discourse-cdn.com/v4/letter/i/ecae2f/32.png) [@ilan](https://forum.inductiveautomation.com/u/ilan)\
**Post date:** [December 18, 2023, 3:00pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/12 "2023-12-18T15:00:58Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/37c7b8ba18a65f6bd25a0a01870dbfbaeedabcfd.jpeg)

---

<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 18, 2023, 3:06pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/13 "2023-12-18T15:06:50Z")

</div>

Don't test with a whole UDT. Test **One** tag, corresponding to your Modscan32 sample.

The error indicates that the device is abruptly disconnecting. Very bad behavior.

If you get that with a single tag on the Ignition side, using an address known to work with Modscan, then you will need to perform wireshark captures. (Are you running Modscan from the gateway server? If not, there may be other firewalls interfering.)

---

<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:** [December 18, 2023, 3:09pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/14 "2023-12-18T15:09:56Z")

</div>

Was just about to say that but saw Phil was typing and knew he would put it more succintly.

Ensure you disable that UDT from polling before you try reading the single tag.

---

<div class="post-metadata">

**Author:** ![ilan](https://avatars.discourse-cdn.com/v4/letter/i/ecae2f/32.png) [@ilan](https://forum.inductiveautomation.com/u/ilan)\
**Post date:** [December 19, 2023, 9:24am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/15 "2023-12-19T09:24:54Z")

</div>

The situation is similar with one tag. wireshark I installed i checked the situation in the modbus network nothing like that in the traffic. only successful read/write. but I see PLC IP 10.118.44.245 Server IP 10.118.50.35 maybe that's the problem?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b7271cf4a2984c341f680bb62d97d83b4ea91c98.jpeg)

---

<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 19, 2023, 1:01pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/16 "2023-12-19T13:01:32Z")

</div>

Please post the actual capture files. A screenshot of a capture is useless.

---

<div class="post-metadata">

**Author:** ![Coleman\_Dudley](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@Coleman\_Dudley](https://forum.inductiveautomation.com/u/Coleman_Dudley)\
**Post date:** [January 6, 2024, 12:10am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/17 "2024-01-06T00:10:07Z")

</div>

ilan,

Did you ever found it what was the problem is? I'm having the same issue with a Moxa Cellular Gateway.

Thanks,

---

<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:** [January 6, 2024, 12:11am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/18 "2024-01-06T00:11:33Z")

</div>

Start a new topic with as much relevant information as you can instead of reviving more than one old topic.

---

<div class="post-metadata">

**Author:** ![Coleman\_Dudley](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@Coleman\_Dudley](https://forum.inductiveautomation.com/u/Coleman_Dudley)\
**Post date:** [January 6, 2024, 12:18am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-device-unstable-connection/83254/19 "2024-01-06T00:18:10Z")

</div>

Understood.
