Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Multithreaded/Asynchronous Image Acquisition in VB

The IMAQ has this nice ring buffer and I'd like to use it for asynchronous image acquisition in a multithreaded manner.
How do I tell IMAQ that a buffer is done can be overwritten ? How do I tell IMAQ that a buffer is not done and shouldn't overwritten ?

Also when I use large number of ring buffers, the display is stopped until the acquisition is completed. How do make sure the display is live when I use large ring buffer ?

The last question, I'd like to also save some parameters when I use SaveToDisk to save image data. Where should I store these parameters ? CWIMAQImage don't provide any pixel access, so I can't even store these parameters in the image data.

Thanks for your help.
0 Kudos
Message 1 of 2
(5,728 Views)
Most of your questions regarding buffers and ring acquisitions are answered in the NI Developer Zone Tutorial called "Ring Acquisitions" at http://zone.ni.com/devzone/conceptd.nsf/webmain/487D3523EAA8255686256BB90076BF70?OpenDocument. To prevent a buffer from being overwritten use the ExtractImage method, and if you specify a buffer number that is currently in the buffer list, that buffer is locked out and cannot be overwritten. One of the parameters of CWIMAQ.ExtractImage is ImageIndex, which is the index of the image in the images collection that you locked out of the acquisition. Call the ReleaseImage method to insert the image back into the acquisition and allow the buffer to be overwritten.

I'm not sure what other parameters you want to save with your imag
e data, but what you may be looking for is the WriteImageAndVisionInfo method. This method allows you to save extra vision information associated with an image, including overlay information, pattern matching template information, and calibration information, to a PNG file.

If you haven't already seen it, you may also want to take at look at the tutorial, "IMAQ Acquisition, Images, and Displaying in Visual Basic" at http://zone.ni.com/devzone/conceptd.nsf/webmain/CC000BEB997FE1A186256B5D00823AB9?opendocument#3.

Hope this helps. Good luck!
0 Kudos
Message 2 of 2
(5,728 Views)