Checking the average value of the last 60 minutes Vijeo Citect 7.5 2015

Checking the average value of the last 60 minutes

I have an analog process value that I want to calculate to an average last hour value with sampling every 1 minute. I know there are many solutions to this problem, but does anyone have any idea of ​​the "best"? A really good script would be great.

Parents
  • Here is a script for this:
    REAL Val[100]
    Tcur = TimeCurrent();
    ERR_N = TrnGetTable("FIT_VAPOR_UE", Tcur , 60, 60, Val[0], 1, 0);
    P_MEAN = TableMath(Val, 60, 2, 1);


    ======
    THE PARAMETERS
    TrnGetTable(Tag, Time, Period, Length, Table, DisplayMode, Milliseconds [, sClusterName] )
    TableMath(Table, Size, Command [, Mode] )
Reply
  • Here is a script for this:
    REAL Val[100]
    Tcur = TimeCurrent();
    ERR_N = TrnGetTable("FIT_VAPOR_UE", Tcur , 60, 60, Val[0], 1, 0);
    P_MEAN = TableMath(Val, 60, 2, 1);


    ======
    THE PARAMETERS
    TrnGetTable(Tag, Time, Period, Length, Table, DisplayMode, Milliseconds [, sClusterName] )
    TableMath(Table, Size, Command [, Mode] )
Children
No Data