Skip to main content
Version: V2 (Ignition 8.1)

system.mes.meter.exportMeterConfigurationsAsJson

Description

No Parameter:

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

With a Parameter:

Exports selected Meter Configurations as raw JSON bytes (UTF-8 encoded). Each entry in the list is either a Meter Configuration ID or an equipment path; an equipment path exports every configuration in that equipment's subtree, including disabled (soft-deleted) ones.

Permissions

This method requires the METERING.READ.GET permission.

Syntax

system.mes.meter.exportMeterConfigurationsAsJson()
system.mes.meter.exportMeterConfigurationsAsJson(ids)

Parameters

No Parameter:

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

With a Parameter:

ParameterTypeNullableDescription
idsList<String>TrueList of selectors. Each entry is either a Meter Configuration ID or an equipment path; an equipment path exports every configuration in that equipment's subtree, including disabled (soft-deleted) ones.

Returns

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

Code Examples

Perspective

jsonBytes = system.mes.meter.exportMeterConfigurationsAsJson()
system.perspective.download("meter-configurations.json", jsonBytes)

Script Console

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

Export by equipment path

# Mix Meter Configuration IDs and equipment paths. The path exports every configuration
# under that equipment's subtree, including disabled (soft-deleted) ones.
jsonBytes = system.mes.meter.exportMeterConfigurationsAsJson(['Enterprise/Site/Line1', '01J9YP3JBR-WQ8GWRR2-8Y879V2D'])