LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save acquired images

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.

0 Kudos
Message 1 of 12
(5,201 Views)

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

0 Kudos
Message 2 of 12
(5,181 Views)

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

0 Kudos
Message 3 of 12
(5,169 Views)

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

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

@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

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 5 of 12
(5,133 Views)

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 controlincrement suffix.PNG in the LabVIEW Front Panel.

 

Hopefully this helps you succeed with your .vi!

 

Best regards,

Jarmo Levo

Applications Engineer

National Instruments

0 Kudos
Message 6 of 12
(5,130 Views)

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

0 Kudos
Message 7 of 12
(5,118 Views)

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

0 Kudos
Message 8 of 12
(5,114 Views)

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.

0 Kudos
Message 9 of 12
(5,111 Views)

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.

 

png.png

 

- Jarmo

 

 

0 Kudos
Message 10 of 12
(5,108 Views)