This page details the various scripting, component, and extension functions available for Perspective's Alarm Status Table component.

Component Events

Perspective Component Events
The Perspective Event Types Reference page describes all the possible component event types for Perspective components. Not all component events support each Perspective component. The Component Events and Actions page shows how to configure events and actions on a Perspective component. Component scripting is handled separately and can be accessed from the Component menubar or by right clicking on the component.

On this page ...

Component Functions

.refreshData()

The following feature is new in Ignition version 8.1.18
Click here to check out the other new features

  • Description

Refreshes the data on the Alarm Status Table.

  • Parameters

None

  •   Return

Nothing

Extension Functions

filterAlarm

The following feature is new in Ignition version 8.1.0
Click here to check out the other new features

  • Description

Called for each event before it is displayed in the table, allowing you to hide or show each alarm event (row) in the table. Provides an opportunity to write a more complex filter than what's normally provided to the component.  Return False to exclude an alarm event from the table. 

  • Parameters

ComponentModelScriptWrapper.SafetyWrapper self- A reference to the component that is invoking this function.

PyAlarmEvent alarmEvent - The alarm event itself. Call alarmEvent.get('propertyName') to inspect properties on the event. Common properties: 'name', 'source', 'priority'.

  • Return

Boolean - The function must return either a True or False for every alarm event in the table. True will show the alarm. False will hide the alarm.

Examples

With the built-in PyAlarmEvent object all alarm event properties are accessible to this function, and can be used to help determine if any given event should appear on the table. Furthermore, Associated Data (also known as custom alarm properties) can be examined from the same event. 

# Replace Property Name below with a the name of the property you wish to filter on. 
if alarmEvent.get('Property Name'):
    return True
# It's important that you return a False value for the events you don't want to see in the table. 
else:
	return False

You could also condense the code example above by using something like the following:

return "Low"== str(alarmEvent.get('priority'))

filterShelvedAlarm

The following feature is new in Ignition version 8.1.10
Click here to check out the other new features

  • Description

Called for each event before it is displayed in the shelved tab of the table, allowing you to hide or show each alarm event (row) in the table. Return False to exclude a shelved alarm event from the table. 

  • Parameters

ComponentModelScriptWrapper.SafetyWrapper self- A reference to the component that is invoking this function.

PyAlarmEvent shelvedAlarmEvent - The shelved alarm event. Call shelvedAlarmEvent.get('propertyName') to inspect properties on the event. Properties: 'sourcePath', 'shelvedBy', 'expires'.

  • Return

Boolean - The function must return either a True or False for every alarm event in the table. True will show the alarm. False will hide the alarm.

Examples

Unlike the alarmEvent object, the shelvedAlarmEvent object may only inspect shelved alarm event properties. 

# display only shelved alarms from a specific sourcePath:

source = shelvedAlarmEvent.get('sourcePath')
if source == 'prov:default:/tag:myTag/Mode:/alm:myAlarm':
	return True
return False



  • No labels