Skip to main content
Version: V2 (Ignition 8.1)

system.mes.meter.exportMeterTypesAsCsv

Description

No Parameter:

Exports all Meter Types as raw CSV bytes (UTF-8 encoded).

With a Parameter:

Exports selected Meter Types by IDs or names as raw CSV bytes (UTF-8 encoded).

Permissions

This method requires the METERING.READ.GET permission.

Syntax

system.mes.meter.exportMeterTypesAsCsv()
system.mes.meter.exportMeterTypesAsCsv(idsOrNames)

Parameters

No Parameter:

ParameterTypeNullableDescription
None--This method does not take any parameters.

With a Parameter:

ParameterTypeNullableDescription
idsOrNamesList<String>TrueList of Meter Type IDs or names to export.

Returns

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

Code Examples

Perspective

csvBytes = system.mes.meter.exportMeterTypesAsCsv()
system.perspective.download("meter-types.csv", csvBytes)

Script Console

csvBytes = system.mes.meter.exportMeterTypesAsCsv()
path = system.file.saveFile("meter-types.csv")
if path is not None:
system.file.writeFile(path, csvBytes)