Same Image Appears in all WindDraw Windows or Image Display Controls

Updated Oct 13, 2021

Reported In

Software

  • LabVIEW Full

Driver

  • NI-IMAQ

Issue Details

Using LabVIEW, I am processing multiple images and I want to display each image in a separate WindDraw window or Image Display control.

The problem is that when I use multiple IMAQ WindDraw VIs, the same image is shown in every window. The image displayed is always the last image in the process, so it seems like the last image is overwriting the others. I used a separate IMAQ Create VI for each image. 

Solution

Each time you call IMAQ Create, a new buffer or storage location in memory is allocated for an image.  When you pass an image to a WindDraw window or Image Display control, you are really just passing a reference to the image's location in memory.  If you perform multiple operations on one image without creating new image buffers, then the results of intermediate steps will be lost.

Most of the NI-Vision processing functions have inputs called Image Dst and Image Src.  If Image Dst is wired, then the processing results will be stored in the new buffer you created with IMAQ Create.  If Image Dst is not wired then the results are stored in the buffer used by Image Src, overwriting the original contents.