LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Identify latest update

Hello,

 

I am a student and I am working on a project that my final target is to use labview to send images via ZigBee module. As a first step I want to develop a code that will identify from a folder that will include images the latest update(I mean if I have five pictures number from 1 to 5 to post in labview number 5) and preview it on labview. I have develop a code that just preview the images but you have to determine which image it preview. Can you help me with that?

 

Thanks in advance

 

0 Kudos
Message 1 of 12
(4,431 Views)

Hi,

 

Thank you for your post and welcome to the NI Forums.

 

Just to clarify, you are collecting a number of images and wish to use LabVIEW to display only the last image collected. The images will be named uniformly (e.g. image1, image2, image3...).

 

I would start by using the function "List Folder" to list the names of all files in a specified folder. You can then use string functions to determine which name ends with the number you require (or simply the highest number) and use this to then preview the image.

 

Many thanks,

 

 

Eden S
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 12
(4,373 Views)

You have the File/Directory info which gives you the time stamp where a modification is done or newly created. You can use the list folder function and check the file info of each file and sort the files to the latest. Attached is an example for getting the latest files in order.

 

List Latest files.png

 

Good luck

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 12
(4,357 Views)

Is there any sort of naming convention in place that would help? Specifically, is a timestamp included in the file name anywhere? If so, the solution could be as simple as sorting the list of file names and picking the last one.

 

Mike...

 

BTW: This sort of naming convention is always a good idea because it let's you quickly identify when an image (or dataset) was taken.


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 12
(4,346 Views)

Thanks very much for your help

0 Kudos
Message 5 of 12
(4,332 Views)

There is a mistake in the code that I have attached. If you are planning to use it please use this.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 6 of 12
(4,317 Views)

Hello, thanks a lot for the code. Can you help me with this now? I have two codes the one that you gave me and the other that i have develop. Your find the latest update and mine preview an image from a foder. How can i connect this two in order when i run the program to sort the image and then preview the image

 

Thanks

 

0 Kudos
Message 7 of 12
(4,295 Views)

You have to take the last path in the array of path to get the preview of the latest file.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 8 of 12
(4,285 Views)

Hello

 

I still cant do what i need to do.. i cant connect your code with mine in order to examine a folder and then preview the image. can you please help me?

0 Kudos
Message 9 of 12
(4,220 Views)

Check out the function Delete from array, especially the output "Deleted part", it'll give you the last element of an array.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 12
(4,215 Views)