Features, discussions, tips, tricks, questions, problems and feedback

How to open alarm graphic form when any alarm occurs via script

Note that this is only one of many possible solutions to this.

Let’s consider a case, where we have MainForm graphic form which is open all the time when operator runs (i.e. on this screen we have main menu with Template Graphic Objects).
We want to have a pop-up screen with alarm list every time, when new active alarm will occur.

  1. Create MainForm on which code will be executed.
  2. Draw element “timer” on it from toolbox category “Windows Form”. Set it’s tick time - this is how often we will check for new active alarms. Change it’s property to “Enable”
  3. Connect slot from Your Alarm Agent named “numAlarmsActive” to Your Graphic Form property “Tag”. The easiest way is just to drag/drop this element on graphic form:
  4. In attachement You will find Graphic Form with code snippet which will check every 5 seconds does no. of active alarms changed and if it increased, then it will trigger opening another graphic form named “AlarmForm” in project “ProjectName” which has alarm control on it. Also, You can find preconfigured AlarmForm Graphic Form in it.

AlarmForms.zip (19.0 KB)

1 Like