LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Slave network error

Hello everyone,

 

I'm using a cRIO-9063 running a Modbus TCP Slave and after a few hours of communication the controller stops accepting any Modbus connections after a few hours of running, but ping, ssh and web server work fine.

 

I've talked to IT and they assured me that there's no firewall rule blocking anything.

 

Im using LabVIEW 2020 and tried both Modbus Libraries shown below, but got the same result.

 

modbus.png

 

I've captured some network packets to try to figure out what's wrong but my network knowledge is limited.

 

Those are the packets from a single connection attempt:

jpaiva_0-1691753644856.png

 

 

It seems like it's erroring at the beginning of the 3 way handshake to stablish connection.

 

The master application tries to stablish connection and sends a SYN, ECN, CWR packet to the controller.

jpaiva_1-1691753780337.png

Packet 1

 

Then the controller responds with a RST packet.

jpaiva_2-1691754396776.png

Packet 2

 

The Modbus Master tries to resend the packet with modified flags SYN only but is unnable to connect:

jpaiva_4-1691754569438.png

Packet 3

 

Debugging the deployed application, I can see no errors on the TCP slave.

It's as if the Modbus Slave never stopped working from the slave side, but I cannot connect to it.

 

The Modbus Slave Code is pretty simple:

jpaiva_5-1691755115565.png

 

 

I tried connecting with 3 different Modbus Master programs, but neither could connect.

 

The modbus log can be found at https://drive.google.com/file/d/125VhBadaxi9jWOu2S3nrOSlsID_uR-Z_/view?usp=sharing 

 

 

Any help is appreciated, and let me know if you need anything else.

 

Regards,

 

Dario Camargo

 

0 Kudos
Message 1 of 7
(1,161 Views)

What's happening in the other cases? I see the default wire value on the Modbus session is fed through one of the other cases, so your reference might be bad if you enter that case and then go back to the Write Slave case.

0 Kudos
Message 2 of 7
(1,131 Views)

It just closes and reopens the modbus slave.

 

No other cases are being called on this test.

0 Kudos
Message 3 of 7
(1,127 Views)

Okay, worth a shot on low-hanging fruit since that's bitten me before. To clarify, the application runs for an extended period of time without issue before it finally stops accepting new connections? Is it always the same(ish) duration of time before it fails?

0 Kudos
Message 4 of 7
(1,110 Views)

We need to see more of your code. How about uploading your VI?

0 Kudos
Message 5 of 7
(1,109 Views)

Usually the application runs as desired for 12 hours, sometimes 4 hours.

 

The code is pretty simple. 

 

In the first loop the master reads data from some inverters that only has FC23 and put it in a queue that's consumed by the 2nd loop that writes the data to a Modbus Slave so a really old supervisory that cannot read FC23 can get this data.

0 Kudos
Message 6 of 7
(1,079 Views)

The 3rd loop is where I tried to make it restart itself, but it's not working as intended and ends up not sending the Reset Slave message to loop 2.

0 Kudos
Message 7 of 7
(1,077 Views)