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.

How do i define and see alarms?

More
05 Nov 2013 08:53 #1527 by support
How and when the alarms&events are generated depends o=completely on the particular OPC server. SOME servers may base it on values of tags. And they may, or may not have OPC-Data Access part to them. But there are also OPC A&E servers that only provide OPC-A&E, and have no OPC Data Access part, and even don't have any "tags" to speak about, or data values to be compared to some limits.

In our Simulation server, which implements both OPC-DA and OPC-A&E, we have provided some pre-defined alarms that are generated automatically (and some that can be triggered externally). The purpose of the Simulation server is to allow the customer "see" the client component action, and for that we needed some alarms.

You should not limit your thinking to how the Simulation server works. Either you are developing a specific solution and therefore you do have information about how the target OPC server generates alarms, OR you are developing a generic solution that should not depend at all on the specifics of the target OPC-A&E server. But I cannot imagine why you would need to develop something that truly "knows" and is adopted to how our own Simulation server works.

In OPC-A&E, alarms cannot be "read". That is one of the things that actually makes this spec different from OPC Data Access. Alarms are asynchronous in nature, and the expected way to work with them is to subscribe to alarms coming from given sources or areas, i.e. a subset of the address space, and optionally specify a filter for their priorities and other characteristics. We have the SubscribeEvents method for this.

Besides this, I admit that there are ways to do something similar to "read". but you need to be careful to know what you are doing. Specifically, these extra "ways" to get info from OPC A&E server only work with so-called Condition events, for which the OPC servers keeps an internal state. They do NOT work with Simple or Tracking events, which are basically on-time occurences for which there is no state in the OPC-A&E server, and if your code was not "listening" at the time they occurred, they are gone forever.

With Condition events, you can also
  • call RefreshEventSubscription. This is useful mainly upon startup of the program, when you want to extract the current state of these alarms from the server. They will come as event notification - you still need to call SubscribeEvents.
  • obtain a state of a specific condition, by calling GetConditionState.
I hope this helps.

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

More
04 Nov 2013 08:22 #1526 by byteslash
Hi, maybe i got it all wrong, but here is my question:

The way i understand it, alarms&events (im just working on the alarms part here) is just a threshold we define on top of already defined tags.
So, there are already Greenhouse tags, how do i define that any value below 5 for temperature is an alarm?
Ive been studying the code on DocExamples and i dont see any simple method to read alarm values like there are to read DA values. are DA and AE very different when it comes to read values?

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

Moderators: support
Time to create page: 0.045 seconds