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.

OPC Alarms&Events (examples)

More
05 Oct 2012 06:16 #1041 by support
Amended:
To clarify the point about how the acknwledgement cookie can be obtained: The cookie is only available in event notifications. If the client does not have the cookie available, it can "force" the event notification to be generated, by using a "refresh" (RefreshEvents method on EasyAEClient).

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

More
14 Jun 2012 07:47 #890 by support
Hello,
Thanks for the information.

I think there are two areas that need to be looked at:

1) What you are trying to do, i.e. acknowledge a condition that has already become active again, or acknowledge an alarm for which you do not have the corresponding notification (i.e. has existed before the client has started), is not supported in OPC Alarms and Events. More details about it further below.

2) Still, the errors that you are receiving do not appear correct. I will therefore try to reproduce the behavior and see where the problem is.


Regarding 1): The only way to acknowledge an alarm in OPC-A&E is by IOPCEventServer::AckCondition function. The alarm needs to be identified by *all* following data:
- Event source
- Condition name
- Active time
- Cookie

Quoting from the specification: “If the condition has become active again or transitioned into a different sub-condition at a later time, this acknowledgment will be ignored. “(so, it should not be an error, and as I said already, so I will look at it, but it may be an issue with the OPC Server). So, your scenario “When a condition appears and disappears twice…” does not really allow acknowledging the past alarms, per OPC Spec. Whether the acknowledgement is ignored (as it should), or gives an error, is a separate issue.

The other problem is with the “cookie” parameter. Quoting OPC spec again, the cookie “uniquely identifies a specific event notification. “. The only way to get a cookie from the server is by receiving a notification about the alarm. It cannot, unfortunately, be obtained e.g. by retrieving a current condition state. For this reason, if nobody is listening to the OPC-A&E Server, and the cookies of active alarms are not available, you cannot acknowledge those alarms. This should become suspicious to you already, because in the case of pre-existing alarm, you do not have anything reasonable to fill in for the ‘cookie’ argument in the EasyAEClient.AcknowledgeCondition method.

[.....]

Best regards,
Zbynek Zahradnik, OPC Labs

From: V.
Sent: Wednesday, June 13, 2012 5:47 PM
To: Zbynek Zahradnik
Subject: RE: OPC Alarms&Events

Hi again,

I have found another case where I am not able to ack an alarm.
When a condition appears and disappears twice, the HMI using AE Client is designed to show two alarms in a gridview. All properties of the alarm event is stored in an object list (ActiveTime, cookie, etc…) and used at the time the user acknowledge the corresponding alarm.
I am able to ack the second alarm without problem but with the first occurrence, I got the same error as explained in my last post.

And another error found but not able to reproduce :

FatalExecutionEngineError a été détecté
Message: Le runtime a rencontré une erreur irrécupérable. L'adresse de l'erreur était 0x67235c50 sur le thread 0x9f0. Le code d'erreur est 0xc0000005. Il s'agit peut-être d'un bogue dans le CLR ou dans les portions unsafe ou non vérifiables du code utilisateur. Les causes courantes de ce bogue incluent des erreurs de marshaling utilisateur pour COM-Interop ou PInvoke, erreurs susceptibles d'endommager la pile.

Thanks for helping me.


V.


De : V.
Envoyé : mercredi 13 juin 2012 17:17
À : 'Zbynek Zahradnik'
Objet : RE: OPC Alarms&Events

Hi,

I have got to make it work quite well.
One problem that I don't understand is an error throwed when I try to acknowledge alarms already active when the AE client is started.
I have made a screen shot but I have no more to give you.
The OPC servers DA et AE are from ICONICS Genesis.

Once started all alarms fired after are acknowledge without error.

Thanks
1.png

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

More
03 Jun 2012 09:54 #880 by support
Hello.
OPC Alarms&Events is fully supported in QuickOPC.NET, but you are right that most examples deal with OPC Data Access. Still, there are examples available to get you started. Please find and open the Examples -> Visual C# Examples .... solution under the QuickOPC.NET in your Start menu. In this solution, there is a project called DocExamples. It contains simple examples for the main functions in the component, including A&E. In addition, there are other projects in this solution that demonstrate OPC A&E:

ConsoleEvents: Hooking up events and receiving OPC item changes in a console application.
XmlEventLogger: Logs OPC Alarms and Events notifications into an XML file.

The starting point in the reference documentation is the OpcLabs.EasOpc.AlarmsAndEvents namespace, and in it, the EasyAEClient object.
If you want to implement a specific functionality but cannot locate how to do it, please explain your needs and I will point towards the right place, or create an example for it. I can also prepare examples in different languages (such as Visual Basic) if needed.
Best regards

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

More
03 Jun 2012 09:38 #879 by support
From: .....
Sent: Friday, June 01, 2012 5:47 PM
To: Zbynek Zahradnik
Subject: OPC Alarms&Events

Hello,
I have downloaded QuickOPC for .net.
I have not found OPCAE client examples.
Documentation stays that there is an interface.

Thanks

V.

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

Moderators: support
Time to create page: 0.047 seconds