From OpenSCADAWiki
Jump to: navigation, search

The registration of violations is best done on the side of the typed data source templates, through the special function SYS.DAQ["Module"]["Controller"].alarmSet(string mess, int lev = -5, string prm = "", bool force = false) or its parameter-space variant SYS.DAQ["Modul"]["Controller"]["Parameter"].alarmSet(string mess, int lev = -5, bool force = false), which unifies the category. To call this functions from the context of the template you need to add the IO "this" of the type "Object", and then the setting of the violation will have a look this.alarmSet("Parameter: Violation", -5);. The specified function is currently used in many data source modules to account for global violations of the controller objects. The function provides control for the toggling of the messages passing to the message buffer, so you may safely re-generate and clean up violations with this functions, without flooding the archive messages and what may be useful for the periodic actualization of the violation state.