CJVann Posted January 21, 2012 Posted January 21, 2012 I want the following program to increment an $Uptime_hrs Integer variable once per hour. I created an $Always_TRUE integer variable that =1 at init, and current value = 1 (so the program will always be true and run). The program shows "True", "Enabled", and "Idle" with no Last Run Time, and no Next Scheduled Run. What am I missing? Is it because $Always_TRUE hasn't changed values (to trigger the program)? Hum, and perhaps it needs to be a State variable, or does it matter since it never changes. So, what's the best way (besides run at startup) to ensure a program always runs? Maybe create another program that runs this program's THEN of this program... so it doesn't depend on an IF statement to force it to run. If $Always_TRUE is 1 Then Repeat Every 1 hour $Uptime_hrs += 1
LeeG Posted January 21, 2012 Posted January 21, 2012 This Program will not run on its own because the variable in the If is an Integer variable. Integer variables never trigger Programs. It can be set to Run at Startup or another Program with Run at Startup can run this Program. Do not see an advantage of having a second program.
CJVann Posted January 22, 2012 Author Posted January 22, 2012 Thanks - So if a program is set to run at startup, the trigger is the ISY startup, and it will evaluate integer variables in the IF statement as either true (Run THEN) or false (Run ELSE). But you still need the startup to evalute a "true" or "False" in the IF statement, so that's where the Always_TRUE integer comes into play.
Recommended Posts