Constants

Every protocol has a range of irreduible and necessary values. This library uses a simple static class variable, in the approximate style of the C++ enum, to encapsulate and describe the full set of required values.

Settings

Values used primarily (but not exclusively) for serial settings parameters.

class ekmmeters.MaxDemandResetInterval

As passed in setMaxDemandResetInterval(). V4 Omnimeters.

Off 0
Monthly 1
Weekly 2
Daily 3
Hourly 4
class ekmmeters.MaxDemandPeriod

As passed in setMaxDemandPeriod(). V3 and V4 Omnimeters.

At_15_Minutes 1
At_30_Minutes 2
At_60_Minutes 3
class ekmmeters.LCDItems

As passed in addLcdItem(). V4 Omnimeters.

kWh_Tot 1
Rev_kWh_Tot 2
RMS_Volts_Ln_1 3
RMS_Volts_Ln_2 4
RMS_Volts_Ln_3 5
Amps_Ln_1 6
Amps_Ln_2 7
Amps_Ln_3 8
RMS_Watts_Ln_1 9
RMS_Watts_Ln_2 10
RMS_Watts_Ln_3 11
RMS_Watts_Tot 12
Power_Factor_Ln_1 13
Power_Factor_Ln_2 14
Power_Factor_Ln_3 15
kWh_Tariff_1 16
kWh_Tariff_2 17
kWh_Tariff_3 18
kWh_Tariff_4 19
Rev_kWh_Tariff_1 20
Rev_kWh_Tariff_2 21
Rev_kWh_Tariff_3 22
Rev_kWh_Tariff_4 23
Reactive_Pwr_Ln_1 24
Reactive_Pwr_Ln_2 25
Reactive_Pwr_Ln_3 26
Reactive_Pwr_Tot 27
Line_Freq 28
Pulse_Cnt_1 29
Pulse_Cnt_2 30
Pulse_Cnt_3 31
kWh_Ln_1 32
Rev_kWh_Ln_1 33
kWh_Ln_2 34
Rev_kWh_Ln_2 35
kWh_Ln_3 36
Rev_kWh_Ln_3 37
Reactive_Energy_Tot 38
Max_Demand_Rst 39
Rev_kWh_Rst 40
State_Inputs 41
Max_Demand 42
class ekmmeters.CTRatio

As passed in setCTRatio(). V3 and V4 Omnimeters.

Amps_100 100
Amps_200 200
Amps_400 400
Amps_600 600
Amps_800 800
Amps_1000 1000
Amps_1200 1200
Amps_1500 1500
Amps_2000 2000
Amps_3000 3000
Amps_4000 4000
Amps_5000 5000
class ekmmeters.Pulse

As passed to setPulseInputRatio(). V4 Omnimeters.

Simple constant to clarify call.

In1 1
In2 2
In3 3
class ekmmeters.PulseOutput

As passed to setPulseOutputRatio(). V4 Omnimeters.

Ratio_1 Ratio_40
Ratio_2 Ratio_50
Ratio_4 Ratio_80
Ratio_5 Ratio_100
Ratio_8 Ratio_200
Ratio_10 Ratio_400
Ratio_16 Ratio_800
Ratio_20 Ratio_1600
Ratio_25  
class ekmmeters.Relay

Relay specified in setRelay(). V4 Omnimeters.

Relay1 OUT1 on V4 Meter
Relay2 OUT2 on V4 Meter
class ekmmeters.RelayState

Relay state in setRelay(). V4 Omnimeters.

RelayOpen 0
RelayClosed 1
class ekmmeters.RelayInterval

Relay interval in setRelay(). V4 Omnimeters.

Max 9999 seconds
Min 0, parameter limit
Hold 0 (lock relay state)

Serial Block

Values established when a SerialBlock is initialized.

class ekmmeters.MeterData

Each SerialBlock value is an array with these offsets. All Omnimeter versions.

SizeValue 0
TypeValue 1
ScaleValue 2
StringValue 3
NativeValue 4
CalculatedFlag 5
EventFlag 6
class ekmmeters.Field

