LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For Loop, Parallel Execution of 2 Identical Cameras to Acquire Image Sequence

Hi,

 

I have built a customized LabView program that is supposed to read in 2 pressure waveforms and 1 flow waveform. Based on the flow waveform, two identical cameras are supposed to acquire images simultaneously at a user-specified flow value. Now, I do not have native triggering support in my DAQ (NI-USB 6218), so I have the program reading Y-values of the flow waveform in real-time so the case structure knows when the user-specified flow threshold has been reached. This part does not seem to have issues.

 

My main issue seems to be that once the flow threshold is reached and the case structure is triggered, I have a parallel-executing for loop for my 2 cameras that are supposed to take a single image per camera for each instance of the flow threshold being reached (flow is cyclical, so trigger should occur ~1Hz), up to a specified number of images (default is 7 images/camera). However, the very first time the flow threshold is reached, the program seems to get stuck on the camera acquisition portion. The pressure/flow waveforms will continue reading, but I won't get any images. Once I stop the program, I get an output of 7 images that are just black screens. I feel like there is probably something obvious going wrong here in the execution of my For loops, but I nothing I have tried seems to work.

 

Any advice on For loops/parallel execution/getting 1 image per flow threshold (instead of all 7 at once) would be greatly appreciated! I've attached the Main VI and the 2 relevant subVIs here.

 

-Drake

0 Kudos
Message 1 of 2
(932 Views)

@dped711 wrote:

I feel like there is probably something obvious going wrong here in the execution of my For loops, but I nothing I have tried seems to work.

 


I think your first approach was closer to achieving what you wanted. This version is full of unnecessary local variables causing nondeterministic behavior and making it impossible to debug. I'd suggest to take a step back and concentrate on the image capture since that's where the problem seems to be.

 

If you get stuck you could try the following which works for me.

Spoiler
Using a queue would be better to communicate between loops than local variables.
Creating the IMAQ images first was a step in the right direction, remember that these are just references.

snip.png
0 Kudos
Message 2 of 2
(884 Views)