Comfort  Automation/ Security System Forums Home
Home Search search Menu menu Not logged in - Login | Register

How to use Timers
 Moderated by: slychiu
 New Topic   Reply   Printer Friendly 
 Rate Topic 
AuthorPost
 Posted: Thursday Nov 26th, 2009 12:11 pm
   PM  Quote  Reply 
1st Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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.

Attachment: TimerAction.jpg (Downloaded 273 times)

Last edited on Wednesday Dec 24th, 2014 07:51 am by slychiu



 Posted: Friday Nov 27th, 2009 01:25 am
   PM  Quote  Reply 
2nd Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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

Last edited on Friday Nov 27th, 2009 01:25 am by slychiu



 Posted: Friday Nov 27th, 2009 01:34 am
   PM  Quote  Reply 
3rd Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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

Attachment: If Timer.jpg (Downloaded 383 times)

Last edited on Friday Nov 27th, 2009 01:37 am by slychiu



 Posted: Friday Nov 27th, 2009 01:37 am
   PM  Quote  Reply 
4th Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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



 Posted: Thursday Aug 9th, 2012 08:09 am
   PM  Quote  Reply 
5th Post
surmall
Member
 

Joined: Thursday Aug 9th, 2012
Location: Shenzhen, China
Posts: 3
Status: 
Offline

  back to top

Got it



 Posted: Saturday Aug 11th, 2012 08:12 pm
   PM  Quote  Reply 
6th Post
palmlodge
Member
 

Joined: Thursday Dec 14th, 2006
Location: United Kingdom
Posts: 507
Status: 
Offline

  back to top

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



 Posted: Sunday Aug 12th, 2012 02:29 am
   PM  Quote  Reply 
7th Post
ident
Administrator


Joined: Wednesday Aug 9th, 2006
Location: Singapore
Posts: 3493
Status: 
Offline

  back to top

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?



 Posted: Tuesday Jun 25th, 2013 09:00 pm
   PM  Quote  Reply 
8th Post
srooks
UCM Pi Users
 

Joined: Tuesday Feb 26th, 2008
Location:  
Posts: 51
Status: 
Offline

  back to top

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



 Posted: Wednesday Jun 26th, 2013 04:39 am
   PM  Quote  Reply 
9th Post
ident
Administrator


Joined: Wednesday Aug 9th, 2006
Location: Singapore
Posts: 3493
Status: 
Offline

  back to top

There is no action to do this, but I will ask the R&D if it can be done in the future



 Posted: Wednesday Jun 26th, 2013 06:54 am
   PM  Quote  Reply 
10th Post
TheMax74
Member


Joined: Monday Jul 16th, 2007
Location: Italy
Posts: 247
Status: 
Offline

  back to top

I think PAUSE means to suspend response execution for xx seconds. Like a Threading.Thread.Sleep in response code.



 Posted: Wednesday Jun 26th, 2013 11:34 am
   PM  Quote  Reply 
11th Post
ident
Administrator


Joined: Wednesday Aug 9th, 2006
Location: Singapore
Posts: 3493
Status: 
Offline

  back to top

I think PAUSE means to suspend response execution for xx seconds. Like a Threading.Thread.Sleep in response code.

But a  Response cannot be paused. It always executes the actions and finishes. It may start a timer, but it does not wait til the timer finishes before going to the next action. A Timer action is started, then the timer is left to run  until it expires, when the Target Response is executed




 Posted: Monday Nov 25th, 2013 05:50 am
   PM  Quote  Reply 
12th Post
clubpenza
Member
 

Joined: Monday Nov 25th, 2013
Location:  
Posts: 1
Status: 
Offline

  back to top

I'd like to be able to vary the duration of a timer, based on the input from a KT03 slider control.

casino online holiday palace sbo



Last edited on Monday Nov 25th, 2013 05:51 am by clubpenza



 Posted: Monday Nov 25th, 2013 11:26 am
   PM  Quote  Reply 
13th Post
ident
Administrator


Joined: Wednesday Aug 9th, 2006
Location: Singapore
Posts: 3493
Status: 
Offline

  back to top