Union of all V3A and V4AB Fields Returned.

Use these values to directy get read data with Meter::getField() or in directy traversal of SerialBlock.

Meter_Address 12 character Mfr ID’
Time_Stamp Epoch in ms at read
Model Meter model
Firmware Meter firmware
kWh_Tot Meter power total
kWh_Tariff_1 Power in timeslot 1
kWh_Tariff_2 Power in timeslot 2
kWh_Tariff_3 Power in timeslot 3
kWh_Tariff_4 Power in timeslot 4
Rev_kWh_Tot Meter rev. total
Rev_kWh_Tariff_1 Rev power in timeslot 1
Rev_kWh_Tariff_2 Rev power in timeslot 2
Rev_kWh_Tariff_3 Rev power in timeslot 3
Rev_kWh_Tariff_4 Rev power in timeslot 4
RMS_Volts_Ln_1 Volts line 1
RMS_Volts_Ln_2 Volts line 2
RMS_Volts_Ln_3 Volts line 3
Amps_Ln_1 Current line 1
Amps_Ln_2 Current line 2
Amps_Ln_3 Current line 3
RMS_Watts_Ln_1 Instantaneous watts line 1
RMS_Watts_Ln_2 Instantaneous watts line 2
RMS_Watts_Ln_3 Instantaneous watts line 3
RMS_Watts_Tot Instantaneous watts 1 + 2 + 3
Cos_Theta_Ln_1 Prefix in CosTheta
Cos_Theta_Ln_2 Prefix in CosTheta
Cos_Theta_Ln_3 Prefix in CosTheta
Max_Demand Demand in period
Max_Demand_Period MaxDemandPeriod
Meter_Time setTime() and splitEkmDate()
CT_Ratio setCTRatio
Pulse_Cnt_1 Pulse Count Line 1
Pulse_Cnt_2 Pulse Count Line 2
Pulse_Cnt_3 Pulse Count Line 3
Pulse_Ratio_1 setPulseInputRatio()
Pulse_Ratio_2 setPulseInputRatio()
Pulse_Ratio_3 setPulseInputRatio()
State_Inputs’ StateIn
Power_Factor_Ln_1 EKM Power Factor
Power_Factor_Ln_2 EKM Power Factor
Power_Factor_Ln_3 EKM Power Factor
Reactive_Energy_Tot Total VAR
kWh_Ln_1 Line 1 power
kWh_Ln_2 Line 2 power
kWh_Ln_3 Line 3 power
Rev_kWh_Ln_1 Line 1 reverse power
Rev_kWh_Ln_2 Line 2 reverse power
Rev_kWh_Ln_3 Line 3 revers power
Resettable_kWh_Tot setZeroResettableKWH()
Resettable_Rev_kWh_Tot setZeroResettableKWH()
Reactive_Pwr_Ln_1 VAR Line 1
Reactive_Pwr_Ln_2 VAR Line 2
Reactive_Pwr_Ln_3 VAR Line 3
Reactive_Pwr_Tot VAR Total
Line_Freq Freq. Hz.
State_Watts_Dir DirectionFlag
State_Out StateOut
kWh_Scale ScaleKWH
RMS_Watts_Max_Demand Power peak in period
Pulse_Output_Ratio PulseOutput
Net_Calc_Watts_Ln_1 RMS_Watts with Direction
Net_Calc_Watts_Ln_2 RMS_Watts with Direction
Net_Calc_Watts_Ln_3 RMS_Watts with Direction
Net_Calc_Watts_Tot RMS_Watts with Direction
Status_A Reserved diagnostic.
Status_B Reserved diagnostic.
Status_C Reserved diagnostic.

Power_Factor is the only power factor measurement supported by upstring EKM products. The original Cos Theta value is provided as an API-only feature.

class ekmmeters.ScaleType

Scale type defined in SerialBlock. V4 Omnimeters.

These values are set when a field is defined a SerialBlock. A Div10 or Div100 results in immediate scaling, otherwise the scaling is perfformed per the value in Field.kWh_Scale as described in ScaleKWH.

