Skip to main content
Version: V3 (Ignition 8.3)

system.mes.meter.enums.getMeterCostSourceEnum

Description

Retrieves the values of the MeterCostSource enum. MeterCostSource defines how the cost per unit of measure is determined for a Meter Configuration. This is useful for populating selection inputs (such as dropdowns) or for validating a cost source value before setting it on a Meter Configuration.

Syntax

system.mes.meter.enums.getMeterCostSourceEnum()

Parameters

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

Returns

Returns a list of MeterCostSource enum values. Each value exposes name() (the constant name, used when setting a Meter Configuration's cost source) and toString() (the human-readable display name):

NameDisplay NameDescription
STATICStaticA fixed cost value stored directly on the Meter Configuration.
FROM_METER_TYPEFrom Meter TypeThe cost is inherited from the associated Meter Type.
EXPRESSIONExpressionThe cost is evaluated at runtime from an Ignition expression on the Meter Configuration.

Code Examples

# Retrieve the MeterCostSource enum values
costSources = system.mes.meter.enums.getMeterCostSourceEnum()

# Print the constant name and display name of each value
for costSource in costSources:
print(costSource.name() + " - " + costSource.toString())

# Example output:
# STATIC - Static
# FROM_METER_TYPE - From Meter Type
# EXPRESSION - Expression