Jump to content

"Uptime" program isn't updating


CJVann

Recommended Posts

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

Link to comment

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.

Link to comment

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.

Link to comment

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.3k
×
×
  • Create New...