system.tag.getAlarmStates
This function is used in Python Scripting.
Description
Returns an array of alarm definitions for a specific tag.
Client Permission Restrictions
This scripting function has no Client Permission restrictions.
Syntax
system.tag.getAlarmStates(tagPath)
Parameters
Type | Parameter | Description |
---|---|---|
String | tagPath | The full path to the tag. Note: you can specify the tag provider name in square brackets at the beginning of the parentPath string. Example: [myTagProvider]MyTagsFolder . If the tag provider name is left off then the project default provider will be used. |
Returns
TagAlarmDefinition[] - An array of TagAlarmDefinition.
Scope
All
note
The properties on the alarm definitions returned by this function do not list what are considered "default" properties; calling getAlarmProperties on an alarm with a Low priority will not return the priority property of the alarm, but if the priority is changed to Medium, then the priority property would be returned. See the Tag Properties page for a full list of properties.
Code Examples
Example #1
# Get the alarm configuration for a tag. The prop.type represents whether the
# value is static, bound to an expression, or bound to a UDT parameter
tagDefs = system.tag.getAlarmStates("TagAlarm")
for tagDef in tagDefs:
print tagDef.alarm
for prop in tagDef.getAlarmProperties():
print prop.property, prop.type, prop.value