Jump to content

System clock variable & variable math


ellesshoo

Recommended Posts

Posted

Any chance we will get access to a system clock variable, like the Linux clock in seconds (since January 1, 1970 if I remember correctly). This along with being able to perform math ops with comparisons would open up a lot.

 

For instance, right now the clock is at 1358973348 seconds. Setting a state var to the time an hour earlier:

 

then: set $usertimevar to $systime

 

 

And then having an IF condition in a different program like:

 

If $systime - $usertimevar is > 3600

 

Would be an easy way to time program executions (in this example 3600 seconds is 1 hour).

Posted

Some variable enhancements are in the pipe line, don't know about date time functions though.

 

Since you can use a wait command in a program to do this, what scenario are you seeing that a If program is not running would not work?

Posted
Some variable enhancements are in the pipe line, don't know about date time functions though.

 

Since you can use a wait command in a program to do this, what scenario are you seeing that a If program is not running would not work?

 

Scenarios where you don't want the possibility of the IF evaluating during the wait. I realize there are round about ways to accomplish almost anything but it really makes it much more complicated in the long run and very messy with multiple programs and place holding variables by not having some of these basic logic abilities available.

Posted
Some variable enhancements are in the pipe line, don't know about date time functions though.

 

Since you can use a wait command in a program to do this, what scenario are you seeing that a If program is not running would not work?

 

Scenarios where you don't want the possibility of the IF evaluating during the wait. I realize there are round about ways to accomplish almost anything but it really makes it much more complicated in the long run and very messy with multiple programs and place holding variables by not having some of these basic logic abilities available.

Posted

I like to think of the ISY as a RISC type system. it's super simple, but as you say a bit messier, but can be done versus CISC.

 

In theory couldn't we have a program that only runs the then clause and has no if to evalulate?

 

Alan

Posted

arw01

 

Sure. There is no requirement for the If section to contain statements. Something has to drive the Program execution as it will not be triggered with an empty If clause.

Archived

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

×
×
  • Create New...