NumGate changes at specific date/times

Discussion about Code Builder Builder and Winlog language support.
Post Reply
User avatar
admin
Site Admin
Posts: 373
Joined: Tue Nov 17, 2009 1:18 pm

Re: NumGate changes at specific date/times

Post by admin »

Hi,
you can use code like this:

Code: Select all

Function void mainLoopSetValue()
#startup
    While (WindowIsOpen())
        if (GetHour() == 20 && GetMinute() == 30 && GetSecond() == 0) then
            SetNumGateValue("Test", 0, Rand(100));
            SetNumGateValue("Test", 1, Rand(100));
            SetNumGateValue("Test", 2, Rand(100));
            SetNumGateValue("Test", 3, Rand(100));
            SetNumGateValue("Test", 4, Rand(100));
            SetNumGateValue("Test", 5, Rand(100));
        end

        Sleep(1000);
    end
end
Regards
User avatar
admin
Site Admin
Posts: 373
Joined: Tue Nov 17, 2009 1:18 pm

Re: NumGate changes at specific date/times

Post by admin »

Hi,
No, ther isn't any limitation. But when using infinite loop like:

Code: Select all

	While (WindowIsOpen())
		// Your code
		
		Sleep(1000);
	end
don't forget to enter at least one Sleep(milliseconds) function for avoid CPU overload.

Best Regards
Post Reply