Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


GLOSSARY


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL MANUAL VERSIONS

Ignition 8
Ignition 7.9
Ignition 7.8

Deprecated Pages

Skip to end of metadata
Go to start of metadata

This function is used in Python Scripting.

Description

Queries the current state of alarms. The result is a list of alarm events, which can be queried for individual properties. The result object also has a getDataset() function that can be used to convert the query results into a normal dataset, with the columns: EventId, Source, DisplayPath, EventTime, State, Priority

The Tag Properties page contains more information on Alarm Properties

Client Permission Restrictions

This scripting function has no Client Permission or Perspective Session restrictions.

Syntax

system.alarm.queryStatus(priority, state, path, source, displaypath, all_properties, any_properties, defined, includeShelved)

  • Parameters

String[] priority - A list of possible priorities to match. Priorities can be specified by name or number, with the values: Diagnostic(0), Low(1), Medium(2), High(3), Critical(4).

String[] state - A list of states to allow. Valid values: "ClearUnacked", "ClearAcked", "ActiveUnacked", "ActiveAcked".

String[] path - A list of possible source paths to search at. The wildcard "*" may be used. Works the same as the source argument, and either can be used.

String[] source - A list of possible source paths to search at. The wildcard "*" may be used. Works the same as the path argument, and either can be used.

String[] displaypath - A list of display paths to search at. Display paths are separated by "/", and if a path ends in "/*", everything below that path will be searched as well.

Object[][] all_properties - A set of property conditions, all of which must be met for the condition to pass. This parameter is a list of tuples, in the form ("propName", "condition", value). Valid condition values: "=","!=","<","<=",">",">=". Only the first two conditions may be used for string values.

Object[][] any_properties - A set of property conditions, any of which will cause the overall the condition to pass. This parameter is a list of tuples, in the form ("propName", "condition", value). Valid condition values: "=","!=","<","<=",">",">=". Only the first two conditions may be used for string values.

String[] defined - A list of string property names, all of which must be present on an event for it to pass.

Boolean includeShelved - A flag indicating whether shelved events should be included in the results. Defaults to "false".

  • Returns

AlarmQueryResult - The AlarmQueryResult object is functionally a list of AlarmEvent objects. The AlarmQueryResult object has a built-in getDataset() function that will return a Standard Dataset containing the Event Id (UUID of the alarm), Source Path, Display Path, Event Time, State (as an integer), and Priority (as an integer).

Additionally, each AlarmEvent inside of the AlarmQueryResult object has several built-in methods to extract alarm information. More details on these methods can be found on the Alarm Event Properties Reference page.

Important

Each item in the resulting list is a combination of each alarm event for the same alarm: details for when the alarm became active, acknowledged, and cleared are combined into a single item. This differs from system.alarm.queryJournal() which splits these events into separate items.

  • Scope

Gateway, Vision Client, Perspective Session

Code Examples
Code Snippet
# This example queries the state of all tags named "HiAlarm", and puts the results in a table named "Table" (this assumes it's being run from a button on the same screen):
 
table = event.source.parent.getComponent("Table")
 
results = system.alarm.queryStatus(source=["*HiAlarm*"])
table.data = results.getDataset()
Python - Using any_properties
# The any_properties parameter allows you to filter the results for specific properties. This is useful when searching for alarms that contain Associated Data

# Build a List of Tuples that represent the properties to search for. In this case, if our alarms have an Associated Data named 'Group', we can use the following to search for 
# potential values
props = [("Group", "=", "value1"), ("Group", "=", "value2")]
state = ["ActiveUnacked", "ActiveAcked"]

alarms = system.alarm.queryStatus(any_properties = props, state = state)

# Here we're printing out the number of alarms that meet our criteria. We could replace this and further examine each individual alarm in a for-loop instead. 
print len(alarms)
Keywords

system alarm queryStatus, alarm.queryStatus

  • No labels