Run daily at specific time?
bob
Posts: 296
Hi there, What is the best method to run a Netinx function daily at a specific time?
0
Comments
so a simple
if(time='12:30:54')
{
// do something
}
will get the gig done. bear in mind, that this statement will be true several thousand times in mainline. So, you'll need to put something in there to make it fire only once. Or better yet do it up in an event or function.
IF ((TIME == '16:10:00') AND (nDaily))
{
nDaily = FALSE; // execute only once
DailyFunction();
}
ELSE
nDaily = TRUE;
I tend to give advice on the forum with the 'theory' or 'concept of how to do something' in mind. At no time should anyone take any of my code seriously. I certainly don't.
I had a similar situation, I needed to power off the projectors at certain times, either you can read this link or try this code. I know it works and is a simple code, just do not forget to put wait, because if you don't it will send the same string like 10000 time and it might freeze the device, like in my case the projector would go into stand by.
http://www.amxforums.com/showthread.php?3470-Commands-at-Certain-Times&highlight=COMPARE_STRING
(***********************************************************)
(* THE ACTUAL PROGRAM GOES BELOW *)
(***********************************************************)
DEFINE_PROGRAM
(******************Shutdown**************)
IF (TIME='22:30:00')
{
wait 11
SEND_STRING dvProjector,"$02,'POF',$03";
}
(***********************************************************)
(* END OF PROGRAM *)
(* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
(***********************************************************)