03-21-2025 05:05 AM
Hello everyone,
I am working on a project where I need to implement logic to reconnect to a Modbus TCP connection if it is interrupted for any reason. The goal is to rebuild the connection using a refresh button without stopping the While loop.
I have tried to achieve this by using a shift register and a Case structure (as shown in the attached image), but it seems like the communication is not working as expected.
Has anyone encountered a similar issue or have any suggestions on how to properly implement this logic in LabVIEW? Any ideas or insights would be greatly appreciated.
Thank you in advance!
03-21-2025 05:14 AM
I never used that MODBUS library, but certainly there is a vi to close and cleanup the connection.
Close and then re-open. You should also close after the loop.
03-21-2025 08:34 AM
try making an "non initialized" shift register and wire that case structure to the iteration from the while loop, the case will run either when i=0 or when the button REset is pressed.
I'm not sure if you keep opening MODBUS several times without properly closing it may cause other errors.