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.

Notification for server disconnect or unstable connection

More
26 Jun 2024 09:25 #12889 by support
Hello.

I am not sure if I understand what you are trying to achieve. If you are subscribing to data changes, all non-transient communication problems are reported through the same channel as the valid data - i.e. through the DataChangeNotification event. Simply test the Exception property in the incoming event argument, and if it is not null, there is a problem - and you can display it in the UI, right with the item that it relates to.

If this is not what you wanted, please provide more details of what you need.

The IEasyUAClientConnectionMonitoring service optionally gives you a single notification on the "server" level; but problems that do not affect the whole OPC UA session will not show in this way,.

Best regards

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

More
25 Jun 2024 20:54 #12888 by Twoaster
Final update:

I was missing the
"using Microsoft.Extensions.DependencyInjection" line

Since I'm using .NET 8.0, I had to add some error handling to null references (add the question mark):
IEasyUAClientConnectionMonitoring? clientConnectionMonitoring = _easyUAClient.GetService<IEasyUAClientConnectionMonitoring>();
 if (clientConnectionMonitoring != null)
 {
   clientConnectionMonitoring.ServerConditionChanged += clientConnectionMonitoring_OnServerConditionChanged;
 }

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

More
25 Jun 2024 20:47 #12887 by Twoaster
Additional info:

I tried to use this example:
opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...n%20Monitoring%20Services.html

but I'm having errors on
IEasyUAClientConnectionMonitoring clientConnectionMonitoring = _easyUAClient.GetService<IEasyUAClientConnectionMonitoring>();

regarding "The non-generic method cannot be used with type arguments

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

More
25 Jun 2024 20:16 #12886 by Twoaster
Hi!

I'm creating a program that subscribe to a list of monitored items and updates a user interface with those values on change.

On my subscription, I already have an event that checks for changes on the list and notify the UI about the new values:
_easyUAClient.DataChangeNotification += easyUAClient_MonitoredRepoChanged;

If I remove the ethernet cable from my laptop, I see this message on Visual studio Output console:
OpcLabs.EasyOpc.UA.UAEngineBase Error: 0 : UAClientSubscription failed at tick 1831444218 and will retry in 3000 ms

which is perfect, but I'm trying to notify my UI that the connection was lost, and since no event is triggered on the DataChangeNotification, I have no feedback.

I looked on the standard documentation and couldn't find how I can capture this error on my software. Does the QuickOPC toolkit have a event that gets triggered when a connection drops?

Thank you!

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

Moderators: support
Time to create page: 0.048 seconds