08-11-2023 07:07 AM
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.
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:
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.
Packet 1
Then the controller responds with a RST packet.
Packet 2
The Modbus Master tries to resend the packet with modified flags SYN only but is unnable to connect:
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:
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
08-11-2023 02:51 PM
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.
08-11-2023 03:00 PM
It just closes and reopens the modbus slave.
No other cases are being called on this test.
08-11-2023 03:17 PM
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?
08-11-2023 03:17 PM
We need to see more of your code. How about uploading your VI?
08-11-2023 06:15 PM
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.
08-11-2023 06:17 PM
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.