In this blog, I will walk through the built-in options for alarm acknowledgment in WinCC Comfort and Advanced and give example situations in which you might choose different ones.
Creating an Alarm
The first thing we need to do is create an alarm in WinCC. This is done through the "HMI Alarms" editor in TIA Portal. WinCC accesses all alarms by specifying a bit address in an HMI tag. This means you can group alarms in a couple of ways:
1. Add all alarms to an unoptimized data block as Booleans, then create a single HMI tag that is a word array with the same length as the block
Data block - Unoptimized
HMI tag - this is an array of word with the appropriate size
Alarms – this is a link to the correct address of the relevant alarm
2. Group alarms into other data types, such as Word, DWord, Dint, etc.
DMC developed the Siemens Open Library, which has a function that automatically will combine 16 bits into a word
Move alarms into the bits of the alarm word
Each alarm corresponds to a bit in the word
Option one can be effective when you're creating alarms for a large number of devices. The Siemens Open Library includes a windows application that will automatically generate a list of alarms from an unoptimized db that can be directly imported into the alarm editor. This eliminates the hassle of having to create each of the alarms individually. Option two can be useful when you want to group alarms by device or subsystem. Each word can correspond to a specific device, which can be useful for checking device state on the PLC or displaying it on the HMI.
Local Acknowledgement on HMI
If you do no other configuration, the default acknowledgment setup is that all information about alarm state/acknowledgment is stored locally on the HMI. There are a few possible states for an alarm:
- An alarm condition is present; no acknowledgment has occurred
- An alarm condition is present; acknowledgment has occurred
- Alarm condition was present, then went away before the alarm was acknowledged
Alarm display colors
Using the Alarms group tab of the editor, you can customize colors and display information for each of these acknowledgment states. Important note: you must enable colors in runtime settings or they will not be displayed.
By default, each alarm must be acknowledged individually. To change this, assign the alarms to groups in the alarm editor. Acknowledging one alarm in the group will acknowledge all the other alarms in that group as well.
There are two ways to acknowledge alarms. The first is using the button built into the alarm viewer. The other way is by configuring a custom button with the “AlarmViewAcknoweldgeAlarm” event.
HMI Acknowledgement Bit – Pass Acknowledgment Information from HMI to PLC
The HMI acknowledgment word is used to pass the acknowledgment status of an alarm from the HMI to the PLC. It must be a bit in a tag that is different than the alarm’s trigger tag. When acknowledgment of the alarm occurs on the HMI, the bit on the PLC is set to one. It will stay high until the alarm condition goes away, then occurs again. A diagram displays this below:
This bit is useful if you want to use the acknowledgment status as a pre-requisite for clearing the alarm condition on the PLC.
Multiple HMI Considerations
If multiple HMIs are part of the project, and each has a separate alarm viewer, any of the HMIs can acknowledge the alarm and set the HMI Acknowledgment bit. However, this information is stored locally on each HMI - the acknowledgement is not passed to the other HMIs. This disparity in information means that if one HMI acknowledges an alarm, it will still display as unacknowledged on a different HMI until is is also acknowledged there.
PLC Acknowledgment Bit – Pass Acknowledgement Information from PLC to HMI
The PLC acknowledgment bit is used to acknowledge alarms by passing down a bit from the PLC. When you set the bit on the PLC, the acknowledgement status of the associated alarm is upated on the HMI. This is useful as it allows multiple HMIs to keep their alarm acknowledgments in sync. A single PLC tag/bit is used as the PLC acknowledgement bit on all the HMIs, so each of them recieves acknowledgements in sync.
One disadvantage of this approach is that it makes individual alarm acknowledgment, that is the ability to choose which alarm is going to be acknowledged by highlighting it in the alarm viewer, more difficult. When using the built-in acknowledgment in the alarm viewer (as you must with the HMI ack bit), a user can highlight/select a specific alarm to acknowledge.
However, there is no way to tell the PLC which alarm is currently highlighted, which prevents individual acknowledgement via PLC. Generally, when using this acknowledgment scheme, we have used a global alarm acknowledge button that automatically acknowledges all available alarms. Alternatively, we've grouped the alarms by system, and had a separate acknowledgement button for each system.
Important note: the acknowldgement bit must stay high long enough for the HMI to see it. We will normally pulse it on for a short duration (e.g. 1 second if the HMI tag update rate is 1s). This ensures each of the HMIs has time to see the tag's value change.
The PLC acknowledgment bit is required to be in the same tag as the actual alarm bit. We have a couple of approaches to get around handle this:
Approach 1: Unoptimized db with Structs
The first way is to create an unoptimized db with all alarm conditions at the top, and an identical structure at the bottom for alarm acknowledgment.
You can then access this db as an array of words on the HMI, as discussed above. To configure the acknowledgment, use the bit in the first structure as the alarm bit, and the bit in the second structure as the plc acknowledgment bit. Then, set the plc acknowledgment bit high on the PLC to globally acknowledge the alarm on all HMIs.
Approach 2: Alarm Word
Another approach is to use Words for your alarms and keep them in a normal db. In this case, we generally group alarms by system or device, and use the first half of the word for the alarm conditions and the second half of the word for acknowledgments:
Overall, WinCC Comfort and Advanced give you several options for alarm acknowledgment. I hope this blog helps you implement it in your project!
Learn more about DMC's WinCC Expertise and contact us today to get started on your next project.