I’d set your target temp before the loop instead of in it. As written, you are continually resetting the target temp during each loop.
I am not sure exactly what
@cdug619 is trying to do exactly.
If trying to set a timer for Strike and heat the water in his HLT to his target
I would do it this way:
// Time to Strike Timer
"tmr_Timer" value = 00:00:00
"tmr_Timer" type countup
"tmr_Timer" DisplayName = "TIME TO STRIKE"
"ele_HLT" Target = "glo_HLTTarget" Value
wait "sw_Strike" state == true
start "tmr_Timer"
"ele_HLT" enabled = true
// Exit Loop if Switch is False
[LoopTimetoStrike]
sleep 100
if "sw_Strike" state == false
goto "EndStrikeTimer"
endif
// Have the Switch Blink if Temp is reached
if "probe_HLT" value >= "glo_HLTTarget" Value
"sw_Strike" visibility = hidden
sleep 500
"sw_Strike" visibility = visible
sleep 2000
endif
goto "LoopTimetoStrike"
[EndStrikeTimer]
stop "tmr_Timer"
"ele_HLT" enabled = false
"sw_Strike" visibility = visible
Since you can reuse the "tmr_Timer" i generally do not do a reset but set according to the way I want the timer to act:
for Time to strike :
"tmr_Timer" value = 00:00:00
"tmr_Timer" type countup
"tmr_Timer" DisplayName = "TIME TO STRIKE"
For 90 minute Mash:
"tmr_Timer" value = 01:30:00
"tmr_Timer" type countdown
"tmr_Timer" DisplayName = "MASH"
Also about exiting Timers
wait "tmr_Timer" value
<= 00:00:00
You must use the
<= or >=.
== will NOT work.
Any timer is based upon milliseconds (which you cannot see), and since Scripts also use milliseconds to recheck something like a wait command, the timer must be exactly 00:00:00 at :0000 milliseconds at the exact same time as the check of the wait command. You likely have better odds at Powerball.
I always put a sleep 100 at the start of any loop. It makes stopping a script manually much easier.
It is such a small time it does not really effect the script, but does allow you to exit the script in the Script Pane.
[LoopTimetoStrike]
sleep 100
I also have different backgrounds for things like switches where I might have
background 1 is blue
background 2 is red
So rather than blink by visibility, I switch the backgrounds
// Have the Switch Blink if Temp is reached
if "probe_HLT" value >= "glo_HLTTarget" Value
"sw_Strike" background = 2
sleep 500
"sw_Strike" background = 1
sleep 400
endif
This has my switch blink Red and Blue after the Strike is reached.
You would need to set the
"sw_Strike" background = 1
when starting your Script and also after exiting a loop