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
| Parameter | Type | Nullable | Description |
|---|---|---|---|
equipmentId | String (ULID) | False | The ULID of the equipment this property value belongs to. |
equipmentPropertyId | String (ULID) | False | The ULID of the equipment property that defines this value. |
dataType | String | True | The data type of the value. Default value is String. |
value | Mixed | True | The actual value. Type depends on the property's data type. |
id | String (ULID) | True | The ULID of the equipment property value. Used when updating. |
notes | String | True | Notes related to the property value. |
enabled | Boolean | True | Indicates if this property value is active. Default value is true. |
spare1 | String | True | Additional field for user-defined context. |
spare2 | String | True | Additional field for user-defined context. |
spare3 | String | True | Additional 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)