No, currently that is not possible
what application do you have in mind and why do you find that to be helpful?



 Posted: Wednesday Jan 15th, 2014 11:35 am
   PM  Quote  Reply 
14th Post
srooks
UCM Pi Users
 

Joined: Tuesday Feb 26th, 2008
Location:  
Posts: 51
Status: 
Offline

  back to top

You asked for an application .. in my case this would be the duration for running a sprinkler. I'd like to be able to set this duration via a KT03 slider.



 Posted: Monday Jan 20th, 2014 08:02 pm
   PM  Quote  Reply 
15th Post
siamak
Member


Joined: Monday Mar 1st, 2010
Location: Tehran, Iran
Posts: 17
Status: 
Offline

  back to top

Is it possible to do that with a response that increase/decrease a counter which is compared to zero, and two timers triggers the responses of -let it be called- countdown?
in this case the counter will be decreased by the timered responses to the point which the sprinkler runs.

Last edited on Monday Jan 20th, 2014 08:09 pm by siamak



 Posted: Wednesday Jan 22nd, 2014 04:33 pm
   PM  Quote  Reply 
16th Post
ident
Administrator


Joined: Wednesday Aug 9th, 2006
Location: Singapore
Posts: 3493
Status: 
Offline

  back to top

I could not really figure out what Siamak  was suggesting.

Possibly it would be a good idea to set a timer value from a counter, and more convenient for the user, we will look at this possibility



 Posted: Friday Jan 24th, 2014 02:39 pm
   PM  Quote  Reply 
17th Post
siamak
Member


Joined: Monday Mar 1st, 2010
Location: Tehran, Iran
Posts: 17
Status: 
Offline

  back to top

Sorry for my bad explanation, here is what was i suggesting.

Set slider (Counter000) min/max value to 20 and 100
assume that Zone02 OnResponse is SprlnklrCntDwnStrt

SprlnklrCntDwnStrt:
Copy Counter Counter000 To Counter001
Clear Flag Flag01
Do SprnklrCntDwn1


SprnklrCntDwn1 :
If Counter Counter001>= 100 And Flag Flag01 = 0 Then
   Do SprnklrRun
End If
Get Counter Counter001
Add Immediate 5
Set Counter001
Do SprnklrCntDwn2 After 2 Seconds Using Timer01

SprnklrCntDwn2:
If Counter Counter001>= 100 And Flag Flag01 = 0 Then
   Do SprnklrRun
End If
Get Counter Counter001
Add Immediate 5
Set Counter001
Do SprnklrCntDwn1 After 2 Seconds Using Timer01


Assuming an Abort switch on Zone03, Zone03 OnResponse would be AbortSprnklr

AbortSprnklr:
Stop Timer Timer01
Clear Flag Flag01



Here we have max of 32 and min of 0 seconds from Zone02 Activation to sprinkler run with 2s steps, these could be changed by simply changing the slider min/max value and 2 sec expiration times of SprnklrCntDwn1 and 2  Responses or changing the Add Immediate value. Also it could be a timer between SprlnklrCntDwnStrt and SprnklrCntDwn1 (by Do After Timer Expires) to add a fixed time before sprinkler run.

Note that if in the project it is possible for Zone02 to go Off and  On in a short time, which could be in count down time, there would be consideration to avoid repeating the countdown from start and extending the time to run the sprinkler.
Also there would be a "Time Extending" button on the keypad, simply triggering a response which sets counter001 to a fixed value.



 Posted: Saturday Jan 25th, 2014 06:07 am
   PM  Quote  Reply 
18th Post
ident
Administrator


Joined: Wednesday Aug 9th, 2006
Location: Singapore
Posts: 3493
Status: 
Offline

  back to top

Thanks for such a detailed response



 Posted: Wednesday Dec 24th, 2014 07:41 am
   PM  Quote  Reply 
19th Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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



Actually this is already possible

In the action Do Response x seconds using Timer, if the number of seconds is =0, then the last action value is used as the delay. See the example below.

Get Counter Counter003
Do Response after 0 seconds using Timer01
This means that the delay is taken from Counter 3 instead of a fixed value in the action




 Current time is 10:30 am
Top




UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems