LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to read images into an array

Hi there,

 

I hope that someone will be able to help me. I have set up a program that will set the loop count to the number of images in the folder (orange input). With each execution of the loop, I would like an image to be read from file (using IMAQ ReadFile) and then stored to an array (purple output). Please find the screenshot attached with a snip of the code in question and the error that results from executing the vi (highlights the IMAQ ReadFile vi).


I do have 5 images with the name: image0.png - image4.png in the folder directory specified by "Image Read File Path" and made sure that the path appends the actual name to the file path.

 

I am fairly new to Labview programming (I have searched for a solution and troubleshooted as much as I can) and I hope I have provided enough information.

 

Kind regards,

 

Richard

0 Kudos
Message 1 of 4
(2,731 Views)

I wonder if the extra backslash is messing up the path. "Build Path" handles the file seperator. Right click on the final path and select Probe, or create and indicator to see the path.

 

0 Kudos
Message 2 of 4
(2,718 Views)

Thank you very much for your help! That was 1 of the 2 issues. The other:

 

I did not know about the Probe but it allowed me to see that the path was incorrect since the "image%d" string constant was being appended as "image%d0" and not as "image0". Simply by removing the %d it works!

 

Regards,

 

Richard

0 Kudos
Message 3 of 4
(2,709 Views)

Sounds like you wired the "format string" into the "initial string" terminal.

http://zone.ni.com/reference/en-XX/help/371361K-01/glang/format_into_string/

Untitled.png

0 Kudos
Message 4 of 4
(2,697 Views)