Sign in to follow this  
Followers 0
JohnDruzianic

Programming Alarms

2 posts in this topic

I have two techniques for programming alarms which require an alarm_active output and a new_alarm output. The alarm_active output is on if any alarm is active. This output can drive a light. The new_alarm output is on whenever an alarm first occurs. The output stays on, even if the alarm becomes inactive, until it is acknowledged. The new_alarm output can drive a siren or a pager. There is an alarm_now bit for every condition (e.g. a proximity switch continues to indicate that a valve is not closed for a certain time while the controller has energized the output to close the valve). A file contains all the alarm_now bits. The alarm_before file contains the alarm_now bits from the previous scan. The first technique is clever, efficient, but hard to understand because it uses file based instructions to generate the new_alarm output. On every program scan the alarm_now file is exclusive-or compared with the alarm_before file. The results of the comparison are in a file which can be called xor_alarm_now_before. Then it is necessary to isolate alarms that have just occurred from alarms that have gone away. This is achieved by anding the xor_alarm_now_before file with the alarm_now file. The result is a file which can be called the alarm_new file. It contains a 1 for every new alarm that has appeared during the current program scan. The alarm_new file can trigger the new_alarm output if the file contains a 1. Finally the alarm_now file is copied into the alarm_before file and the system is ready to respond to another new alarm. This technique can cause insanity to someone trying sort out a problem at two in the morning. Finally, to ensure that there are no new alarms when the Controller first powers up, the alarm_now file is copied into the alarm_before file on the first program scan. The second technique is less clever, consumes more program memory but is easy to understand because the logic is obvious and not buried in file based instructions. For every alarm condition as represented by an alarm_now bit, we have a statement that that is executed every program scan that says If alarm_now AND NOT alarm_before Then Alarm_new The alarm_now, alarm_before and alarm_new bits can still reside in a file but the essential difference is the use of the above statement for each alarm condition. The above statement does all the work for an alarm condition that is achieved by the file logic in the first technique. Alarm_new is true for the first scan that alarm_now is true until the alarm_now file is copied into the alarm_before file. Also, to ensure that there are no new alarms when the Controller first powers up, the alarm_now file is copied into the alarm_before file on the first program scan.

Share this post


Link to post
Share on other sites
Nice idea John for where the HMI does not have an alarm logging - alarm history feature.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0