Skip to main content
Version: V3 (Ignition 8.3)

system.mes.meter.exportMeterTypesAsJson

Description

No Parameter:

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

With a Parameter:

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

Permissions

This method requires the METERING.READ.GET permission.

Syntax

system.mes.meter.exportMeterTypesAsJson()
system.mes.meter.exportMeterTypesAsJson(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 JSON export.

Code Examples

Perspective

jsonBytes = system.mes.meter.exportMeterTypesAsJson()
system.perspective.download("meter-types.json", jsonBytes)

Script Console

jsonBytes = system.mes.meter.exportMeterTypesAsJson()
path = system.file.saveFile("meter-types.json")
if path is not None:
system.file.writeFile(path, jsonBytes)