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
| Parameter | Type | Nullable | Description |
|---|---|---|---|
name | String | False | The name of the equipment property. |
description | String | True | A description of the equipment property. |
dataType | String | False | The data type of the property (e.g., String, Boolean, Int8, Float8, DateTime, ByteArray). Default value is String. |
lowLimit | Double | True | The minimum allowed value. Only applicable for numeric data types. |
highLimit | Double | True | The maximum allowed value. Only applicable for numeric data types. |
format | String | True | An optional format string for display. |
unitOfMeasureId | String (ULID) | True | The ULID of the unit of measure for this property. |
unitOfMeasureName | String | True | The name of the unit of measure. For display purposes only. |
unitOfMeasureSymbol | String | True | The symbol of the unit of measure. For display purposes only. |
options | List<String> | True | A list of allowed values for the property. |
nullable | Boolean | True | Whether the property value can be null. Default value is false. |
defaultValue | Mixed | True | The default value for the property. The type depends on the configured dataType. |
id | String (ULID) | True | The ULID of the equipment property. Used when updating an existing property. |
notes | String | True | Notes related to the equipment property. |
enabled | Boolean | True | Indicates if the equipment property 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.
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)