From OpenSCADAWiki
Jump to: navigation, search

Messages registration is best done on the side of the typified data source templates by a special function SYS.DAQ["Modul"]["Controller"].alarmSet(string mess, int lev = -5, string prm = ""), which unifies the category. To call this function from the context of the template you need to add "this" IO of the "Object" type, then the set of the alarm would be of the following form
this.cntr().alarmSet("Parameter: alarm", -5, "prm");. This function is now used in many data sources modules to account the global alarms of the controllers objects. The function creates the alarm with the category: al{ModId}:{CntrId}[.{PrmId}], where:

  • ModId — module's ID;
  • CntrId — controller's ID;
  • PrmId — parameter's ID from the prm argument.