Arrays of IMAQ Images in LabVIEW

Updated Apr 17, 2023

Reported In

Software

  • Vision Development Module
  • LabVIEW

Driver

  • NI-IMAQ
  • Vision Acquisition Software

Issue Details

I have built an array of IMAQ images using a For Loop, but when I try to view the array, all the images are the same. My code looks something like this:

Solution

IMAQ Create creates a space in memory to store an image and outputs a reference to that space in memory. Any operation on that image reference actually replaces the referenced image rather than creating a new one. The array of images you've created is just an array of references that all point to the same place.

To fix this issue, you should create as many references as the number of images you are expecting. The easiest way to do this is by moving IMAQ Create inside your For Loop. Make sure you give each of these images a different name.