Skip to main content

system.mes.oee.newOeeAlarm

Description

Creates an empty non-persisted OEE Alarm object to provide the structure required by the API to save a new alarm configuration.

Permissions

This method does not require any permissions.

Syntax

system.mes.oee.newOeeAlarm()

Parameters

This method does not take any parameters.

Returns

Returns a JSON object representing the newly created OeeAlarmDTO object with default values.

NameTypeNullableDescriptionDefault 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

Code Examples

# Create a new OEE alarm object
alarm = system.mes.oee.newOeeAlarm()

# Set the required fields
alarm['locationId'] = '01JAP8RJBN-8ZTPXSGY-J9GSDPE1'
alarm['tagPath'] = '[default]Alarms/Line1/Motor1'
alarm['minPriority'] = 'Diagnostic' # Default value

# Optional: Set location path for display purposes
alarm['locationPath'] = 'DairyCo/Plant1/Line1'

# Save the alarm
system.mes.oee.saveOeeAlarm(**alarm)