Page 1 of 1

Re: NumGate changes at specific date/times

Posted: Thu Jul 09, 2015 8:23 am
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

Re: NumGate changes at specific date/times

Posted: Thu Jul 09, 2015 1:39 pm
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