Add Alarms to Custom Tags

The VTScada Alarm tag can monitor the value of any other tag that is a member of the group Numerics and that has a Value variable. Provided that your custom tag has these two features, it can be used to trigger an alarm.

You must ensure that when the application starts, your tag waits for the VTScada AlarmManager to start. This is commonly done in the tag's initialization state, along with ensuring that the expression manager has started: (Relevant code in bold.)

CustomTypeInit [
  If \AlarmManager\Started && \ExpressionManager\Started CustomTypeMain;
  [
    CriticalSection(
      Root = Self
      Refresh();
    );
  ]
]

No additional code is necessary, however you may choose to add two more features:

  • You may choose to make your custom tag aware of the Alarm tags that use it as a trigger. See: Alarm Containers.
  • You may choose to provide built-in alarm configuration for your tag. See:Build Alarms Into a Tag.

 

Reasons for doing so include:

  • Custom widgets for your tag may need to display the current alarm state.
  • Your tag may be a contributor to another tag and should therefore pass its alarm state to that owner.
  • You may choose to display a list of attached alarm tags in your custom tag's configuration panel.