From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I control the number of images saved

Solved!
Go to solution

I am trying to controll the number of images I save. Right now I can control the VI to save but I cant control how many images I save. I tried a few different methods with for loops, but I cant get it to work. I need this vi to be able to save a ___ number of images, but also continue grabbing even when it is not saving. I attached the VI I am working with.

0 Kudos
Message 1 of 7
(2,699 Views)

Make the SAVE button latch action and you'll get one image per button press.

 

For multiple pictures, keep the count in a shift register of the while loop and increment whenever a save occurs. stop saving when the desired number is reached.

0 Kudos
Message 2 of 7
(2,693 Views)
Ok I get the latch option you said, but could you be more specific on how to do the shift register option you mentioned
0 Kudos
Message 3 of 7
(2,688 Views)

Here's one possibility:

 

By default, the SR is zero, executing the empty case. Whenever the save button is pressed, the SR gets the number of images, which then will decrement until it is zero again, saving an image at each nonzero state.

 

Message Edited by altenbach on 07-13-2009 01:03 PM
0 Kudos
Message 4 of 7
(2,683 Views)
What is the purpose of the zero constant attahced to the input of the shift register? When i deleted it, there seemed to be no difference.
0 Kudos
Message 5 of 7
(2,667 Views)
Solution
Accepted by topic author bonesaw
That's the initial value of the shift register. There will be a difference under certain conditions. For example, if you would abort your program while it is saving images, the SR would contain nozero data and it would immediately start saving the next time the program runs. Initializing it with zero let's you start with a clean slate.
0 Kudos
Message 6 of 7
(2,665 Views)
Thank you so much for your help. Your information has been very useful.
0 Kudos
Message 7 of 7
(2,660 Views)