LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Beginner question: How to better structure Arduino loop to allow continuous reading

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.

0 Kudos
Message 1 of 10
(3,717 Views)

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…")

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(3,703 Views)

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!!

0 Kudos
Message 3 of 10
(3,665 Views)

Hi Aidan,

 

Gosh this is difficult.

It becomes much easier once you start to work with flowcharts - before doing the actual programming!

Create your algorithm on a sheet of paper, then do the programming…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(3,661 Views)

Hai,

try the Attached Vi.

 

 

0 Kudos
Message 5 of 10
(3,659 Views)

Thanks for your help but I'm using labview 2010 so I can't open the file! 😞

0 Kudos
Message 6 of 10
(3,646 Views)

hai,

Converted to 2010

 

0 Kudos
Message 7 of 10
(3,636 Views)

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!

0 Kudos
Message 8 of 10
(3,628 Views)

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.

0 Kudos
Message 9 of 10
(3,623 Views)

hai,

 

Check it down.

0 Kudos
Message 10 of 10
(3,595 Views)