02-17-2025 06:34 AM - edited 02-17-2025 06:35 AM
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?
02-17-2025 03:51 PM
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.