Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
9 ratings:
 4 out of 5     Rate this Document

USB Cameras with Vision Builder for Automated Inspection

Primary Software: Vision Builder for Automated Inspection
Primary Software Version: 3.5
Primary Software Fixed Version: N/A
Secondary Software: Driver Software>>NI-IMAQ for USB Cameras

Problem:
Can I use my USB camera with Vision Builder for Automated Inspection (VBAI)?

Solution:
Due to the lack of an industrial USB standard, USB cameras are not directly supported in VBAI.  However, there are a few different workarounds for acquiring an image from a USB camera in VBAI.

Luminera USB Cameras

Luminera has a plug-in which allows you to acquire images in VBAI using their USB cameras.

Non-Luminera USB Cameras

It is possible to acquire an image in VBAI from other USB cameras using the Run LabVIEW VI step.  The procedure for doing so is as follows:
  1. Create a VI in LabVIEW that performs a Snap using the IMAQ for USB driver.  An image buffer should not be created inside of the VI.  Instead, the VI should accept an image buffer as an input.  An example, USB Snap.vi, is attached below.
  2. In your VBAI inspection, add a Simulate Acquisition step.  This step creates an image buffer which we will pass to the VI.  It does not matter what image file this step is set up to load, since the VI will overwrite the image buffer anyway.
  3. Add a Run LabVIEW VI step to the inspection.
  4. For the VI Path field in the property page for the step, press the Browse button and navigate to the VI you just created.  VBAI may attempt to run the VI once and will return an error.  This is expected. You may select Continue.
  5. Select the VI Controls tab in the property page for the step.
  6. To configure the VI to use the image buffer from VBAI, press the Configure button.  In the list VI Controls, select the name you gave the image control in the VI (default will be Image In.)
  7. Select the Use Measurement radio button.
  8. Select Simulate Acquisition 1 (or the name you gave the Simulate Acquisition step) in the Measurements list.
  9. Press OK.
  10. The step will now run once.  If it worked correctly, you will see an image acquired from your USB camera in the Main Window of VBAI.

If you choose to use this method, keep in mind that performing USB camera acquisitions over time using the NI-IMAQ for USB driver may cause problems due to a known memory leak in the driver. This is documented in the Known Issues section of the NI-IMAQ for USB Cameras download page.

Related Links:
Luminera USB Camera Plug-in for VBAI
Developer Zone Example: NI-IMAQ for USB Cameras


Attachments:


USB Snap.vi - USB Snap.vi


Report Date: 01/21/2008
Last Updated: 01/15/2009
Document ID: 4HKGM9DT

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit