LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronized frame grab from IMAQ camera?

I'm sure this has been answered before, but I've had some difficulty finding the solution, including in the sample code provided by NI. So, here's what I'd like to do: acquire frames from an IMAQ camera at extremely precise intervals. It's very important to me that the frame acquisition rate is perfectly regular, and ideally sync'd to an external frequency source. This is the way I expect to accomplish this: - Send a TTL signal to the external TTL sync in pins on my NI camera link board (PCIe-1427) - Trigger the camera to acquire a frame via the camera link trigger line (CC0) - Create a callback event which runs when the camera signals it has acquired a frame - Using ring acquisition, the callback will acquire one frame into the ring - In a separate thread, frames from the ring will be copied and processed further How does one create a callback event, in its own thread, which runs when the camera has acquired a frame? How do we trigger this callback? I'm having some difficulty with this step. I really appreciate any input, recommendations, or links to prior solutions!!
0 Kudos
Message 1 of 5
(3,426 Views)

Hi DukeTom,

 

I think the example you are looking for is located in the NI Example Finder (in LabVIEW select Help » Find Examples) under Hardware Input and Output » IMAQ » Signal Input and Output. In here, there are many examples that sync camera acquisition via an external signal sent over the trigger line. Some of them use the ring buffer you talked about. Another option would be to use a producer/consumer architecture as seen here.

------------------------------
Bill E. | Applications Engineer | National Instruments
0 Kudos
Message 2 of 5
(3,415 Views)
I'm using LabWindows/CVI - is there an equivalent example?
0 Kudos
Message 3 of 5
(3,412 Views)

Sorry about pointing you to the LabVIEW examples- forgot I was on the LabWindows/CVI board Smiley Frustrated. Anyway, all of the IMAQ LabWindows/CVI examples can be found by going to Start » All Programs » National Instruments » Vision » Text Based Examples » NI IMAQ.

 

There are many examples in here but, I think there are a couple that should provide the desired functionality when merged.

 

For setting up the ring buffer, either the HL Ring (High Level) or the LL Ring (Low Level) examples should work. These can be found in MSVC » Ring. For the triggering, the Triggered Snap example (located under MSVC » Signal IO » Triggered Snap) should work. Merging these examples together should provide the desired functionality.

------------------------------
Bill E. | Applications Engineer | National Instruments
0 Kudos
Message 4 of 5
(3,403 Views)
Thanks for the reply. I have a working ring buffer system set up, and I have found a few triggering examples. The last part of the problem involves two steps: - Separating the threads for image acquisition and image processing, I don't yet know how to do this - Using a callback which runs when a buffer is ready to copy the image acquisition buffer to a different buffer for processing in the separate thread, I cannot figure out how to use an asynchronous triggered callback.
0 Kudos
Message 5 of 5
(3,398 Views)