Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use Timers
#11
Quote: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


Reply

#12
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



Reply

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

#14
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.
Reply

#15
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.
Reply

#16
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
Reply

#17
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.

Reply

#18
Thanks for such a detailed response
Reply

#19
Quote: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


Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.