LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

index an array of images only the last image shows

Solved!
Go to solution

Hi everyone,

 

I try to index an array of images and all but the last element give me the error: "not an image."

 

Here is a picture of the vi. The first for loop loads the images and stores them in an auto indexed tunnel. Every diagnostic I ran on this loop showed everything is fine. The second for loop should display the sequence of image stored in the auto indexed tunnel, but it does not. Instead I have the error message that elements 0 to n-1 are not images, and only the last image is displayed.

 

Index array of image.JPG

 

What am I doing wrong?

 

Thanks for your help.

 

and the vi: 

 

 

0 Kudos
Message 1 of 6
(3,085 Views)
Solution
Accepted by topic author PAB_Az

Hello,

 

This VI worked fine for me with an input of 5 bmp files. Could you check your input files?

0 Kudos
Message 2 of 6
(3,078 Views)

Thanks to your hint I tryed on another computer and the vi works. The problem comes from the IMAQ image generation that is different from some reason. I will reinstal that part of LabView.

 

One day of work down the drain 😞

0 Kudos
Message 3 of 6
(3,069 Views)

Side-note: the way you are wiring the error clusters is not correct. You should be using shift registers for the error clusters. Make sure you initialize the shift register for the left loop with a "no error" error cluster.

 

I don't understand why you have 2 loops. It seems to me that the code for the second loop should be in the first loop, and you have just one loop. 

0 Kudos
Message 4 of 6
(3,053 Views)
Reason for the two loops is speed.
0 Kudos
Message 5 of 6
(3,051 Views)
Speed of what? The second loop can't run until the first loop is done, and all the operations are linear. I'm guessing you're referring to the perceived speed of displaying the images one after the other so you don't have to wait for the next image to be read which is why you pre-load all the images. Otherwise, the overall speed should be the same whether you use one loop or two. Actually, to be technically accurate, the two loop version will likely be a little slower overall since LabVIEW has to allocate more memory to store all the images, while in the one loop version it is only ever dealing with one image. If the images are large then you might actually run into a memory issue with the two-loop version (arrays need contiguous memory). Just something to keep in mind and to be careful about.
0 Kudos
Message 6 of 6
(3,046 Views)