LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick question about grab function in IMAQdx

First of all, thank all people who are supporting this forum. I haven't done much to help others out but I am grateful to people who are trying to help newbies like me. 

 

Here I have a quick question which I hope won't occupy much of your time. The Grab function in IMAQdx where the explanation for it says:

 

"A grab continuously acquires images into a list of buffers internally allocated by NI-IMAQdx. The user specifies the number of internal buffers in the list. Specifying a large number of buffers allows the acquisition to run at higher speeds without losing images, but a large number of buffers uses more system memory." 

 

If the grab function works continuously, why do people still use loop structure for the grab function in real applications? I also found that the grab function will retrieve the last image from the internal buffer so I think maybe that's the reason why we still have to loop it (because it only gets one image at a time). However, it leads to another big problem: if it only gets the last image, does it mean that you may lose frames? (when you call the function the camera has already captured more than one images but the grab function only gives you the last one) And is there a way to know if you are losing frames? 

 

Thank you very much!

 

Yuxuan Liu

0 Kudos
Message 1 of 3
(3,555 Views)

There are three modes of camera acquisition: Snap, Sequence and Grab based on the parameters you set:

Snap(Single Image acquisition): Continuous = 0; Buffer Count = 1

Sequence(Fixed number of images): Continuous = 0; Buffer Count > 1

Grab(Continuous acquistion): Continuous = 1; Buffer Count > 1

-Are you sure you checked the help for Grab Function or Acquisition Type? The explanation is for Grab Acquisition Type.

-The Grab Acquisition Type Consists of mainly four VIs, IMAQdx Open Camera, IMAQdx Configure Grab, IMAQdx Grab and IMAQdx Close Camera.

-IMAQdx Configure Grab Configures the Acquisition and Starts the Acquisition(These two are actually two separate Process and simplifies the job of setting up acuqisition for quick use).

-IMAQ dx Grab VI still reference to IMAQdx Get Image inside and simplifies the job of configuring the IMAQdx Get Image with Buffer Number Mode.

-Hence While loop is still required over IMAQdx Grab Function.

-Grab supports two modes for IMAQdx Grab based on the boolean you set for Wait for Next Buffer input.

-If you make it true(default) it waits for the next buffer to be ready before sending image, other case it returns the Last acquired buffer.

-The number of times you call the Grab or IMAQdx Get image retrieves the image from camera.

-If camera captures more images then you have to make sure to iterate the loop accordingly.

-If you want to identify in case you feel there are frames skipped or missed then use Low-level functions and use the Buffer number(which will be incremented for every image) and getting the difference between successive calls of IMAQdx Get Image gives whether image is lost or overwritten.

 

 

Thanks
uday
Message 2 of 3
(3,497 Views)

Thanks a lot that is very helpful. I am sure I checked all instructions for Grab function. The descriptions basically all say it will continuously grab images and you can copy the last one to user buffer, but I think I understand how they work now. Seems like using low level functions would give you more control of the camera. Thanks! 

0 Kudos
Message 3 of 3
(3,486 Views)