;We skip this if the heaters are no longer being controlled manually (if the final temperature has been reached). If ((coolrate gt ramp_trigger) and (coolraterate gt 0)and(manualcontrol eq 1)) then begin ; If we have increased the heater five times in a row then increase the increment ; to 2% if (heaterincreased ge 5)then begin heaterdelta= 2 endif else begin heaterdelta =1 endelse ; add heaterdelta to heater output if ( (*loop1_hout)[arraypos] le (100-heaterdelta)) then heatout= (*loop1_hout)[arraypos]+heaterdelta ; set manual heater output value a=idtl('lsh MOUT '+strtrim(string(loopnumber1),2)+','+strtrim(string(heatout),2)) c1heaterval=fix(idtl('lsh MOUT? '+strtrim(string(loopnumber1),2))) print,'New Heater value (increasing heater output)=',c1heaterval heaterincreased = heaterincreased + 1 endif else begin ;We skip this if the heaters are no longer being controlled manually (if the final temperature ;has already been reached). heaterincreased = 0 if ((coolrate lt mincooldownrate)and(coolraterate lt 0)and(manualcontrol eq 1)) then begin ; If we have decreased the heater five times in a row then increase the increment ; to 2% if (heaterdecreased ge 5)then begin heaterdelta=2 endif else begin heaterdelta =1 endelse if ( (*loop1_hout)[arraypos] ge heaterdelta) then heatout=(*loop1_hout)[arraypos]-heaterdelta ; set manual output value a=idtl('lsh MOUT '+strtrim(string(loopnumber1),2)+','+strtrim(string(heatout),2)) c1heaterval=fix(idtl('lsh MOUT? '+strtrim(string(loopnumber1),2))) print,'New Heater value (decreasing heater output)=',c1heaterval heaterdecreased = heaterdecreased + 1 endif else begin heaterdecreased = 0 endelse endelse