TIMER for electrical floor heating
Hello guys.
i need to use a timer for controlling electrical floor heating.
I need the heating to run 30 min, 30 min break, run 30 min, 30 min break and so on, as long as the client wants.
i don't know how to program a timer.
i was thinking to use something like this :
while heat_desire=1 and heater_on and 30 min have not past, keep the heating running
if 30 min have past, stop heating for 30 min.
this cycle must repeat forever
i need to use a timer for controlling electrical floor heating.
I need the heating to run 30 min, 30 min break, run 30 min, 30 min break and so on, as long as the client wants.
i don't know how to program a timer.
i was thinking to use something like this :
while heat_desire=1 and heater_on and 30 min have not past, keep the heating running
if 30 min have past, stop heating for 30 min.
this cycle must repeat forever
0
Comments
DEFINE_DEVICE dvTP = 10001:1:0 DEFINE_VARIABLE // we'll setup 2 different wait times so we can adjust the modulation if need be VOLATILE INTEGER nHeatCycleOnTime = 18000 // 30 minute VOLATILE INTEGER nHeatCycleOffTime = 18000 // 30 minute VOLATILE INTEGER nHeatCycleEnable // 1 = heat cycle is enabled DEFINE_FUNCTION fnHeatOn() { // do whatever to turn the heat on } DEFINE_FUNCTION fnHeatOff() { // do whatever to turn the heat off } DEFINE_FUNCTION fnHeatCycleOn() { fnCancelHeatWaits() fnHeatOn() IF (nHeatCycleEnable) { WAIT nHeatCycleOnTime 'HEAT OFF' { fnHeatCycleOff() } } } DEFINE_FUNCTION fnHeatCycleOff() { fnCancelHeatWaits() fnHeatOff() IF (nHeatCycleEnable) { WAIT nHeatCycleOffTime 'HEAT ON' { fnHeatCycleOn() } } } DEFINE_FUNCTION fnCancelHeatWaits() { CANCEL_WAIT 'HEAT ON' CANCEL_WAIT 'HEAT OFF' } DEFINE_EVENT BUTTON_EVENT[dvTP,1] { // heat cycle enable/disable PUSH: { nHeatCycleEnable = !nHeatCycleEnable IF (nHeatCycleEnable) { fnHeatCycleOn() } ELSE { fnCancelHeatWaits() } [dvTP,1] = nHeatCycleEnable } }