Onscreen Messagebox When Alarm Fires


dmdodd

Recommended Posts

I have DF Pro, and therefore alarming functions.

While we have lots of alarms set-up that work very well and have the odd LED that flashes, I would love to be able to display a messagebox to screen every time an alarm fires to ensure the user gets the message.

I noted the Help File's advice about being careful with messageboxes and delay() etc, as they may continue to display messageboxes to screen lots of times, but I'm not even getting it to print anything to screen.

I had originally written the following code and placed it within the "Fire Event" for that alarm so as soon as it fires it should run this code:

if(!Alarm.AL_PT_700_3_MINP.Acked)

system.MessageBox("Propane Bottle -- EMPTY! Follow Procedure ASAP")

else

endif

But nothing displays to screen. I don't see any major errors with the code.

Thanks in advance,

Daniel

Link to comment
Share on other sites

Yeah, you really don't want to do that. Trust me. If you want to display a popup, don't use a box that has to be dismissed and a command that will create continual boxes. Instead consider using popupModeless() to popup a Page you design that displays your messages. Then, if an alarm fires, resets, then fires again, or more than one fire, they can display the message in the popup, but only show one popup for all the messages. You could also then add some options to disable the popup or other things so your user's don't get stuck in a popup loop.

Link to comment
Share on other sites

Is there an example of this "popupModeless()" and how to only show one message per time in the Example files?

If not, perhaps you could make a really quick and easy example and post?

I'm kinda lost as to your thinking.... I.e. I make a huge page full of alarms and LEDs, and then just pop-up that everytime one fires??

Thanks in advance,

Dan

Link to comment
Share on other sites

There is not an example because its pretty simple. I would create a page that has a table component that displays the contents of a string array with all the messages. You really don't want it popping up individually for every message. If you something goes way wrong triggering a bunch of alarms, your operator will have to dismiss a bunch of popups. Its only marginally better than a regular modal popup then.

Anyhow, I've attached a sample. It requires the latest DF and a non-Express license (due to the table). I didn't wire it to alarms, you can just use the event for the buttons as a template for the alarm Fire events. Note that since its modeless, you can keep clicking the buttons to add more alarms without dismissing the popup. Note also that I have the noclose option set on the popup, so you can only close the popup with the dismiss button (make sure not to delete this button). The dismiss button also clears out the alarm messages.

alarmPopup.ctl

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.