Sorry I'm still not really grasping the concept;
my current code looks simular to this

in picaxe
readtemp 0, b0 'storage cell 1 temp
readtemp 1, b1 'storage cell 2 temp

start:
let b0=b0+30 'simulate 30 degree celcius offset
if b0>b1 then 'check if storage cell 1 is more than cell 2
high 3 'open solenoid to transfer
endif
let b0=b0-30 'return b0 to true reading

in picbasic ive written it roughly like this but unsure how to do the readtemp part or i'm possibly completely wrong all together?
trisb.0=1
trisb.1=1

cell1temp var portb.0
cell2temp var portb.1
solenoid var portb.3
start:
let cell1temp = cell1temp +30
if cell1temp > cell2temp then
high solenoid
endif
let cell1temp = cell1temp - 30