system.mes.oee.importOeeModesFromCsv
Description
Imports OEE mode configurations from CSV formatted data.
Permissions
This method requires the OEE.WRITE.SAVE permission.
Syntax
system.mes.oee.importOeeModesFromCsv(bytes)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
bytes | byte[] | True | The CSV data as a byte array to import. |
Returns
An ApiResponse object indicating success or failure. On success, the data attribute contains the count of imported records.
Code Examples
import system.file
# Path to the CSV file
filePath = "C:/path/to/oee_modes.csv"
try:
# Read the file content as bytes
csvBytes = system.file.readFileAsBytes(filePath)
# Import the OEE modes
result = system.mes.oee.importOeeModesFromCsv(csvBytes)
if result.get('success'):
print "Successfully imported {} OEE modes.".format(result.get('data'))
else:
print "Import failed: {}".format(result.get('message'))
except Exception as e:
print "An error occurred: {}".format(str(e))