Create cumulative time for output on

Discussion about Code Builder Builder and Winlog language support.
bctBCT76
Posts: 23
Joined: Wed Jun 24, 2015 11:39 am

Create cumulative time for output on

Postby bctBCT76 » Wed Mar 23, 2016 4:54 am

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

User avatar
admin
Site Admin
Posts: 306
Joined: Tue Nov 17, 2009 1:18 pm

Re: Create cumulative time for output on

Postby admin » Wed Mar 23, 2016 11:42 am

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


Return to “Code - Code Builder”

Who is online

Users browsing this forum: No registered users and 1 guest