The following sections describe the structure of some prominent objects returned or expected by Ignition system functions. Not all classes, fields, and methods are included in the lists below. For a fully comprehensive reference of all Ignition types, refer to the Javadocs in the Ignition SDK Programmers Guide.
Alarming
AlarmQueryResult
Used By: system.alarm.queryStatus, system.alarm.queryJournal
The AlarmQueryResult object represents a collection of AlarmEvent objects with some additional helper methods.
Methods |
---|
Name | Returns | Description |
---|
getDataset() | dataset | Returns the alarms as a dataset. Columns for realtime (queryStatus) calls are: -
EventId Source DisplayPath EventTime -
State -
Priority
Columns from historical calls (queryJournal) have the following columns: EventId Source DisplayPath EventTime EventState -
Priority IsSystemEvent
|
PyAlarmEvent
Used By: Perspective - Alarm Journal Table, Perspective - Alarm Status Table, system.alarm.queryJournal, system.alarm.queryStatus.
This object contains information about alarm events. See ScriptableBlockPyAlarmEvent below for a list of methods.
ScriptableBlockPyAlarmEvent
Used By: This object is the "event" object made available to Script Blocks in alarm pipelines.
Note: The methods listed in the table below are shared between the
PyAlarmEvent and
ScriptableBlockPyAlarmEvent objects, with the latter being the "event" object made available to
Script Blocks in alarm pipelines. However, there is one method called
cancelNotification
that is
exclusive to ScriptableBlockPyAlarmEvent.
Methods |
---|
Name | Returns | Description |
---|
cancelNotification() | None | When invoked, cancels the running pipeline instance. |
contains(String propertyName) | Boolean | Returns a boolean, based on whether or not the alarm event contains a value for the named property. Useful when testing for associated data. |
get(String propertyName) | Any | Returns the value of propertyName. Useful in cases when trying to view the value of associated data. A full list of built-in alarm properties can be found on the Tag Alarm Properties page. |
getAckData() | EventData | Returns an object containing information acknowledgement information for the event, assuming the event has been acknowledged. |
getActiveData() | EventData | Returns an object containing information detailing when the alarm went active. |
getClearedData() | EventData | Returns an object containing information detailing when the alarm transitioned to a cleared status, assuming it has done so. |
getDisplayPath() | StringPath | Returns the Display Path of the alarm. |
getDisplayPathOrSource() | String | If the Display Path for the alarm in an empty string, then returns the Source Path, otherwise, returns the Display Path. |
getId() | java.util.UUID | Returns the UUID of the alarm event. |
getLabel() | String | The label of the alarm event. |
getLastEventState() | AlarmStateTransition | Returns the last state of the alarm. Possible return values are Active, Acknowledged, or Cleared. The last event is always returned, so if you're looking to see if an alarm has been both Acknowledged and Cleared, use getState() instead. |
getName() | String | Returns the name of the alarm. |
getNotes() | String or None | Returns the value of the Notes property. Returns a None-type object if a Note has not been configured on the Alarm. |
getOrDefault(String propertyName) | Any | Returns the value of the propertyName, or the default value if one isn't defined. Can return null if the value is null. |
getOrElse(String propertyName, Object fallBackValue) | Any | Returns the value of propertyName. If there is property by that name, fallBackValue is returned instead. Can return null if the value is null. |
getPriority() | AlarmPriority | Returns an AlarmPriority object representing the the Priority of the alarm. Can easily be converted to a String with str(). |
getProperties() | Set | Returns a set of all properties on the event. |
getSource() | QualifiedPath | Returns the Source path of the alarm. |
getState() | AlarmState | Returns the current state of the alarm: i.e., Active, Unacknowledged. |
isAcked() | Boolean | Returns a boolean flag indicating that the alarm has been Acknowledged. |
isCleared() | Boolean | Returns a boolean flag indicating that the alarm has been Cleared. |
isShelved() | Boolean | Returns a boolean flag indicating that the alarm has been Shelved. |
In addition, PyAlarmEvents have the following keys that can be used to identify certain property values. For example:
results = system.alarm.queryStatus()
for i in results:
print i["EventId"]
Key | Description |
---|
EventId
| A unique identifier for the alarm event. |
Source | The source path of the alarm event. |
DisplayPath | The display path of the alarm event. |
EventTime | A date representing when the alarm event changed State/EventState. |
State | queryStatus Only. A string representing the state of the alarm. Expected values are: - Active, Unacknowledged
- Active, Acknowledged
- Cleared, Unacknowledged
- Cleared, Acknowledged
|
EventState | queryJournal Only. A string representing the state of the alarm. See State for a list of possible values. |
Priority | A string representing the priority of the alarm. |
IsSystemEvent | queryJournal Only. A boolean representing if this event was a system event. |
ShelvedPath
Used By: system.alarm.getShelvedPaths
This class provides information about an alarm that has been "shelved", including the alarm path, when it was shelved, and by whom.
Methods |
---|
Name | Returns | Description |
---|
getPath() | path | Returns a Path object representing the path to the alarm. Can be cast to a string. |
getExpiration() | date | Returns the time that the shelve expires. |
getUser() | QualifiedPath | Returns the actual AlarmEvent object for the specified event UUID. |
isExpired() | boolean | Returns True if the shelve has expired for the alarm; otherwise returns False. |