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
| 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 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.')