Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

WriteValue UAEngineException

More
24 Mar 2021 12:59 #9551 by support
What you describe is by design - both for WriteValue and for subscriptions.

Synchronous methods that work on a single operand (such as WriteValue) throw UAException or a derived exception in case of any errors during the operation, and that is what you need to catch. There is no way to reliably check that upfront, because things may change with time quickly.

Synchronous methods that work with multiple operands (with "Multiple" in their name) never throw, except for usage errors (program bugs such as passing in null where it is not allowed). Any errors are reported in the output array - each element has an .Exception property that is either null (OK) or not (an error). There is no way to reliably check upfront.

Asynchronous methods like SubscribeXXXX also never throw, except for usage errors . All errors are reported through the event notifications or callbacks.

Best regards
The following user(s) said Thank You: mozesa

Please Log in or Create an account to join the conversation.

More
24 Mar 2021 12:34 #9550 by mozesa
Hello!

I tested the case what happen when the PLC goes off, I got the below exception.
OpcLabs.EasyOpc.UA.Engine.UAEngineException: Cannot lock the OPC-UA client session because it is not available.
+ The client method called (or event/callback invoked) was 'WriteMultiple'.

And the function which was called while the PLC was off.

Warning: Spoiler!


Besides that I use the SubscribeMultipleMonitoredItems method which works nicely in case of PLC being off.

Should I catch the exception or I could check something before invoking the WriteValue method.


Thanks for your help in advance.

Best Regards!

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.042 seconds