Skip to main content
Version: V2 (Ignition 8.1)

system.mes.meter.importMeterTypesFromJson

Description

Imports Meter Type records from a JSON file.

Permissions

This method requires the METERING.WRITE.SAVE permission.

Syntax

system.mes.meter.importMeterTypesFromJson(bytes)

Parameters

ParameterTypeNullableDescription
bytesbyte[]FalseThe JSON file contents as bytes.

Returns

Returns a JSON representation of the import response.

Code Examples

Script Console

# Open a file dialog and import Meter Types from the selected JSON file
path = system.file.openFile("json")
if path is not None:
jsonBytes = system.file.readFileAsBytes(path)
response = system.mes.meter.importMeterTypesFromJson(jsonBytes)
print(response)