LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write PNG file

For the path input of the List Folder, as of right now I created a constant on the block diagram and specify the folder address ( Refer to my screenshot for the error question). If I create a control, when I run the VI, it will prompt me to select the folder which contain the png images but I can't select the folder and instead I must select one of the images in it and when I did that, it returned me an error. So what must I do to allow the VI to prompt the user to select the folder that contain any png images and it would then display all the png images in the folder on the picture indicator.

Thanks.

0 Kudos
Message 31 of 38
(771 Views)

Please ignore the error post, the problem has been solved.

0 Kudos
Message 32 of 38
(765 Views)

How do I configure it so that the files passed into the array would be the first file in the folder follow by the second, the third till the last file in the folder and not randomly?

0 Kudos
Message 33 of 38
(759 Views)

How do you define what is the first file in the folder vs. the 2nd vs. the 3rd?  It seemed to give me an array of filenames that were in alphabetical order.

 

 

0 Kudos
Message 34 of 38
(756 Views)

I save the files in the folder as Graylevel 30, Graylevel 45 to Graylevel 255 so how do I configure it so that it will read the Graylevel 30 file first before the Graylevel 45 so on and so forth.

0 Kudos
Message 35 of 38
(753 Views)

Unfortunately, what you want is numerical order which is not the same as alphabetical order.

 

If you cold rename your files as Graylevel 030,  045 and 255, then alphabetical order will be the same as numerical order.

 

If you can't name the files differently, then what you could do is go through your array of names and rename the strings there to add the extra digit.  Then do a sort 1-D array to get the alphabetical order (and thus numerical order).  Then go back through that array and make the strings go back to their original names.

0 Kudos
Message 36 of 38
(749 Views)

Could you show me an example on how I could go through my array of names and rename the strings there to add the extra digit.  Then do a sort 1-D array to get the alphabetical order (and thus numerical order).  Then go back through that array and make the strings go back to their original names.

This is what I currently have.

 

png error2.png

 

Thanks 🙂

 

0 Kudos
Message 37 of 38
(746 Views)

Hi Fred,

 

it seems to me all you do is asking other people to do your own work...


fredteng wrote:This is what I currently have.

And you just present my snippet with the only extension by a path constant...

To change the filenames you have to parse the string into it's parts, change the parts and rebuild the string. Functions for that can be found in the string palette...

check.png(Just an example, there are other possible ways. Just think of the GetFileExtension.vi...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 38 of 38
(736 Views)