04-11-2017 04:02 AM
Hi,
I have a circuit with 2 LEDs and thermistor on to measure whether the circuit needs to heat or cool. The LEDs serve as a visual indicator only. My VI works as intended until it gets into the loop within a loop as all live monitoring of the thermistor (Current temp indicator, Temperature chart) stops whilst that loop runs.
What would be a better implementation. I am very new to LabVIEW so any help and guidance would be greatly appreciated.
Thanks for your help.
04-11-2017 04:21 AM
Hi Aidan,
My VI works as intended until it gets into the loop within a loop
Yeah, that's a problem… 😄
Solution: don't use this loop-inside-of-loop construct!
What would be a better implementation.
Ever heard of state machines? LabVIEW even has examples for them! (File menu -> "New…")
04-11-2017 06:05 AM
Gosh this is difficult. Thanks for the suggestion. I see how this is the way to go but I am struggling to work it out. I think I'm over complicating it!!
04-11-2017 06:11 AM
04-11-2017 06:13 AM
Hai,
try the Attached Vi.
04-11-2017 06:43 AM
Thanks for your help but I'm using labview 2010 so I can't open the file! 😞
04-11-2017 07:38 AM
hai,
Converted to 2010
04-11-2017 08:01 AM
Hi!
Thanks for your assistance, I was so nearly there with my VI but I just couldn't get over the final hurdle. The live monitoring now works this way, but on my original VI, when the cut off temperature was reached it would wait until the the temperature dropped back to below the heater on temperature.
In this configuration, as soon as it drops back below the maximum temperature, the heater on function starts again!!
Thanks for your help!
04-11-2017 08:19 AM - edited 04-11-2017 08:20 AM
What you want is called a hysteresis loop. It only acts when it is too high, or too low. In between it just outputs the current state.
I created a subVI long ago called DeadBand that implements this functionality. This works in cooling mode and turns on a chiller when things get too hot. For heating mode, the principle is the same, you just need to swap the logic around. It is a lot less complicated than embedded case structures, and certainly embedded while loops.
04-11-2017 11:12 PM
hai,
Check it down.