Is there a way to programmatically access elements in an Alarm List (like Condition) , using scripting or OPC ?I
Voted best answer
There are three methods to read alarm state via OPC DA:
1) Alarm Global Properties
2) Alarm List properties
3) Alarm Condition properties
To see what properties are available, right click any object, select Details... then Property View and tick the Subscribe for live data check box at the bottom of the window (the image below has been edited to show alarm information properties only):
#1, Alarm Global Properties (yellow) are default and exists on all objects. Values are SUMMARY VALUES for all alarms on the object or its descendants (if _Descendants is subscribed).
#2 Alarm List Properties (red) are also default, but only on objects having an alarm list. Values are FILTERED VALUES based on the currently configured alarm list filtered. These (red) properties are several times slower than the previous (yellow) since they involve filtering. Process Graphics shall primarily not subscribe to filtered alarm values since it will cause the graphics to open slower than if alarm global properties were used.
#3 Alarm Condition Properties (green) need manual creation of Alarm Condition aspect (which do supports to be inherited from an object type). Manual configuration might be required since the Alarm Condition aspect can only display currently existing alarm conditions, or alarm conditions previously seen since last aspect server boot time. So far not triggered alarm conditions will not be listed unless OPC AE server support the OPC Query Conditions interface. Not all do. With manual configuration, any (so far now seen alarm condition) can be made visible as OPC DA properties. As with #2, #3 are slower than #1. Use with caution in Process Graphics.
All these alarm conditions reflect current state and are immediately updated if alarm state changes.
When an alarm returns to normal and becomes acknowledged it leaves the alarm list and all depending conditions will return to their idle values.
An Event List can show old alarms (default 10.000 per alarm category, but can be increased to 50.000 per category - seek for other threads on this forum to see how) but it can not deliver any OPC DA information.
I'm not sure what kind of application you are developing and what needs you have?
Maybe an IM OPC Message Log (which can contain up to 12.000.000 events) can be the source of information you need? The IM message log can be queried from VB and/or SQL and you can have your application to read one particular object's alarm history and take actions as needed.
Note 1: An IM message log is typically 1 to 2 minutes behind real time.
Note 2: Queries with complex filter statements may require additional indexes to be created since the factory default indexes does not permit searching for much more than object and time. Filtering on not indexed data causes the database to resort to "Full Table Scans" which have a drastic negative effect on a query's performance.
Sort of, but not really, and probably there is no way to do what you are asking for.
Alarms and Events are text messages that are sent from the controller to an OPC-AE server. This is quite different from the normal OPC-DA that most people refer to as "OPC".
The OPC-AE server then keeps track of these messages and the alarm "state". The OPC-AE server and controller should normally remain synchronised at all times, but can be re-synchronized using a refresh.
Alarm Lists in 800xA are simply filtered lists of messages stored in the OPC-AE server. The OPC-DA server in 800xA does expose some additional information about the alarm state of an object and a list, but not details of any of the messages in the list. You can read this OPC-DA data using the Object Automation model of 800xA, but again not the alarm mesages or contents of the lists, as these are OPC-AE messages.
To get access to the messages, you need to use a third party OPC-AE client.
An OPC AE server supporting the OPC AE IOPCEventServer::QuerySourceConditions() interface like the OPC Server for AC800M enables the "Load" button to retrieve a list of alarm conditions for a given object.
Without QuerySourceConditions() the condition names must be entered manually using the "Add" button, however, since the aspect can be made to be inherited, the effort is only required once per object type.