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.

EasyUAClient.SubscribeDataChange() behaviour

More
25 Sep 2019 13:41 #7758 by support
Hello,

QuickOPC simply delivers you the notifications (data changes) that the server provided. And, the server is providing an initial data change when a subscription is made - it actually *has* to do it, according to OPC UA specifications. This, among other reasons, allows to use subscriptions without having to issue an additional initial "Read" (which, besides being highly impractical, would cause unsolvable race conditions).

If you need to act upon a transition from "false" to "true", you need to add a logic to your event handler and do it yourself. Also beware of error conditions (e.g. after a server disconnection) to make the logic right.

Best regards

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

More
25 Sep 2019 13:11 - 25 Sep 2019 13:17 #7757 by Giuseppe12
testing EasyUAClient.SubscribeDataChange() with dataChangeCallback, the event raise also on startup program

_client.SubscribeDataChange(
	endpointDescriptor: _endpointDescriptor,
      nodeDescriptor: $"{UANamespace.UriString};s={attributes.BrowsePath.Replace("/", "")}",
      samplingInterval: 1000,
      dataChangeCallback: notificationEvent,
      dataChangeFilter: new UADataChangeFilter()
      {
      	Trigger = UADataChangeTrigger.StatusValue,
      },
      state: null);
where the subscribed variable on PLC (and C#) is a boolean type.

Is there a way to filter the event only when variable change to "true" but not in startup application ?

Otherwise in the event handler understand not a true changes ?

Thanks
Last edit: 25 Sep 2019 13:17 by support.

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

Moderators: support
Time to create page: 0.040 seconds