How to implement a startup delay for Ethernet/IP devices in CODESYS

How to implement a startup delay for Ethernet/IP devices in CODESYS
none 0.0 0

I experience similar problem and I believe they are not router related. In my case I use Weintek cMT3072XP codesys device in combination with two Weintek iR-ETN40P remote IO units. If I use codesys default EthernetIP settings (RPI = 10 ms, and cycle time of ENIPScannerIOTask = 10 ms) every time I disconnect EthernetIP remote device (for test unplug LAN2), PLC generates EXCEPTION and stop operating. Exactely as in your case. PLC is in error and it is not running. Because of that there is no communication. In this case “Auto-reestablish connections” can’t help.

If I monitor tasks cycle time when unplugging EthernetIP devices, all tasks stop executing. This is a life-threatening situation. If any of task has watchdog enabled PLC goes to exception. In real life it can happen that some EthernetIP devices get offline and because of that PLC shouldn’t stop!

Only option to solve this problem is to increase ENIPScannerIOTask cycle time. For two EthernetIP devices it needs to be approximately 20 ms. If you use more devices it needs to be even grater. In my case for 4 devices I had to set it to 50 ms that PLC didn’t crashed in case some device was disconnected.

I experience same problem with non Weintek EthernetIP remote devices.

As I could find out only increasing ENIPScannerIOTask cycle time solves EXCEPTION problem. But when increasing task time, IO tags are updated slower. For most of application IO refresh time grater than 50 ms is not sufficient.

This is easy to test. 100 % repeatability.

If someone has any solution for that problem, all Weintek users will appreciate.

Best Regards

Hi @Gasper,

Is this issue replicable even when you connect the HMI’s CODESYS to a single iR-ETN40P without using the router? Also, can you please let us know what version of Weintek’s CODESYS package and what CODESYS firmware version you are using in this application?

Hi Brendon,

Yes. Issue is replicable even with single iR-ETN40P connected directly to LAN1.

I use following versions:

cMT3072XP OS Version= 20250511

Codesys PLC version= 20250926

Codesys V3.5 SP15 Patch5 + (64-bit)

Ethernet Adapter= 3.5.15.0

EtherNet/IP Scanner= 3.5.15.50

For this test I generated new clean project. Only one POE with allocated addresses of iR-ETN40P device. As seen from picture communication works OK.

I can’t add pictures in chat, so I added link to drive with pictures. Probably I need higher status to be able to add pictures.

Picture1.png

When I disconnect LAN1 cable. First Cycle Count in Task Configuration Monitor stop counting. After short time PLC generates Exception. After that Cycle Count of ENIPScannerIOTask and ENIPScannerServiceTask continue to count. MainTask is not counting. This is only task that has configured Watchdog = T#200ms

Picture2.png

My Task Configuration:

Picture3.png

Picture4.png

Picture5.png

iR-ETN40P configuration was generated using EasyRemoteIO:

Picture6.png

Picture7.png

Picture8.png

If I increase cycle time of ENIPScannerIOTask to 20 ms, when communication is disconnected, PLC doesn’t go to Exception. And after reconnecting ethernet cable communication is reestablished.

If I use more EthernetIP devices cycle time of ENIPScannerIOTask needs to be even larger. Than IO refresh time is to slow for most of my applications.

I experience same behaviour also with EthernetIP devices of other manufacturers (AB PowerFlex 525).

If needed I can send project archive.

Best regards, Gasper