ngoodman Posted August 20, 2010 Share Posted August 20, 2010 Hi I have a system with around 500 channels some OPC some modbus some internally generated and some as variables which I need to log any alarms. The program slowed so I tried the sequence from the manual to slow the alarms which has worked but It gives repeat logs for acknowledged alarms any ideas. The program is very large and contains a lot of email and other data so I have not posted it here. regards Nigel sequence while(1) Alarm.Paused = 1 delay(120) Alarm.Paused = 0 Alarm.CheckAlarms() lastalarm.AddValue(alarm.strLatestAlarm) if(Alarm.FiredCountTotal[0]>=1) activealarm.AddValue(1) endif endwhile Link to comment Share on other sites More sharing options...
AzeoTech Posted August 20, 2010 Share Posted August 20, 2010 Not quite sure, but looking at your code you should leave alarm.paused = 1 outside the loop. Pause it and leave it paused, then every 120 seconds call alarm.checkAlarms(). Link to comment Share on other sites More sharing options...
ngoodman Posted August 20, 2010 Author Share Posted August 20, 2010 OK will give it a try Link to comment Share on other sites More sharing options...
ngoodman Posted August 20, 2010 Author Share Posted August 20, 2010 No did not work - it went mad CPU usage went to 100% and OPC server fell over! any ideas? Link to comment Share on other sites More sharing options...
AzeoTech Posted August 20, 2010 Share Posted August 20, 2010 what exactly did you do? Paste your new script Link to comment Share on other sites More sharing options...
ngoodman Posted August 20, 2010 Author Share Posted August 20, 2010 Alarm.Paused = 1 while(1) //Alarm.Paused = 1 delay(120) Alarm.Paused = 0 Alarm.CheckAlarms() lastalarm.AddValue(alarm.strLatestAlarm) if(Alarm.FiredCountTotal[0]>=1) activealarm.AddValue(1) endif endwhile This went mad, I think it was because of the alarm paused =0 line Have tried this now Alarm.Paused = 1 while(1) //Alarm.Paused = 1 delay(120) //Alarm.Paused = 0 Alarm.CheckAlarms() lastalarm.AddValue(alarm.strLatestAlarm) if(Alarm.FiredCountTotal[0]>=1) activealarm.AddValue(1) endif endwhile this still throws up the error. for example if a machine is switched off or is is warming up all the heater zones will be outside the set points and so will alarm. this works ok BUT there will always be one or more that will realarm after being acknowledged and generate another log entry. another weird one is an alarm that realarms and shows its status as reset at exactly the same time. its just the waste of log file space that is the real issue - any ideas? sample from log file TheTime Name Description Priority Status 20/08/2010 15:49:00 B4tz5ot B4 tool Zone 5 over temperature 3 R 20/08/2010 15:49:00 B4tz5ot B4 tool Zone 5 over temperature 3 F 20/08/2010 15:49:00 B4tz5ot B4 tool Zone 5 over temperature 3 R 20/08/2010 15:49:00 B4tz5ot B4 tool Zone 5 over temperature 3 F 20/08/2010 15:49:00 B4tz5ot B4 tool Zone 5 over temperature 3 R 20/08/2010 15:49:00 B4tz5ot B4 tool Zone 5 over temperature 3 F 20/08/2010 15:49:00 B4tz5ot B4 tool Zone 5 over temperature 3 R note continual fire and reset ??????????? Link to comment Share on other sites More sharing options...
AzeoTech Posted August 20, 2010 Share Posted August 20, 2010 You don't want the paused=0 line. This will simply unpause it, and you want auto processing of alarms paused permanently since you are triggering the processing in your own sequence. As for dups, what are the fired and reset criteria for the alarm? Do you have any hysteresis? Link to comment Share on other sites More sharing options...
ngoodman Posted August 23, 2010 Author Share Posted August 23, 2010 Hi found the problem! trigger point B4TZ5PV[0]>B4tz5sp[0]+10 (pv = process variable sp = setpoint etc) reset should have been B4TZ5PV[0]=b4tz5sp[0] but was B4TZ5PV[0]=b4tz5pv[0] hence the duplicates!!!!!! the alarm will be continually setting and resetting - this program is only a year old!!!!!!!!!!! thanks for your help Nigel Link to comment Share on other sites More sharing options...
AzeoTech Posted August 23, 2010 Share Posted August 23, 2010 Two things: 1) its == for comparison, not = 2) be careful about using == with analog values. With discrete its fine because its always either exactly 1 or exactly 0, but with analog, the value might be 14.002 instead of exactly 14. Maybe this isn't the case here, but be aware. Link to comment Share on other sites More sharing options...
ngoodman Posted August 24, 2010 Author Share Posted August 24, 2010 Yes thank for that in the actual program it is <= as the operator I left the < out for clarity - point taken will be aware of this in the future. checked the alarm log this morning has solved the problem - I am wondering if this was causing some of the other problems I have had with this program like OPC connection problems and random crashes. Time will tell ! Thanks again for your help Nigel Link to comment Share on other sites More sharing options...
ngoodman Posted September 15, 2010 Author Share Posted September 15, 2010 Just as a final follow up finding and eliminating the rogue alarm reset point has eliminated a lot no other random problems like OPC connection, random disconnection and program quitting. there have been no error messages for a week so this was a real issue - but largely hidden apart from in a log file. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.