Skip to main content
Version: V2 (Ignition 8.1)

system.mes.oee.importCalculationConfigurationsFromCsv

Description

Imports OEE Calculation Configurations from a CSV 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.importCalculationConfigurationsFromCsv(bytes)

Parameters

ParameterTypeNullableDescription
bytesbyte[]FalseThe CSV 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.csv"

try:
csvBytes = system.file.readFileAsBytes(filePath)
result = system.mes.oee.importCalculationConfigurationsFromCsv(csvBytes)

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