LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic reconnection of MODBUS TCP

Solved!
Go to solution

Hi there! 

I have a plc which communicates using Modbus TCP IP with my Lab view code. 

I want to develop my code such that the reconnection happens automatically whenever I remove my ethernet cable and connect again. 

0 Kudos
Message 1 of 3
(1,863 Views)

Hi,

 

I was suggesting putting a VISA close function and wire your module ports reference to it before closing the ModBUS communication.

Visa.png

0 Kudos
Message 2 of 3
(1,807 Views)
Solution
Accepted by topic author doc_d

Continuously check for error. If there is no error then pass the modbus reference. If there is any error disconnect the reference and create new reference as below image.

modbus.PNG


CLD Using LabVIEW since 2013
Message 3 of 3
(1,795 Views)