I am currently making a vi, which continuously monitors a temperature using a thermistor and using a DAQ board and a transistor to turn on and off a USB fan depending on the temperature. I want the vi to turn on the fan once the temperature exceeds a certain value but not turn off until it has fallen much lower than the initial critical temperature. To implement this, I thought of using a while loop and hoped to continuously run a comparison within the loop to see if the temperature ever exceeds the value. However, debugging told me that once a value of the temperature reading enters the while loop, it cannot receive the next value of the temperature reading. The while loop is stuck in an infinite loop because even the the data wire is connected into the loop, the loop cannot update the value for comparison. Is there another way where I can continuously update a number, or I should say a variable, within a while loop after each iteration? I thought of shift register, but I think that is only for cumulative sum.
Edit: I've uploaded a screenshot of the vi. The screenshot has a stacked sequence with a case structure. Originally, this was a while loop, but when I saw that it didn't work, I tried this method, which also didn't work. Is measuring temperature within the while loop the only way?