Socket connection closed, DriverState was Connected. [Modicon M340]

Im trying to troubleshoot an issue im experiencing with a Modbus TCP device connection to Ignition 8.1 The device is a Modicon M340 and started flipping between connected/disconnected after a power shutdown yesterday, this connection ran fine for a year before that with no issues. I’ve tried disabling/reenabling the driver. Deleting and recreating the driver. The tag group scan class is 1000ms. I tried to cherry pick some alarm tags that are not as critical and putting them in a different tag group with a scan class of 2000ms. I checked that Span Gap was enabled on the driver as well. I’m not sure what else to try from an ignition standpoint. I attempted to connect to the PLC using modscan and the TCP/IP connection was terminated immediately. Has anyone seen this before and know what else to try? I’m starting to think this issue is outside of ignition, and can be a firewall/ network switch or PLC issue.

Here’s a copy and paste of a couple of error logs that Ignition had.

SocketIODelegate 03Dec2025 08:10:47 [hostname=111.111.111.112,port=502] Socket connection closed, DriverState was Connected.

java.lang.Exception: RequestCycle stopped. at com.inductiveautomation.xopc.driver.api.BasicRequestCycle$AddToQueue.run(BasicRequestCycle.java:120) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

screenshot from modscan:

There's an immediate problem there, that's a public IP you're using.

If that's on a private network, any router or software that sees it will naturally assume its outside your network and try to reach it via the internet. This can be manually overridden, but the IP is owned by someone that is on the internet and redirecting it will cause issues of its own besides just complications on your devices.

If that's actually a device on the internet and your M340 is actually connected to the public internet, and that's it's static IP, you are gonna have issues where everyone else can flood your device with requests.

Whichever it is, there is no surprise that you are having issues.

1 Like

Thanks for responding. This is on a private network and not connected to the internet. Customer has plans to changing their plant’s entire IP scheme, but this is cards I'm dealt at the moment.

Ask your IT collect a couple minutes of packets (wireshark) on the PLC's switch port, so you can see if the PLC is sending the FIN packet. (It might be resource constrained.) But I would suspect a firewall along the path is responsible. Only IT will be able to tell.

1 Like

This will cause issues if you have any routing on your network, the router will likely try and send the data anywhere except to the internal network. You will need to make exceptions to default rules.

1 Like