LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OPC UA client not giving any error when losing connection to the OPC server

Hello,

 

I using LV2018 and am trying to implement a simple retry algorithm for when my OPC client loses connection to the OPC server, but the problem is I am not getting any errors when reading/writing. How can I implement a simple retry function that keeps retrying to connect until the VI is turned off?  

0 Kudos
Message 1 of 2
(96 Views)

From what I remember, the functions very rarely return an actual error so you have to look at the service status returned by the function or possibly even the statuses within the returned results. I think when I did this previously I used the browse function and just browsed to the root location periodically but I think the read should return the same service status.

 

There are a ton of codes it can return but if you look at the list I'm pretty sure anything greater than 0x80000000 is a "Bad" status so you can very generically handle all the "Bad" status responses.

 

The OPC UA API changed a few times so hopefully I'm remembering the API right.

Message 2 of 2
(61 Views)