how to configure alarm in codesys
For Configuration Of Alarm First Make a simple project.. If You New In Codesys Click On The link So You Can Understand How To Make A Simple Project In Codesys.
after making a project make some logic of your program. i am adding a simple logic of timer.
after making a ladder logic i am going to create Visualization of for making of Visualization in codesys got this link.
here i am adding a "dip switch" for starting timer and "lamp" to show when timer done bit is true.
Add alarm configuration in codesys project
after making ladder logic, and visualization next to define alarm configuration for project. for this Select an application in the device tree and than Add Object > Alarm configuration.
The Add Alarm Configuration dialog opens. click the Add button.
alarm management is created with classes Error, Info, and Warning and the AlarmStorage below the alarm configuration.
Configuring an alarm class in codesys alarm
after creating alarm management next step to configure alarm classes for this we three class
alarm class is a properties of an alarm. these includes the priority and whether an archiving should take place.
- Error class.
- info class.
- warning class.
first i am configure error class for this select application > Alarm Configuration > error class. double click on error class to configure
parameter a window will open for configuration of class same apply for all classes.
define following parameter for your alarm class.
Priority
Specification of the priority of the alarms in this class (0–255).
The priority describes the priority of the alarm condition. 0 represents the highest priority, 255 the lowest.
Archiving
when you select this parameter The alarms of this class are recorded. To do this you have to create an Alarm Storage object.
Acknowledgment method
define this property for insured user to acknowledge the alarm in order for the alarm to be removed from the alarm list.
- REP: Alarm inactive after rectification.
- ACK: Alarm inactive after acknowledgment.
- REP_ACK: Alarm inactive after rectification of the cause and acknowledgment.
- ACK_REP: Alarm inactive after acknowledgment and rectification of the cause
- ACK_REP_ACK: Inactive after optional acknowledgment that the alarm was received, rectification of the cause and acknowledgment that the alarm situation was ended.
Acknowledge separately
when you select so In runtime mode, the user cannot acknowledge the alarm together with other alarms, but must acknowledge it separately. This prevents the user from inadvertently acknowledging an alarm together with other alarms.
Display Options for Alarm Table/Alarm Banner
Configures how the individual statuses of an alarm are displayed in the alarm visualization element (alarm table, alarm banner).
- Status: status depend on the selected Acknowledgment method.
- Font: select font, font-family, color etc for your alarm.
- Background color: background color for your alarm
- Bitmap: add a bitmap or image.
- Transparent: Activate this option if the bitmap has a transparent color.
- Transparent color: Color that is to be displayed transparently.
so i am configure all these class look like below image
info class
warning class
add a alarm group in alarm
alarm is structur of alarm to how and when alarm show in the table. In the editor of the alarm group object,
you define the individual alarms of the group with their properties in a table. Each alarm belongs to exactly one alarm group.
for adding alarm group goto alarm configuration > add object > alarm group.
after add an alarm group open alarm group and add parameter,variable and statement of alarm.
Text List
Name of the text list where the alarm message text is saved. "codesys automatic generated if not available."
Archiving
Selection of the alarm storage object for the alarm group. When you specify an alarm storage object, CODESYS activates the alarm storage.
Deactivation
Boolean variable that deactivates all alarms in this group. CODESYS does not trigger these alarms any longer, even if the alarm condition is fulfilled. Alarms that are already active are not affected by this.
Table of alarms
individual alarms properties of variable in the corresponding table columns.
ID:
it is unique ID to associated text list. if change the ID in the ID field of the table the alarm table also directly causes a change in the text list.
Observation Type:
this field of table defines the condition of the alarm trigger.
Details:
in this field you set the conditional settings of variable.
Deactivation:
set the Variable for deactivating the alarm.
Class:
set the alarm class which you defined(error,info,warning).
Message:
set the message of an alarm. this message show when your alarm is triggered.
add alarm table in visualization
after settings all the parameter go to visualization and add alarm table by selecting from toolbox.open visualization and add alarm table form alarm manager
after adding all the parameter and settings run your project. as per logic and ladder logic you see when timer is not running a alarm
table display an error message "start your timer" when we made dipswitch off to on timer start running when value of timer_value value
is in between 1 to 6 alarm message display an warning alarm to "timer value is to low". when value between 7 to 16 info alarm triggered with message
"timer value is ok". when value is greater than 17 error message triggered. so these are basic function of alarm management in codesys
we discuss in more details like database of alarm and data logging in next article.