LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lag in image capture triggered by waveform

Hello,

 

I am a self-taught Labview user (i.e. novice) and I have an issue with lag in image acquisition based on a particular waveform value. The program I made controls analog input to read 3 waveforms (2 pressure signals and 1 flow signal), write an analog output (motor controller), and start a digital pulse train as a "homemade" trigger to cause two cameras to acquire images based on a user-specified pressure value threshold. The program runs smoothly as long as the image acquisition is turned off. 

 

My initial thoughts were 1) identifying a better way to trigger image acquisition or 2) moving the part of the program that saves the images to be not simultaneous with the rest of the program. My problem is that I don't know the best way to do either of those. I've attached my main VI and sub VIs that are called by the main program. Also, I my DAQ is a USB-6218 BNC, and so doesn't support native triggering. Any help would be very much appreciated!

 

dped711

0 Kudos
Message 1 of 3
(728 Views)

Hi,

 

A few things that stick out:

  • Your cam1_acquire.vi and cam2_acquire.vi seem to be identical. A single re-entrant VI would suffice.
  • You can give each queue consumer its own loop, but this probably won't that much of an impact since images are captured in tandem.
  • You are only using 1 image buffer per camera, if the consumer loop can't keep up with the producer you will lose frames/create duplicates. Is this what you meant by lag?

Solution for 3rd point: create a new buffer for each frame you capture (move IMAQ create inside the case structure), the image name must be unique so it's best to use the loop index. Dispose of the buffers after they are written to file. Enable snapshot in context menu on the image indicators to retain the last image even after the buffer is deleted.

0 Kudos
Message 2 of 3
(677 Views)

Hi Ramon,

 

Thank you for your reply! Sorry this has taken so long to get back to you, but after trying several ways of implementing the changes you suggested, I more or less overhauled the program to work in a different way. It still has some problems but not the same ones it had in my original post. I have actually created another thread for those specific problems found here: https://forums.ni.com/t5/LabVIEW/For-Loop-Parallel-Execution-of-2-Identical-Cameras-to-Acquire/m-p/4...

 

Again, thanks for your reply and advice!

 

Drake

0 Kudos
Message 3 of 3
(639 Views)