Post by Admin on Apr 7, 2021 17:01:27 GMT
The CODESYS Alarm Manager is designed for the task-based programming technique where the alarms are created separately from the control design as a post-process after the control design is complete. If the control design is changed or enhanced, the alarm lists must be modified as well. The is a tedious and error-prone process.
Fortunately, there is a way to adapt the CODESYS Alarm Manager to better support Object Oriented design and continue to use the features of the CODESYS Alarm Classifications, Alarm Archiving, and Alarm Visualizations. Object oriented alarms are added to a Function Block as follows:
1. Have the FB Implement OOA.OOPAlarmInterface (see line 1 of Pump)
2. Implement the interfaces on that FB (right-click Implement Interfaces)
3. Create an instance of OOA.AlarmTriggerStruct for each alarm required (see line 9 of Pump)
4. In the RegisterMyAlarms method, make a call to the methods to register the alarms as shown in the graphic (note 1).
Object oriented alarms are added to the Application as follows:
1. Add an Alarm Manager and Three Alarm Groups as shown in the graphic.
2. Import the Alarm Group templates into the OOPErrorGroup, OOPInfoGroup, and OOPWarnGroup
3. Add the Object Oriented Alarming library to the library manger
These alarms can now be programmed into the logic for the FB. The alarms in every instance of the Function Block will be automatically added to the Alarm Manager. No post-processing or maintaining of lists is required.
Note 1: The Alarm Message may be one-time-programmed when the alarm is registered (see lines 2 to 4 of the implementation area of Pump.RegisterMyAlarms). Or, Messages may be dynamically generated for each alarm (useful when live data needs to be included in the alarm message).
Once the object-oriented alarms are declared and registered as shown on the previous page, the Alarm method can be called to set or reset those alarms. The instance of the AlarmTriggerStruct is passed to the Alarm method as shown (HHTempAlrm). The alarms will then appear in the Visualization Alarm Table and Alarm Banner. No further effort is required.
Follow this link for a demo version of the library (limited to 12 alarms): OOA Demo Program
The unlimited Object Oriented Alarming library is available from ControlSphere (gary@controlsphere.pro).
Note: July 2021 Alarm Rollups (aka Alarm Summary) have been added to the library. This allows each alarm to be assigned to a group, and then the group can be queried to see if any alarm in that group is active.