Skip to main content
Version: V2 (Ignition 8.1)

system.mes.oee.exportOeeModesToCsv

Description​

Exports OEE Mode configs to CSV 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.exportOeeModesToCsv()

# Export modes for specific locations (filtering)
system.mes.oee.exportOeeModesToCsv(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 CSV data of the exported OEE modes. If locationIdOrPaths is provided, only modes for those locations are included.

Code Examples​

Perspective​

# Export all OEE modes
csvBytes = system.mes.oee.exportOeeModesToCsv()
system.perspective.download("oee_modes.csv", csvBytes)

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

Script Console​

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

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