tenWare Software

tenHsEcm12xx Scripting

There are a few tenHsEcm12xx plugin Properties and Methods that are available for use in creating scripts.  The code snippets used here are .net but vbscript can also be used.

First you must obtain a reference to the plugin:

Plugin Reference

You can access the last 24 hours of detailed data from the HourlyData property.  This property returns a SortedList(of DateTime, Double()).  The Key is DateTime of each data point, and each Value is an Array of Double that contains the values for each data point.  The Value Array contains:

0     Transmission interval in seconds for ECM1
1     Ch1 Watts
2     Ch1 Amps
3     Ch1 Polar Watts
4     Ch2 Watts
5     Ch2 Amps
6     Ch2 Polar Watts
7     AC Volts for ECM1
8     Aux1 Watts
9     Aux2 Watts
10   Aux3 Watts
11   Aux4 Watts
12   Aux5 Watts
13   Transmission interval in seconds for ECM2
14   Ch3 Watts
15   Ch3 Amps
16   Ch3 Polar Watts
17   Ch4 Watts
18   Ch4 Amps
19   Ch4 Polar Watts
20   AC Volts for ECM2
21   Aux6 Watts
22   Aux7 Watts
23   Aux8 Watts
24   Aux9 Watts
25   Aux10 Watts
26   Net Energy
27   Generated Energy
28   Total Energy


To compute the average power for Ch1 during the last 24 hours:

HourlyData Script


The plugin also provides the EnergyCost method to compute the monthly cost for a given Month and KWHs.  The code snippet below will compute the cost of 1,400 KWHs for the month of February:

Cost Script

To put it all together, the following script will compute the monthly cost for both a winter month and a summer month if we used electricity for the entire month at the rate we are using it during the last 24 hours:

Complete Script