LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Confusion with 2 while loops

I have two while loops running.  One triggers an external relay board that has various resistors wired in.  Its function is to apply different resistances to a power source at predetermined times.  The second loop measures the voltage change on a graph and writes to a file.  I have included in a sub vi in the second loop for a numerical input that will be filled in by the iteration of the first loop thus giving me the voltage and resistor number in the text file output.

The problem I'm having is when I try to connect the iteration of the relay loop to the numerical input of the voltmeter loop, the voltmeter loop will ignore that input until the last time it finishes its own loop.

Is there any way to introduce this input into a loop while it's running?

Sorry if this sounds confusing but I am very new to Labview and have learned a lot so far.  I'm sure this is something simple that I am overlooking.
0 Kudos
Message 1 of 3
(2,746 Views)
Hi eajohnson,

to move data from one loop to the other you can use:
1) local variables, when loops are in the same vi (beware of race conditions and memory consumption!)
2) global variables, when loops are in different vis (beware of race conditions and memory consumption!)
3) queues
4) action engines aka LV2-style globals

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,743 Views)
Haha!  Awesome!  Like I said, I am new to this and the learning curve is getting to the fun part now where lights are turning on.

Thanks!!!
0 Kudos
Message 3 of 3
(2,735 Views)