LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Reconnecting Modbus TCP without Stopping the While Loop

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!

Download All
0 Kudos
Message 1 of 3
(103 Views)

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.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 3
(100 Views)

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. 

0 Kudos
Message 3 of 3
(71 Views)