From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI-IMAQ Memory Allocation


This document explains how NI-IMAQ allocates memory for image acquisition. It also discusses buffer allocations.


The IMAQ Create VI creates a pointer to an uninitialized IMAQ buffer of zero length. The actual memory allocation for image acquisition is done by the IMAQ Configure Buffer VI. This VI should be called in low level programming after the board is configured by the IMAQ Init VI and before the image is acquired. The IMAQ Configure Buffer VI resizes the IMAQ buffer based on the board configuration and camera format. If you are using the high level IMAQ calls (IMAQ Snap, IMAQ Grab Setup, or IMAQ Sequence), then the IMAQ Configure Buffer VI is called internally. Buffer configuration is also done internally for the IMAQ ReadFile VI.

The image reference data type in LabVIEW contains a pointer to an internal LabVIEW structure, not to the buffer itself. To get the actual buffer, the IMAQ GetImagePixelPtr VI returns the pointer to the image memory location. The image is stored in memory from top left to bottom right.

For example, the pixel referred to by column 0 and row 0 is the pixel in the top left-hand corner of the image. The online help for GetImagePixelPtr VI contains additional information on how the image data is organized in memory. This VI returns all the information you need to know to access the image data properly (if you need to pass an image to a DLL, for example).

Buffer allocations are actually managed entirely by the operating system. Although it is guaranteed that a single buffer will have a contiguous block of memory, it is unknown where corresponding buffers will be located in memory. However, the relative location of these buffers in the buffer list has no performance impact on accessing the images because solid state RAM can access any physical address within the same amount of time.


Additional Resources

Was this information helpful?