Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use Timers
#1
Note that there is a new and easier way to introduce delays between actions, see  http://www.comfortforums.com/forum92/4062.html

Comfort II Ultra as 32 user Timers which can be used to implement delays from a Response to another.

The format of the Timer action is as follows;

\"Do Response X after Y seconds using Timer Z\"

This means that Timer Z (1 to 32) is started for a duration of Y seconds (1 to 65534 seconds) at the end of which, Response X is activated

Important:
Note that the Timer action merely starts the timer, the action does not wait for the timer to expire, for example

Response 123
Output 1 ON
Do Response 200 after 60 seconds using Timer 20
Output 2 ON
End of response

Response 200
Output 3 ON
End of Response


When Response 123 is activated, Output 1 will turn on, Timer 20 is started, and Output 2 is turned on. This means Output 1 and 2 will appearr to turn on almost simultaneously.  Output 3 will turn on after 60 seconds

Some may have the wrong idea that Output 1 turns on, then after a delay of 60 seconds Response 200 is activated, then only output 2 turns on. This is incorrect.

There is no delay by actions within a Response. All actions are executed one after the other


There is a topic  on how to Flash lights during an alarm in http://www.comfortforums.com/forum83/1681.html
This is a good example of the use of timers and how useful they can be.


Attached Files Thumbnail(s)
   
Reply
#2
Another important thing to know is that there can only be one instance of a timer running at any time. if you  use a timer you will stop the timer if it is already running

For Example, the Response

Do Response X after 20 seconds using Timer 1
Do Response Y after  10 seconds using Timer 1
Do Response Z after  5 seconds using Timer 1

will result in Response Z after 5 seconds. Response X and Y will not get activated because Timer 1 is restarted and reloaded with Response Y in the second line, and then immediately restarted and reloaded with Response Z in the 3rd line

If the intention is to do all three Responses after the delays then use different timer, eg
Do Response X after 20 seconds using Timer 1
Do Response Y after  10 seconds using Timer 2
Do Response Z after  5 seconds using Timer 3
Reply
#3
Checking if a Timer is Running

You can check if a timer is running in the Response Wizard
eg

If Timer Timer05 <> 0 Then
    Do Response..
    ...
End If

TimerX <> 0  means the timer is running
TimerX = 0 means the timer is stopped


Attached Files Thumbnail(s)
   
Reply
#4
Stop Timer

You can stop a timer using the Stop Timer Action. This prevents the Timer Response at the end of the timer from working

eg, a Response starts a timer

Do Response X after 60 seconds using Timer 20

If before the timer is finishethe response below is activated

Stop Timer 20

This stops the timer 20 and hence Response X will not work
Reply
#5
Got it
Reply
#6
Ideas for future releases

1. A Pause command so you don\'t have to create many many responses

2. A user \"Any free timer not running\" option rather than choosing one
Reply
#7
How would you use the pause command? What does it pause?

\"any free timer\" - you dont really save much time by not selecting a specific timer?
Do you have an example of what Response you are trying to write?
Reply
#8
Is it possible to set the duration of a timer from a counter? I\'d like to be able to vary the duration of a timer, based on the input from a KT03 slider control.

S
Reply
#9
There is no action to do this, but I will ask the R&D if it can be done in the future
Reply
#10
I think PAUSE means to suspend response execution for xx seconds. Like a Threading.Thread.Sleep in response code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)