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