KWH ScaleKWH
No Do not scale
Div10 Scale 10^-1
Div100 Scale 10^-2
class ekmmeters.FieldType

Every SerialBlock element has a field type. V3 and V4 Omnimeters.

Data arrives as ascii. Field type determines disposition. The destination type is Python.

NoType Not type assigned, invalid
Hex Implicit hex string
Int Implicit int
Float Implicit float
String Leave as string, terminate
PowerFactor EKM L or C prefixed pf

Meter

Values used to select meter object buffers to operate on. V4 and V3 Omnimeters.

class ekmmeters.ReadSchedules

For readScheduleTariffs() and getSchedulesBuffer(). V3 and V4.

Schedules_1_To_4 1st 4 blocks tariffs and schedules
Schedules_5_To_8 2nd 4 blocks tariffs and schedules
class ekmmeters.ReadMonths

As passed to readMonthTariffs() and getMonthsBuffer(). V3 and V4.

Use to select the forward or reverse six month tariff data.

kWh Select forward month tariff data
kWhReverse Select reverse month tariff data

Data

Values which only appear in a read. V4 Omnimeters.

class ekmmeters.DirectionFlag

On V4, State_Watts_Dir mask shows RMS_Watts direction on line 1-3.

The Direction flag is used to generate Calc_Net_Watts field on every read. Each word in constant is the direction of the corresponding at the moment of read. Ex ForwardReverseForward means RMS_Watts lines one and three are positive, and line two is negtive.

ForwardForwardForward 1
ForwardForwardReverse 2
ForwardReverseForward 3
ReverseForwardForward 4
ForwardReverseReverse 5
ReverseForwardReverse 6
ReverseReverseForward 7
ReverseReverseReverse 8
class ekmmeters.ScaleKWH

Scaling or kWh values controlled by Fields.kWh. V4 Omnimeters.

If MeterData.ScaleValue is ScaleType.KWH, Fields.kWh_Scale one of these.

NoScale 0 no scaling
Scale10 1 scale 10^-1
Scale100 2 scale 10^-2
EmptyScale -1 Reserved
class ekmmeters.StateIn

State of each pulse line at time of read. V4 Omnimeters.

HighHighHigh 0
HighHighLow 1
HighLowHigh 2
HighLowLow 3
LowHighHigh 4
LowHighLow 5
LowLowHigh 6
LowLowLow 7
class ekmmeters.StateOut

Pulse output state at time of read. V4 Omnimeters.

OffOff 1
OffOn 2
OnOff 3
OnOn 4

Traversal

Values primarily (but not exclusively) used for extraction from or assignment to serial buffers. V3 and V4 Omnimeters.

class ekmmeters.Extents

Traversal extents to use with for range(Extent) idiom. V3 and V4 Omnimeters.

Use of range(Extent.Entity) as an iterator insures safe assignnment without off by one errors.

Seasons 4
Holidays 20
Tariffs 4
Schedules 8
Months 6
class ekmmeters.Seasons

As passed to assignSeasonSchedule(). V3 and V4 Omnimeters.

assign* methods use a zero based index for seasons. You may set a season using one of these constants or fill and iterate over range(Extents.Seaons).

Season_1 0
Season_2 1
Season_3 2
Season_4 3
class ekmmeters.Months

As passed to extractMonthTariff(). V3 and V4 Omnimeters.

Month_1 0
Month_2 1
Month_3 2
Month_4 3
Month_5 4
Month_6 5
class ekmmeters.Tariffs

As passed to assignScheduleTariff(). V3 and V4 Omnimeters.

Tariff_1 0
Tariff_2 1
Tariff_3 2
Tariff_4 3
class ekmmeters.Schedules

Allowed schedules. V3 and V4 Omnimeters.

Schedules on the meter are zero based, these apply to most passed schedule parameters.

Schedule_1 0
Schedule_2 1
Schedule_3 2
Schedule_4 3
Schedule_5 4
Schedule_6 5
Schedule_7 6
Schedule_8 7