andrefcarvalho
New Member
I'm trying to get the code to read the conditions, after adding a maximum setpoint condition the code doesn't work for me as I want, any solution?
Code:
SYMBOL tpan = w12'variavel word temperatura de painel
SYMBOL tcil = w13'variavel word temperatura de cilindro
SYMBOL setpoint = w14'variavel word temperatura de setpoint
SYMBOL man = pinC.0 'pin man/aut
SYMBOL pump = D.2 'bomba
SYMBOL temp1 = D.0 'sensor temp painel
SYMBOL temp2 = D.1 'sensor temp cilindro
bomba:
sertxd("painel=",#tpan,"c ","cilindro=",#tcil,"c ","setpoint=",#setpoint,"c ","bomba=",#b32,13,10)
pause 50
#rem
readtemp12 temp1, tpan 'painel
let tpan = tpan*10/16 'calculo para valores positivos
readtemp12 temp2, tcil 'cilindro
let tcil = tcil*10/16 'calculo para valores positivos
#endrem
let tpan=222
let tcil=223
let setpoint=300
if tpan >= tcil and tpan <= setpoint then goto P_on
if man = 1 and tcil <= setpoint then goto P_on 'def de 1=man./ 0=aut.
if tpan <= tcil or tpan >= setpoint then goto P_off
P_on:
b32=1
low pump 'bomba ligada
goto bomba
P_off:
b32=0
high pump 'bomba desligada
goto bomba
Last edited: