Managing Buffers

NI IMAQ

Managing Buffers

NI-IMAQ can automatically perform buffer management, or you can perform buffer management manually. If the high-level acquisition routines (imgSnap, imgGrab, imgSequenceSetup, and imgRingSetup) are initialized with NULL pointers for buffer addresses, NI-IMAQ automatically allocates a buffer and returns the value of the buffer pointer. After you obtain a buffer pointer, you can use this pointer in successive calls.

For greater control of the acquisition buffers, create buffers with a memory allocation routine (for example, malloc) or use the low-level function imgCreateBuffer. When creating buffers using either approach, dispose of the buffers using free or imgDisposeBuffer when applicable to free PC memory.