Skip to main content

system.mes.equipment.saveEquipmentProperty

Description

Creates or updates an Equipment Properties record in the system based on the provided parameters.

Permissions

This method requires the EQUIPMENT.WRITE.SAVE permission.

Syntax

system.mes.equipment.saveEquipmentProperty(**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 representation of the saved equipment property.

Code Examples

newProperty = system.mes.equipment.newEquipmentProperty()
newProperty['name'] = 'MaxFlowRate'
newProperty['description'] = 'Maximum flow rate in liters per minute.'
newProperty['dataType'] = 'Float8'
newProperty['lowLimit'] = 0.0
newProperty['highLimit'] = 500.0
savedProperty = system.mes.equipment.saveEquipmentProperty(**newProperty)
print(savedProperty)