06-21-2016 08:45 AM
Hello I have a script which can capture and save images, but are required to name each indiviual image. Is there a way so that when I click 'capture' the image is automatically saved at the destination folder? I will be taking multiple images at one sitting and so need the names of the images to increase numerically i.e 001, 002 etc.
06-21-2016 09:41 AM
One way to do this would be to learn how to use the File I/O functions and wean yourself from the File Dialog Express VI. Studying these VIs might bring you to ask "What is this Create File with Incrementing Suffix VI?".
Bob Schor
06-21-2016 10:42 AM
Hello I have attempted to incorporate the 'Create File with Incrementing Suffix VI' but can not seem to get it to work. Can you describe the steps or link an example I can go off?
Thanks
06-21-2016 01:00 PM
The "Create File with Incremented Suffix" VI usually handles everything pretty well on its own. There's not much additional configuration that is needed. Are you getting a specific error? How exactly is it not working?
Here's a page on the basics of this VI. Maybe that will be helpful. http://zone.ni.com/reference/en-XX/help/371361M-01/glang/create_file_with_incrementing_suffix/
-Zhenya
06-22-2016 02:37 AM
@navman74 wrote:Hello I have a script which can capture and save images, but are required to name each indiviual image. Is there a way so that when I click 'capture' the image is automatically saved at the destination folder? I will be taking multiple images at one sitting and so need the names of the images to increase numerically i.e 001, 002 etc.
Use Shif register and Create the Numeric Increment based on Loop Iteration
Use the Incremented Numeric value and Build the path dynamically to store the images
06-22-2016 03:20 AM
Hello namvan74,
Here is a small and really simple example showing you how to use the increment suffix. You just need to implement it to your code.
I'll add the .vi and a screenshot of what I did in just a minute. Please note that you have to specify the file path for the "first file" where you save the image for the file path control in the LabVIEW Front Panel.
Hopefully this helps you succeed with your .vi!
Best regards,
Jarmo Levo
Applications Engineer
National Instruments
06-22-2016 04:48 AM
Hello Jarmo
Can I use the 'write to text file' vi since I will be saving images? I've attempted to connect the vi you sent but am getting the following error: 'Error 1430 -The path is empty or relative. You must use an absolute path.'
Thanks
06-22-2016 04:53 AM
Hi again,
No unfortunately not. The example was merely to describe the use of the incrementing suffix.
What file type are you using to save your images?
- Jarmo
06-22-2016 05:00 AM
Hello,
I am using .png to save the images at the moment but if there is another file type that can save them I can use that instead.
06-22-2016 05:09 AM
Hey,
you can use Write PNG File VI https://zone.ni.com/reference/en-XX/help/371361H-01/lvpict/write_png_file/
You just have to switch the order of the functions so that increment is after the Write function.
- Jarmo