Skip to main content
Version: V3 (Ignition 8.3)

system.mes.oee.exportOeeModesToJson

Description​

Exports OEE Mode configs to JSON format. You can export all modes or filter by specific locations using the optional locationIdOrPaths parameter.

Permissions​

This method requires the OEE.READ.GET permission.

Syntax​

# Export all OEE modes
system.mes.oee.exportOeeModesToJson()

# Export modes for specific locations (filtering)
system.mes.oee.exportOeeModesToJson(locationIdOrPaths)

Parameters​

ParameterTypeNullableDescription
locationIdOrPathsString[]Yes(Optional) Array of location IDs or paths to export. When omitted, all mode configs are exported.

Returns​

Returns a byte array containing the JSON data of the exported OEE modes. If locationIdOrPaths is provided, only modes for those locations are included.

Code Examples​

Perspective​

# Export all OEE modes
jsonBytes = system.mes.oee.exportOeeModesToJson()
system.perspective.download("oee_modes.json", jsonBytes)

# Export modes for specific locations
locationPaths = ["Enterprise/Site/Area/Line1", "Enterprise/Site/Area/Line2"]
jsonBytesFiltered = system.mes.oee.exportOeeModesToJson(locationPaths)
system.perspective.download("oee_modes_filtered.json", jsonBytesFiltered)

Script Console​

# Export all OEE modes
jsonBytes = system.mes.oee.exportOeeModesToJson()
path = system.file.saveFile("oee_modes.json")
if path is not None:
system.file.writeFile(path, jsonBytes)

# Export modes for specific locations
locationPaths = ["Enterprise/Site/Area/Line1", "Enterprise/Site/Area/Line2"]
jsonBytesFiltered = system.mes.oee.exportOeeModesToJson(locationPaths)
pathFiltered = system.file.saveFile("oee_modes_filtered.json")
if pathFiltered is not None:
system.file.writeFile(pathFiltered, jsonBytesFiltered)