LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using IMAQ Create in a parallel for loop

Hello all,

 

I'm doing some image processing within a for loop. The loop runs to carry out the same process on all videos in a certain folder. I'm trying to figure out a way to configure the loop for parrallelism to speed up processing (since each video is independent of the rest). The idea is to be processing 8 videos at one time instead of sequentially. The problem I'm encountering however is that the IMAQ Create VIs are in the loop so the memory locations are continiously overridden by another instance of the loop. How would I make sure that each loop had its own memory location for storing the images?

 

I attached my VI (with for loop parallelism disabled).

 

I appreciate any advice.

 

Thanks!

0 Kudos
Message 1 of 5
(3,216 Views)

I can't open your 2014 VI at the moment 'cause I'm neck deep in a 2013 project but I believe what you need is to make the called VI "reentrant".  Each instance should have it's own data space.

0 Kudos
Message 2 of 5
(3,197 Views)

Just glancing at your code, it appears the easiest thing to do would be just making the name of the buffer vary on each loop iteration (tied to the iteration terminal, for example). That way you aren't duplicating buffer names.

--------------------------------------
0 Kudos
Message 3 of 5
(3,139 Views)

I actually thought about that. I think that is a good idea. I'll probably end up doing it.

 

Thanks!

0 Kudos
Message 4 of 5
(3,125 Views)

If each parallel worker needs his own image (ala a scratch image), you can right click the "P" box on the parallel for loop structure.  Then change the output of the "P" box to current instance ID.  Use this ID in creating the image name, and you will have a unique image for each parallel worker.

 

-D

0 Kudos
Message 5 of 5
(2,708 Views)