Skip to main content

system.mes.oee.saveOeeAlarm

Description

Creates or updates an OEE Alarm configuration in the system.

Permissions

This method requires the OEE.WRITE.SAVE permission.

Syntax

system.mes.oee.saveOeeAlarm(**alarm)

Parameters

An unpacked dictionary of OeeAlarmDTO fields.

ParameterTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Alarmnull
locationIdStringFalseIdentifier of the associated locationnull
locationPathStringTruePath for the associated locationnull
tagPathStringFalseThe qualified path to monitor for alarmsnull
minPriorityAlarmPriorityFalseMinimum alarm priority to include in eventsDiagnostic
labelFilterStringTrueOptional filter to apply to alarm labels. Only alarms with labels matching this filter will be included.null
availabilityReasonCodeOverrideStringTrueName of the associated data property in Ignition alarms that contains the availability reason code override valuenull
stateCodeOverrideStringTrueName of the associated data property in Ignition alarms that contains the state code override valuenull
notesStringTrueNotes associated with the OEE Alarmnull
enabledbooleanTrueIndicates whether the OEE Alarm is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Returns

Returns a JSON representation of the saved OeeAlarmDTO object.

Code Examples

# Create and save a new alarm
alarm = system.mes.oee.newOeeAlarm()
alarm['locationId'] = '01JAP8RJBN-8ZTPXSGY-J9GSDPE1'
alarm['tagPath'] = '[default]Alarms/Line1/Motor1'
alarm['minPriority'] = 'Medium' # Valid values: Diagnostic, Low, Medium, High, Critical

savedAlarm = system.mes.oee.saveOeeAlarm(**alarm)

# Update an existing alarm
existingAlarm = system.mes.oee.getOeeAlarm('01JAP8RJBN-8ZTPXSGY-J9GSDPE1')
existingAlarm['minPriority'] = 'High'
updatedAlarm = system.mes.oee.saveOeeAlarm(**existingAlarm)