LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sync of Multiple While loops

Solved!
Go to solution

Hi All,

I'm working with 4 while loops which are independent of each other i.e., there is no data flow from any loop to another.

I noticed that each while loop takes different time to complete one iteration.

However i want all the while loops to start and finish at the same time after each iteration. 

How do I sync them?

Thank You for your reply.

Regards

Aveo

0 Kudos
Message 1 of 11
(5,143 Views)
Solution
Accepted by topic author aveo

Hi Aveo,

 

you could use some "Occurances", "Notifier", or "Rendesvouz" to sync your while loops.

 

Or use timed while loops - they can run in sync...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 11
(5,136 Views)

Aveo,

 

I don't think there is a useful way to synchronize while loops. Why don't you put all the code into one loop?

 

Cheers

Edgar

Message 3 of 11
(5,133 Views)

Can u share more details of what ur attempting to syncronize?

The loops will need have the same execution rate (Timing)? or only need have the same number of iterations?

Can u provide more information about the functions that are inside of the loop?

Can u tell about the elements ur using to "trigger" that loops to start?  and to end?

 

Can u show some code? :[

 

0 Kudos
Message 4 of 11
(5,128 Views)
I agree with ejkaiser...!!
Why specifically are you running (or want to run as) four different parallel loops.

 


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 5 of 11
(5,112 Views)

Hi,

Thank you all for your replies.

Putting all the code into a single loop is a good idea. But i cannot use it in my application.

I want to processing 4 sets of images simultaneously(The same object is captured from 4 different angles. All the images need to be processed at the same time for drawing a conclusion).

Also To increase the execution speed, i am planning to put them into individual loop and assign a processor to each loop.

This will not be possible if i put everything into a single loop. 

I think the use of "rendezvous" or "notifier" with timed loops might work out.

Shall try it now.

Regards

Aveo

Message 6 of 11
(5,052 Views)

Hi,

Thank you for your reply.

I think your idea will work out.

I have one request. I have never worked with a timed loop or "rendezvous".

Will it be possible for me to get a example for them?

Thanks

Aveo

0 Kudos
Message 7 of 11
(5,050 Views)

Aveo,

 

You may not need separate loops and you may not need to assign them to separate processors.  LabVIEW's internal scheduler can do that when tasks are not dependent on each other. NI has put much effort into improving the performance of parallel calculations.

 

What you need to do is to make sure that there are no data dependencies between the parts you want to do in parallel. You may also need to make subVIs reentrant.

 

Please post your code. Some particpants on the Forum are very good a optimizing performance.

 

Lynn

0 Kudos
Message 8 of 11
(4,995 Views)

@johnsold wrote:

Some particpants on the Forum are very good a optimizing performance.



Would you say some participants are "wizards" at optimizing performance? Smiley Wink

Message 9 of 11
(4,984 Views)

That is a magickal way of expressing it.

 

Lynn

0 Kudos
Message 10 of 11
(4,982 Views)