satwar Posted September 26, 2012 Posted September 26, 2012 I want to be able to start a timer and read it's status in a small program.
Xathros Posted September 26, 2012 Posted September 26, 2012 satwar- No. But this functionality can be achieved with a few small programs depending on the resolution you are looking for. Anything more granular than 1 second is unlikely. Minutes are easy. Here is an example: Define a state var for your timer value s.Timer = 10 Program: Timer Countdown If s.Timer > 0 Then wait 1 minute s.Timer =- 1 Else The value of s.Timer will decrement once per minute. Program: Timer Expired If Status LampLincDimmer is On And s.Timer =0 Then Set LamplincDimmer Off Else -Xathros
Xathros Posted September 26, 2012 Posted September 26, 2012 satwar- I should point out that the Wait function is really a countdown timer but unless used in conjunction with a counter variable as in the example above, there is no way to check on it's progress. I could have achieved the same result with: If Status LamplincDimmer is not Off Then Wait 10 minutes Set LampLincDimmer Off Else Only difference here is that we can't tell how much of the timer remains during the 10 minute delay. -Xathros
satwar Posted September 26, 2012 Author Posted September 26, 2012 Your first example was perfect for my project. I run a macro in mControl which writes a starting value (60 minutes) for S.Timer in ISY. ISY executes the countdown function. ISY uses countdown timer value to make further decisions. Worked perfectly.
Recommended Posts