LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How would I go about building labview VI that has multiple camera functions?

Solved!
Go to solution
Hi, I am building a Labview Vi that needs to have multiple camera functions. I need to have options on the front panel that will show the camera feed live without saving, on option that will show the camera live and save one frame, and an option that shows the camera live and saves multiple frames. I know there are VI's in IMAQ that Grab, Snap, and so on, but combining them is harder than I thought. Does anyone have any advice on this for me? I am using a PXI- 1409 in case you were curious.
0 Kudos
Message 1 of 17
(2,664 Views)
I recommend using the IMAQ copy acquired buffer VI.  You can put that in a case structure and copy the buffer whenever you want to take an image.  You can write the contents of the buffer to file to save the image.  If you need to save multiple frames you could put it in a loop and increment the buffer number input.  Give that a try and let me know if you have any problems.
Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments
0 Kudos
Message 2 of 17
(2,642 Views)
Ok, can you be more specific on what you mean. What should i wire to that VI? I'm not completely clear on what else should be in that case structure.
0 Kudos
Message 3 of 17
(2,640 Views)

Certainly.  You can wire the case structure to an enum and choose the enum based on which case you are in (or you can use two case structures with T/F).  While in the case structure you can wire the image output of the grab to the image input of the copy acquired buffer.  Then you can use the IMAQ Write File 2 to write the image to a file.  This will all be in the case structure. Take a look at the detaied help for copy acquired buffer VI to help you choose your overwrite mode.  This should give you more information about choosing your buffers.  Please let me know if this clears things up.

 

 

Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments
0 Kudos
Message 4 of 17
(2,609 Views)
should i use a grab or something i made to snap continuously?
0 Kudos
Message 5 of 17
(2,591 Views)
And also, how do you increment the buffer number input?
0 Kudos
Message 6 of 17
(2,576 Views)
And another thing, I have it saving the last image but it wont save multiple images. I am using write file 2 vi and only the last image is saving to the specified file path. Any advice?
0 Kudos
Message 7 of 17
(2,574 Views)
Here is the VI that I am using right now. I am just seeing if i can get the grab to save multiple images. I havent started working with the case structure yet. Maybe seeing the VI would help you help me.
0 Kudos
Message 8 of 17
(2,573 Views)

Hi Bonesaw,

 

Whether you grap or snap continuously is up to you.  If you don't care about viewing continuously you can snap continuously.  Another option is to use the IMAQ sequence VI which grabs a series of images.  You can then save those images without worrying about the buffer.  

 

For the buffer you can use the Acquired buffer number output of the Grab acquire VI as the buffer input to your copy acquired buffer VI.

 

The reason that only the last image is saved is because you are using the same file path for each save.  That means that you are overwriting each image when a new image comes up.  You can avoid this by building the file path and incorporating the increment counter in the file path.  That will give you a new file name for each iteration of the loop.

 

 

Nick Keel 

Applications Engineering 

National Instruments

Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments
0 Kudos
Message 9 of 17
(2,559 Views)
still dont get how to implement the increment counter in the file path. What is an increment counter anyway
0 Kudos
Message 10 of 17
(2,551 Views)