From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use global variable to use in one VI (2 while)?

Hello

I want control 2 while loops. a variable in first loop should control second loop and a varieble in second loop should control first loop.

(frist loop is controlled by a variable in second loop and second loop is controlled by a variable in first loop simultaneously).

 

How can I do it? Can I use global variable to use in one VI (control two while)? please explain.

 

Best Regards.

0 Kudos
Message 1 of 4
(2,472 Views)

That completely depends on what the loops are doing.  Do you care about every data point that is sent between the two loops?  Are the loops supposed to wait for their control variable?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(2,457 Views)

yes, we have wait or time of 2 while are diffrence. and maybe I need to all data produce in two while.

 

Best Regards

0 Kudos
Message 3 of 4
(2,450 Views)

If you have to wait for the new data to come in, then use a Notifier or a Queue.  A queue is a FIFO, so you can process each sample that is transferred.  A notifier only keeps the last value.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 4
(2,431 Views)