Skip to main content

system.mes.oee.validateOeeAlarm

Description

Validates the specified parameters for an OEE Alarm configuration and returns any validation errors. This only checks if the alarm object can be saved based on the attributes given.

Permissions

This method requires the OEE.READ.VALIDATE permission.

Syntax

system.mes.oee.validateOeeAlarm(**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 object where keys are field names and values are lists of validation violation messages. If validation passes, returns an empty object or null.

Code Examples

# Validate an alarm before saving
alarm = system.mes.oee.newOeeAlarm()
alarm['locationId'] = '01JAP8RJBN-8ZTPXSGY-J9GSDPE1'
alarm['tagPath'] = '[default]Alarms/Line1/Motor1'
alarm['minPriority'] = 'Diagnostic'

errors = system.mes.oee.validateOeeAlarm(**alarm)
if errors:
print("Validation errors:", errors)
else:
system.mes.oee.saveOeeAlarm(alarm)