LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to let two independent while loops run together

Solved!
Go to solution

Hi,

I have a while loop for image acquisition in remote system(PXI). Another while loop will save data parallel with the first one through shared variable in host computer. But the first loop for image acquisiton have to wait for trigger. Therefor the two loops cannot start at the same time. Is there any idea to solve this problem? Thanks in advance.

0 Kudos
Message 1 of 5
(4,115 Views)

There are multiple ways, queues notifiers or occurences. Seems like an occurence would work well for this but without seeing the code it is hard to tell. You may wan't a queue or a notifier instead, depending on what else is happening in your program.

 

Edit: misread your post and my answer above may not be correct for your situation. I assumed the loops were running in parallel on one PC

0 Kudos
Message 2 of 5
(4,109 Views)

The two loops are runnung in parallel on two PC. So I was consuming how to transfer a occrence from one computer to another computer.

0 Kudos
Message 3 of 5
(4,099 Views)
Solution
Accepted by topic author Guo Zhongge

Hi,

 

you could use a shared variable with a boolean value. The variable is default on false. When the first loop starts the variable is set to true. The other PC reads the shared variable an waits until its true. Now the other loop starts.

 

But you still have the delay of the network, so its not possible that the loops start exact at the same time.

0 Kudos
Message 4 of 5
(4,054 Views)

hi

 

File>New

 

then please see the VIs from VI template

 

17557iC23500D5F5841333

 

RENN

Kudos always welcome for helpful posts 🙂
0 Kudos
Message 5 of 5
(4,044 Views)