Page 1 of 1

Create cumulative time for output on

Posted: Wed Mar 23, 2016 4:54 am
by bctBCT76
Dear all,

I wish I can create a daily out time gate to measure the total on time for an output.
How would you approach this need? Is it possible
Thanks

Re: Create cumulative time for output on

Posted: Wed Mar 23, 2016 11:42 am
by admin
Dear Sir,
The only way is to create a code function.
For example:

Code: Select all

Function void counter()
#startup

    int counter;

    While(WindowIsOpen())

        if (GetDigGateValue("Output", 0) == 1) then
            counter = GetNumGateValue("SecondsCounter", 0);
            counter = counter + 1;
            SetNumGateValue("SecondsCounter", 0, counter);
        end

        Sleep(1000);
    end
end


Best regards