Minute Real not found in Rapid v6

Forum Home Forums Understanding the Software Using Formulas Minute Real not found in Rapid v6

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #13726
    kcks66
    Participant

    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.

    #13740
    Mikhail
    Moderator

    Hi,
    In v6, use the Calculated channel type and input formula like EveryMin(() => MyFunction())

    #13744
    kcks66
    Participant

    Hi Mikhail,

    I got the “Minute Real” in V6 now. Thank you.

    By the way, if I want “Hourly Real” can I use?

    EveryHour(() => MyFunction())

    #13750
    Mikhail
    Moderator

    Hi,
    Yes, EveryHour function exists. You could open the Scripts table, then open the Timers script and find these functions there.

    #13752
    kcks66
    Participant

    Hi Mikhail,

    I found the functions. Thank you.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.