简体   繁体   中英

How to add alarms in Eclipse Milo

I am currently using Eclipse Milo to subscribe to values from the OPC UA server (also Milo):

client.getSubscriptionManager().createSubscription(interval).get();

Unfortunately, subscriptions are always tied to a specific interval. I am looking for something like a "push notification" that is received instantly, without a specific interval. Obviously, it would be possible to create a very frequent subscription, but that is not an elegant approach.

Browsing the Milo source, I noticed the class LimitAlarmNode . Is it possible to setup an alarm that is received as soon as the node on the server is set to a specific value? If so, how can I do it?

Thank you very much.

Unfortunately, subscriptions are always tied to a specific interval. I am looking for something like a "push notification" that is received instantly, without a specific interval.

There are no instantaneous subscriptions in OPC UA; notifications will always be published at the interval defined for the subscription. This may seem undesirable when you're only dealing with a handful of items but it's the only scalable approach when you there are tens of thousands (or more) potential changes happening.

OPC UA Alarms and Conditions are defined on top of the OPC UA event model. The client currently supports subscribing to events, so if you did have a server that supported Alarms the client would be able to subscribe to them.

Unfortunately events are not yet implemented in the server SDK, so even if alarms did provide the functionality you are looking for support is probably a ways out in the server.

According to the OPC UA documentation of Unified Automatiion there are three types of changes that an OPC UA client can subscribe to:

  1. subscribe to data changes of Variable Values (Value attribute of a Variable),
  2. subscribe to Events of Objects (EventNotifier attribute of an Object & EventFilter Set), and
  3. subscribe to aggregated Values, which are calculated in client-defined time intervals, based on current Variable Values.

The second option seems applicable to your use case because that is the one where no sampling takes place in the OPC UA server. As the events of the object occur they are added to the queue. I don't know how to do it and I am not sure this Event of Objects is what Kevin Herron refers to when he stated: "events are not yet implemented in the server SDK".

( Source )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM