TagsDBSetAlarm

This function sets the properties of an alarm condition during run time.

Function Group Execution Windows Embedded Thin Client Mobile Access
TagsDBSetAlarm Tags Database Synchronous Supported (see “Notes” below) Not supported Not supported Not supported

Syntax

  TagsDBSetAlarm( strTagName, numAlarmType, numProperty, strOrNumVal )  
Web Studio Help tions tagsdb tagsdbsetalarm.xml d445093e126 TagsDBSetAlarm

strTagName
The name of the project tag on which the alarm condition will be set.
numAlarmType
The type of alarm condition to be set, identified by one of the following values:
Value Alarm Type
1 HiHi
2 Hi
4 Lo
8 LoLo
16 Rate
32 DeviationP
64 DeviationM
Tip: To set tag properties on project tags, use the function TagsDBSetTagProperty.
numProperty
The specific property of the alarm condition to be set, identified by one of the following values:
Value Property Data Type
0 Limit value Real
1 Message String
2 Alarm group (or worksheet) number Integer
3 Priority Integer
4 Selection String
5 to 14 Custom field String
strOrNumVal
The value to set to the specified property. The value must be of the appropriate data type.

Returned value

This function returns one of the following possible values:
Value Description
-4 Project tag (as specified by strTagName) does not exist.
-3 Wrong parameter type or inconsistent value.
-2 Invalid number of parameters.
-1 The function TagsDBBeginEdit was not executed successfully before this function was called.
0 Function executed successfully.

Notes

The following restrictions apply to the execution of this function:
  • The function can only be executed on the project server — it cannot be called by a Graphics Script, Screen Script, or Command animation running on a project client;
  • The function TagsDBBeginEdit must have been executed previously, in order to lock the tags database for editing; and
  • The function TagsDBEndEdit must be executed when the editing is finished, in order to release the tags database and resume normal run-time operations.

For more information about the Tags Database functions and examples of how to use them, see Edit the tags database during run time.

Note: A specific alarm condition, as defined by the tag name and the alarm type (e.g., the HiHi alarm on MyTag1), can be in only one alarm group at a time. Therefore, when you assign an alarm condition to an alarm group, it will be removed automatically from its previous group, if any.

Also, make sure that an alarm group with the correct group/worksheet number actually exists before you try to assign an alarm condition to it.

TagsDBSetAlarm