Hi Mikhail,
Previously I am using v5.8.4 and use default channel type Minute Real to sum up my value every minute. However in v6 doesn’t has Minute Real anymore.
My previous script worked in v5.8.4 is as below:
double GetSumOneMinute(int srcCnl, int desCnl)
{
DateTime NowDT = DateTime.Now;
double newVal = Val(srcCnl);
double curVal = Val();
double sumVal = newVal + curVal;
SetVal(CnlNum, sumVal);
if (NowDT.Minute == 0)
{
SetVal(desCnl, sumVal);
return 0;
}
if (NowDT.Minute == 30)
{
SetVal(desCnl, sumVal);
return 0;
}
else
{
return sumVal;
}
}
Right now above script couldn’t work in v6. I got the value kept summing up every second.
Pls advice for what to add into the above script in order to make it work in v6?
Thank you.