Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Scripting_function



Panel
titleDescription

Returns an array of alarm definitions for a specific tag.


Panel
titleClient Permission Restrictions

This scripting function has no Client Permission restrictions.


Panel
titleSyntax

system.tag.getAlarmStates(tagPath)

  • Parameters

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


Info

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.



Panel
titleCode Examples


Code Block
languagepy
titleCode Snippet
# 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