LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to load ONE file automatically from a folder containing sequential files?

Solved!
Go to solution

I have pictures that is taken every 2 or 3 minutes and then dumped into a file folder with sequentail number as file names.

 

Now I want to find a routine to automatically check the last picture and load it into labview.

 

Please be aware that I already have other hardware to acquire images and store them in the computer, any advice with using other I/O device is appreciated , but not needed.

 

Task is simpel! (hopfully for you.)  Only need to find the latest file in a fixed folder and open it by labview (e.g., by read JEPG file.vi ).  any insights?

 

Thanks!

 

 

 

0 Kudos
Message 1 of 10
(2,990 Views)
If it contains ONLY sequential images you can use the File/Directory Info vi.  This returns the number of files in the folder.  If your files start at 0, subtract one from this value and use it as your file name.  You may need to append a .jpg or whatever also.
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 2 of 10
(2,982 Views)

See if the accepted solution here http://forums.ni.com/ni/board/message?board.id=170&message.id=385845&query.id=269818#M385845 may help you. You have to modify it, so it is only ment as push in the right direction.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 10
(2,972 Views)

Thanks, Tim.

 

My file's names are like this

 

...

picture 32.jpg

picture 33.jpg

picture 34.jpg

...

 

It's not always start with number 0.

The directory vi. that you ponited out will tell me weather there is a new file being written into the specified folder,

I wonder if there is another vi that can read the last file?

 

Raymond

 

0 Kudos
Message 4 of 10
(2,952 Views)

If you find that file, you can read it yes 😉

Se picture



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 10
(2,949 Views)
Solution
Accepted by Raymond99

I wrote a VI to find the newest file (well, last modified file) in a given folder.

Message Edited by elset191 on 06-05-2009 09:08 AM
--
Tim Elsey
Certified LabVIEW Architect
Download All
0 Kudos
Message 6 of 10
(2,937 Views)

Tim,

 

I also figured out, it's a bit different with your but it does the job.

 

Thanks for the help.

 

 

automatic load last file.png

 

 

 

Raymond

 

 

0 Kudos
Message 7 of 10
(2,927 Views)
your link is quit usefull too.
0 Kudos
Message 8 of 10
(2,923 Views)

Because List Array returns files alphabetically I think you will run into problems with your version if you have files Picture 99.jpg and Picture 100.jpg or things like this.

 

 Logically 100 was saved after 99, but your vi will return 99

Message Edited by elset191 on 06-05-2009 10:10 AM
--
Tim Elsey
Certified LabVIEW Architect
Message 9 of 10
(2,922 Views)

Tim, you're right, my code only works when picture's name has number less than 99, I switched to you code and it works well.    Raymond

 

0 Kudos
Message 10 of 10
(2,875 Views)