Scripting Object Reference
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 or 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:
Columns from historical calls (queryJournal) have the following columns:
|
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.
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 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:
|
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. |
Datasets and PyDatasets​
Used By: Many facets of Ignition including queries, Vision and Perspective components, and Tags
See Datasets.
Queries​
SProcCall​
Used By: system.db.createSProcCall, system.db.execSProcCall
See system.db.createSProcCall.
Tags​
Results​
Used By: system.tag.browse, system.tag.browseHistoricalTags
Methods​
Name | Returns | Description |
---|---|---|
getResults() | List | Returns a list of node dictionaries, one for each Tag (including folders and UDT instances) in the result set. See Tag Dictionary Keys below for a summary of available keys in the Tag dictionaries. |
getReturnedSize() | Integer | Returns the number of results contained in this object. If different than getTotalAvailableSize(), only a partial browse was performed, and the continuation point should be non-null. |
Tag Dictionary Keys​
All Nodes (Tags, Folders, UDT Definitions, and UDT Instances)​
Name | Type | Description |
---|---|---|
fullPath | BasicTagPath | A fully qualified Tag path to the node, including the name of the node. The value returned by this key is a BasicTagPath. However, Python's str() method can be used to convert the path to a string. |
hasChildren | Boolean | Represents whether the node contains sub-nodes, such as folders and UDT definitions. |
name | Unicode | The name of the node. The value returned by this key is unicode. However, Python's str() method can be used to convert the type to a string. |
tagType | TagObjectType | The type of the node. Possible values are:
|
Tags (tagType = AtomicTag)​
Name | Type | Description |
---|---|---|
dataType | String | The data type of the Tag. |
valueSource | String | Represents how the Tag derives its value. |
value | Varies | The last known qualified value on the Tag. |
UDT Definitions and Instances (tagType = UdtType or UdtInstance)​
Name | Type | Description |
---|---|---|
typeId | String | Represents the parent data type for the UDT. UDT definitions without a specified parent type will have a value of None. |
Users​
Used By: system.user.getUser, system.user.getUsers
This class provides information about basic user properties, except for the user's password.
Methods​
Name | Returns | Description |
---|---|---|
get() | String | Returns the specified value, or a null value if the requested item is not present. The following list represents the various values you may use in this manner:
|
getOrDefault() | String | Returns the specified value, or a default value if the requested item is not present. For example, user.getOrDefault(user.schedule) will return that user's schedule, or the value of Always if no schedule has been set as that is the default schedule. The following list represents the various values you may use in this manner:
|
getId() | String | Returns the internal identifier object that the backing user source needs to identify this user. |
getRoles() | String | Returns a sequence of strings representing the roles that this user belongs to. |
getContactInfo() | ContactInfo | Returns a sequence of ContactInfo objects. Each of these objects will have a contactType and value property representing the contact information, both strings. |
getScheduleAdjustments() | ScheduleAdjustment | Returns a sequence of ScheduleAdjustment objects. Each of these objects will have two date properties, "start" and "end", a boolean property, "available", and a string property called "note". |
getPath() | QualifiedPath | Returns a QualifiedPath object that represents this user in a deterministic manner. |
Perspective​
See Perspective Component Methods.
Misc Objects​
QualifiedValue​
Used By: Many facets of Ignition including Tag Event Scripts, various system.tag functions, and Perspective Property Change scripts
The QualifiedValue class is a representation of an Ignition value often used to represent a Tag's current condition (as in the result of a Tag read) and is meant to provide more context than a value alone. Two qualified values are considered equal if their quality and value are equal. The properties and methods on a QualifiedValue object are as follows:
Properties​
Name | Type | Description |
---|---|---|
value | Varies | The data associated with the QualifiedValue object. Type depends on the type of the underlying value. |
quality | QualityCode | The quality associated with the returned value. See QualityCode. |
timestamp | Date | The time associated with the returned value. |
Methods​
Name | Type | Description |
---|---|---|
getValue() | Varies | Gets the data associated with the QualifiedValue object. Type depends on the type of the underlying value. |
getQuality() | QualityCode | Gets the quality associated with the returned value. See QualityCode. |
getTimestamp() | Date | Gets the time associated with the returned value. |
QualityCode​
Used By: QualifiedValue Objects
The QualityCode class describes a quality for a value.
Properties​
Name | Type | Description |
---|---|---|
good | Boolean | Returns True if this code represents a Good quality level. Otherwise, returns False. |
uncertain | Boolean | Returns True if this code represents an Uncertain quality level. Otherwise, returns False. Note that Bad and Error quality levels return False. |
bad | Boolean | Returns True if this code represents a Bad quality level. Otherwise, returns False. Note that Uncertain and Error quality levels return False. |
error | Boolean | Returns True if this code represents an Error quality level. Otherwise, returns False. Note that Bad and Uncertain quality levels return False. |
notGood | Boolean | Returns True if this code represents an Uncertain, Bad, or Error quality level. Otherwise, returns False. |
badOrError | Boolean | Returns True if this code represents a Bad or Error quality level. Otherwise, returns False. |
code | Integer | The 32-bit integer code associated with the quality. |
diagnosticMessage | String | The diagnostic message associated with this quality, if present. Otherwise, returns None. |
Methods​
Name | Returns | Description |
---|---|---|
getCode() | Integer | Returns the 32-bit integer code associated with the quality. For more information on quality codes, including a list of available codes, see Quality Codes and Overlays. |
getDiagnosticMessage() | String | Returns the diagnostic message associated with this quality, if present. Otherwise, returns None. |
isGood() | Boolean | Returns True if this code represents a Good quality level. Otherwise, returns False. |
isUncertain() | Boolean | Returns True if this code represents an Uncertain quality level. Otherwise, returns False. Note that Bad and Error quality levels return False. |
isBad() | Boolean | Returns True if this code represents a Bad quality level. Otherwise, returns False. Note that Uncertain and Error quality levels return False. |
isError() | Boolean | Returns True if this code represents an Error quality level. Otherwise, returns False. Note that Bad and Uncertain quality levels return False. |
isNotGood() | Boolean | Returns True if this code represents an Uncertain, Bad, or Error quality level. Otherwise, returns False. |
isBadOrError() | Boolean | Returns True if this code represents a Bad or Error quality level. Otherwise, returns False. |
toValue() | QualifiedValue | Returns this quality as the quality component of a QualifiedValue object. |
is(QualityCode other) | Boolean | Compares the integer quality codes of another QualityCode object to this one. Returns True if they match. |
isNot(QualityCode other) | Boolean | Compares the integer quality codes of another QualityCode object to this one. Returns True if they do not match. |