Skip to main content
Version: V2 (Ignition 8.1)

system.mes.oee.importCalculationConfigurationsFromJson

Description

Imports OEE Calculation Configurations from a JSON byte array. Rows below the async threshold are processed immediately; rows above that threshold are queued for background processing. Use getCalculationConfigImportQueueSize to monitor queue progress and cancelCalculationConfigImportQueue to cancel pending imports.

Permissions

This method requires the OEE.WRITE.SAVE permission.

Syntax

system.mes.oee.importCalculationConfigurationsFromJson(bytes)

Parameters

ParameterTypeNullableDescription
bytesbyte[]FalseThe JSON data as a byte array.

Returns

Returns a JSON ApiResponse with an ImportResponseDTO payload containing the count of immediately processed rows and the count of rows queued for background processing.

Code Examples

import system.file

filePath = "C:/path/to/calculation_configs.json"

try:
jsonBytes = system.file.readFileAsBytes(filePath)
result = system.mes.oee.importCalculationConfigurationsFromJson(jsonBytes)

if result.get('success'):
data = result.get('data')
print("Processed:", data.get('processedCount'))
print("Queued:", data.get('queuedCount'))
else:
print("Import failed:", result.get('message'))
except Exception as e:
print("Error:", str(e))