1.877.352.9158  (Price in US$)

Welcome Guest!   

My Account  |  Cart Contents  |  Checkout

Quick Links To Products
Energy consumption
Equation Description:
Calculate the energy consumed for each hour
Equation Contents:
double energy_sum = 0;
DateTime cur_time;
bool is_first_time = true;
public double HourEnergy(double Input)
{
if(is_first_time)
{
cur_time = this.StartTime;
energy_sum = 0;
is_first_time = false;
}
else
{
DateTime pre_time = cur_time;
cur_time = cur_time.AddSeconds(this.SampleInterval);
if(cur_time.Hour != pre_time.Hour)
{
energy_sum = 0;
}
else
{
energy_sum += this.Channels[0].Measurement * this.Channels[1].Measurement * this.SampleInterval;
}
}
return energy_sum;
}