Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Select VBAI camera from LabVIEW

Solved!
Go to solution

Hello,

 

I have a program in Vision builder AI that acquires an Image and then process it.

 

I have two USB cameras connected to my laptop and I want to be able to select one of them from a LabVIEW VI.

 

Is there a way to do this?

 

Thank you in advance

0 Kudos
Message 1 of 16
(4,627 Views)
I think I answer this before !
first check your camera in max if you can open cam in max so you can open it in labview
go to labview help in tools bar select find example in example finder window search for grab or snap there is several example for this reason that could help you
0 Kudos
Message 2 of 16
(4,603 Views)

To be clear, it sounds like you want to use your VBAI inspection from LabVIEW and switch which camera is used by the VBAI inspection using LabVIEW. Is that correct? What determines which camera to use? Could you just have a VBAI inspection that could acquire from either camera and have VBAI use different states and transitions to acquire from one camera or the other? If this is not what you want, please be more specific about your application needs.

I can help provide options for what you want, but before I spend time detailing how to accomplish it, I want to make sure we know what you want.

thanks,

Brad

0 Kudos
Message 3 of 16
(4,597 Views)

Thank you for your reply.

 

Actually, I have 2 Cameras connected to my laptop and just one vbai program that acquires a picture and then analyze it.

 

I want to be able, via the VBAI toolkit in LabVIEW, to load the inspection and then send something like the camera reference or something like that (That I will chose from LabVIEW) to the VBAI program to acquire a picture from the appropriate camera. (That I have chosen from LabVIEW)

 

Thank you in advance.

0 Kudos
Message 4 of 16
(4,585 Views)
Solution
Accepted by topic author hichem55

There currently isn't a way to have a single Acquisition step in VBAI change which camera it is acquiring from. Your options are:

  • Have two acquisition steps in the VBAI inspection in different states.
  • Use a variable to determine which transition to use that will acquire from one camera or the other.
  • In your LV code, set the value of the variable to determine which camera you want and then use the VI in LV to run the inspection and get results. 

Or

  • Don't have any acquisition steps in VBAI, but create an image variable. Use a Select Image step to start processing the image variable.
  • In LabVIEW, acquire from the camera you want, then set the acquired image to VBAI's image variable, then run the inspection.

I would recommend the first option since it will make it easier to interact and debug your inspection within VBAI since you can easily acquire new images within VBAI.

 

Hope that helps,

Brad

Message 5 of 16
(4,581 Views)

You hints are helping a lot. 

 

Thank you very much

0 Kudos
Message 6 of 16
(4,577 Views)
  • Have two acquisition steps in the VBAI inspection in different states.
  • Use a variable to determine which transition to use that will acquire from one camera or the other.
  • In your LV code, set the value of the variable to determine which camera you want and then use the VI in LV to run the inspection and get results. 

 


I plan to use 3 USB cameras and along with motion to inspect 3 different sides of finish goods. Is this method applicable to USB cameras too? http://www.ni.com/example/31368/en/ <- this example shows how to create different states by using Compact Vision System.  Is it necessary to use CVS for my application (3 USB cameras)?

Thanks 

0 Kudos
Message 7 of 16
(4,264 Views)

Are you doing the same processing on both cameras? Another solution is to have one inspection per camera, and from LabVIEW select the one you want to run.

Message 8 of 16
(4,255 Views)

Different process for each camera. 

0 Kudos
Message 9 of 16
(4,252 Views)

You do not have to use a CVS. The same concept can apply to your application if you are running it on a PC or other device.  You just need to have multiple acquisition steps; one acquisition step for each camera.

 

You might want to look at Brad's reply in this thread as it might be a question you have if your 3 cameras are doing independent processing:  https://forums.ni.com/t5/Machine-Vision/Is-parallel-execution-of-VBAI-inspection-states-possible/td-...

Clemens | Technical Support Engineer | National Instruments
Message 10 of 16
(4,218 Views)