atomic361 Posted April 30, 2013 Share Posted April 30, 2013 Hello, Could you show me an example how to Alarm a channel after a set time period i.e 15 minutes. Thats if the channel rises above a set point for the set time period Many thanks, Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted April 30, 2013 Share Posted April 30, 2013 You mean the channel stays above the threshold for a full 15 minutes? The Alarm expression would be: min(myChannel[systime(), systime() - 900]) > setpoint change myChannel to your channel name, 900 to the time width (15 mins), and setpoint to your setpoint. If you wanted to alarm in reverse (i.e. staying lower than the setpoint), you'd change the > to < and the min() to max(). Note that when you first start DAQFactory, if the channel is already above the setpoint, the alarm will trigger immediately. Quote Link to comment Share on other sites More sharing options...
Daggos Posted October 7, 2021 Share Posted October 7, 2021 Hi, Is there a way to make it not alarm on DAQFactory start. I have DaqFactory process restart schedule and sometimes one startup it alarms why say a pump is off waiting for water. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted October 8, 2021 Share Posted October 8, 2021 There are lots of ways. First, you can always do Alarm.paused = 1 to stop DAQFactory from processing alarms. In fact, this is a good thing if you have lots of alarms. Set paused to 1, then use alarm.checkAlarms() to trigger alarm checking from a simple sequence. This is more efficient. Alternatively, you can modify all your alarm expressions and add: && !isempty(alarmsStarted) to the end, so it might be: pressure[0] > 100 && !isempty(alarmsStarted) Then, just declare alarmsStarted when you are ready for DAQFactory to start processing alarms: global alarmsStarted = 1 There are plenty of other ways too. Quote Link to comment Share on other sites More sharing options...
Daggos Posted October 8, 2021 Share Posted October 8, 2021 Thanks for your reply i will test the alarm.paused but will that not just delay the alarm going off when you set alarm.paused back to 0 My alarm is for a pump min(TestBit(miri_16_Digital_in,7)[systime(), systime() - 60]) > 0 So if its off for 60 secs then alarm. Once i unpause will the alarms wait the full 60 secs? Quote Link to comment Share on other sites More sharing options...
Daggos Posted October 8, 2021 Share Posted October 8, 2021 Ok after testing this seems to be working such an easy fix, thanks. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted October 8, 2021 Share Posted October 8, 2021 The pause variable affects when the alarms are processed, so unpausing the alarms will not cause an additional 60 second delay in your case, since you are using the system time as your reference point. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.