Skip to main content

system.mes.equipment.saveEquipmentPropertyValue

Description

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

Permissions

This method requires the EQUIPMENT.WRITE.SAVE permission.

Syntax

system.mes.equipment.saveEquipmentPropertyValue(**propertyValueData)

Parameters

ParameterTypeNullableDescription
equipmentIdString (ULID)FalseThe ULID of the equipment this property value belongs to.
equipmentPropertyIdString (ULID)FalseThe ULID of the equipment property that defines this value.
dataTypeStringTrueThe data type of the value. Default value is String.
valueMixedTrueThe actual value. Type depends on the property's data type.
idString (ULID)TrueThe ULID of the equipment property value. Used when updating.
notesStringTrueNotes related to the property value.
enabledBooleanTrueIndicates if this property value 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 value.

Code Examples

newValue = system.mes.equipment.newEquipmentPropertyValue()
newValue['equipmentId'] = system.mes.equipment.getEquipment('Pumps/CentrifugalPumps/Pump-101')['id']
newValue['equipmentPropertyId'] = system.mes.equipment.getEquipmentProperty('MaxFlowRate')['id']
newValue['value'] = 250.0
savedValue = system.mes.equipment.saveEquipmentPropertyValue(**newValue)
print(savedValue)