Skip to main content
Version: V3 (Ignition 8.3)

system.mes.location.exportPropertiesAsCsv

Description

Exports all or selected location properties as raw bytes in CSV format (UTF-8 encoded). Streams location property data from the database and formats it as CSV, including a header row. When idsOrNames is omitted, all location properties are exported.

Permissions

This method requires the LOCATION.READ.GET permission.

Syntax

system.mes.location.exportPropertiesAsCsv()
system.mes.location.exportPropertiesAsCsv(idsOrNames=["Temperature"])

Parameters

ParameterTypeNullableDescription
idsOrNamesString[]YesThe ids or names of the location properties to export. Omit to export all.

Returns

A byte array (byte[]) containing the raw byte data of the CSV export.

Code Examples

Perspective

csvBytes = system.mes.location.exportPropertiesAsCsv()
system.perspective.download("location-properties.csv", csvBytes)

Script Console

csvBytes = system.mes.location.exportPropertiesAsCsv()
path = system.file.saveFile("location-properties.csv")
if path is not None:
system.file.writeFile(path, csvBytes)