Skip to main content

system.mes.equipment.validateEquipmentProperty

Description

Validates the specified parameters for an Equipment Properties record and returns any validation errors. This only checks if the equipment property object can be saved based on the attributes given, without actually creating or modifying the property. Use this function to verify your parameters before executing operations that create or modify equipment properties.

Permissions

This method requires the EQUIPMENT.READ.VALIDATE permission.

Syntax

system.mes.equipment.validateEquipmentProperty(**propertyData)

Parameters

ParameterTypeNullableDescription
nameStringFalseThe name of the equipment property.
descriptionStringTrueA description of the equipment property.
dataTypeStringFalseThe data type of the property (e.g., String, Boolean, Int8, Float8, DateTime, ByteArray). Default value is String.
lowLimitDoubleTrueThe minimum allowed value. Only applicable for numeric data types.
highLimitDoubleTrueThe maximum allowed value. Only applicable for numeric data types.
formatStringTrueAn optional format string for display.
unitOfMeasureIdString (ULID)TrueThe ULID of the unit of measure for this property.
unitOfMeasureNameStringTrueThe name of the unit of measure. For display purposes only.
unitOfMeasureSymbolStringTrueThe symbol of the unit of measure. For display purposes only.
optionsList<String>TrueA list of allowed values for the property.
nullableBooleanTrueWhether the property value can be null. Default value is false.
defaultValueMixedTrueThe default value for the property. The type depends on the configured dataType.
idString (ULID)TrueThe ULID of the equipment property. Used when updating an existing property.
notesStringTrueNotes related to the equipment property.
enabledBooleanTrueIndicates if the equipment property is active. Default value is true.
spare1StringTrueAdditional field for user-defined context.
spare2StringTrueAdditional field for user-defined context.
spare3StringTrueAdditional field for user-defined context.

Returns

Returns a JSON object where keys are field names and values are lists of validation violation messages.

Code Examples

propertyData = system.mes.equipment.newEquipmentProperty()
propertyData['name'] = 'MaxFlowRate'
propertyData['dataType'] = 'Float8'
validationErrors = system.mes.equipment.validateEquipmentProperty(**propertyData)
if len(validationErrors) > 0:
print('Validation errors found:', validationErrors)
else:
print('Equipment property parameters are valid.')