03-07-2018 08:13 AM
Hi everyone. I am fairly new to both LabVIEW and programming in general so I found myself stuck with this problem.
I am trying to control the temperature of a water bath (CurrentTemp) to remain constant by continuously increasing or decreasing the thermostat temperature (SetTemp). The DesiredTemp is the user-defined temperature that the water bath should reach. Now, I have decided to use formula node for this, and the problem is that my code is working fine until I include a do-while loop, but then the program does nothing and the loop runs continuously. I am guessing I need a way to update the CurrentTemp acquired from the DAQ, but I lack programming skills in order to solve this. Please help!
int32 SetTemp=22;
do{
if(DesiredTemp>CurrentTemp)
SetTemp=SetTemp+1;
else if(DesiredTemp<CurrentTemp)
SetTemp=SetTemp-1;
else
SetTemp=SetTemp;
}while(DesiredTemp!=CurrentTemp);
Solved! Go to Solution.
03-07-2018 09:02 AM
Bob Schor