12-06-2012 04:16 AM - last edited on 02-08-2013 10:09 AM by JordanG
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
12-10-2012 08:41 AM - last edited on 02-08-2013 10:08 AM by JordanG
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,
12-10-2012 10:56 AM
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.
Good luck
12-10-2012 12:11 PM
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.
12-10-2012 03:29 PM
Thanks very much for your help
12-11-2012 05:31 AM
There is a mistake in the code that I have attached. If you are planning to use it please use this.
12-12-2012 06:55 AM - last edited on 02-08-2013 10:09 AM by JordanG
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
12-12-2012 07:42 AM
You have to take the last path in the array of path to get the preview of the latest file.
01-29-2013 08:31 AM
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?
01-29-2013 09:41 AM
Check out the function Delete from array, especially the output "Deleted part", it'll give you the last element of an array.
/Y