opticaldynamics Posted March 12, 2009 Share Posted March 12, 2009 Hi, I am a beginner in any kind of scripting. I am trying to write a sequence to control the temperature of a reactor. I wish to heat until 105 C and then turn off the heat and then get down to my setpoint of 80 C by heating when temp is below 78 and stopping heat when temp is above 82. These parameters can be changed if this is not the most efficient way to do this. Here is a copy of my code so far...I can turn off the heat after 105 C but daqfactory gets hung up when i reach my switch, case statements: output = 1 private n = 0 while(1) <----Why do you have to put a 1? read(internal) waitfor(internal>105,5) while(n<4) read(internal) if(internal>105) n=n+1 endif delay(10) endwhile output=0 delay(10) endwhile read internal waitfor(internal<79,5) while(n<4) read(internal) <-----I think im being redundant here if(internal<79 n=n+1 endif delay(10) endwhile output=1 switch case(internal>82) output=0 case(internal<78) output=1 waituntil(24hrs)<------basically I want my temp at 80C for 24 hours once this temp is reached output = 0 If anyone can give me any suggestions as to what is holding up my code it would be greatly appreciated. Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.