LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use LabWindows 8.0 to take pictures with a consumer USB camera?

Essentially my problem boils down to this--I need to use LabWindows to take a picture with a consumer USB camera and save that image to the hard drive under a specific file name. I've seen multiple NI solutions for industrial cameras and even a USB camera solution for use with LabView. However, I must use LabWindows because other controls and sensors are run through the GUI created by it and I have to take pictures at specific times in my operation without an operator immediately present.
 
Any help on this problem would be greatly appreciated.
 
--QueWhat
0 Kudos
Message 1 of 6
(4,243 Views)
Does the camera vendor have any kind of interface software such as a driver or library that will interface to the device from a C compiler? 
Do they provide an activex control for the camera that would allow it to be used from something like visual basic, this can also be adapted for use with CVI.  If not, does the vendor publish/document the USB command interface to the camera, if so you can write you own interface code. 
 
Finally, if there is no documentation or library support from the vendor at all, and you have another application that can capture realtime images from the camara on a PC it may be possible to use that application to do some of the work under the control of CVI, or to use a sniffer on the USB interface to determine what the command set for the device is.  But if I was my project and I was presented with the last option only, I would change to a vendor that provides better device support rather than have to reverse engineer a link to a device that does not provide a supported control interface.
0 Kudos
Message 2 of 6
(4,228 Views)

Well, the camera vendor doesn't have a driver or library that will interface to a C compiler, nor do they have an activex control. However I didn't check whether they document the USB command interface and there is another application on the PC that can capture the realtime images. The vendor did say that the interface will respond to RS-232 commands from another computer, which might just be possible in my setup. Does anyone know if LabWindows can generate these commands and how I would go about it if it can?

 Writing my own interface code is a little more than I want to tackle though, so I might just have to change vendors.

Again, thanks for any help.

0 Kudos
Message 3 of 6
(4,212 Views)
By RS232 commands I assume they are saying they can respond to command strings sent over the USB port (unless the camera has a separate serial port interface).  If they document that, it could be pretty easy to setup if you are comfortable writing to the USB port using something like the NI VISA interface to send data over the USB port.  Not completely trivial, but not hard.  If they do support a command interface over the USB port they probably publish the interface documentation somewhere.  Finding that would get you started.  You could post a link here if you find it, or if you post the hardware model, someone here may be willing to look around a bit for you.
 
Another path forward is to get the NI IMAQ toolkit for CVI.  This is the NI vision system software.  It is very powerful, but not so complex that you can not get basic functions running without too much trouble.  The key is to get a supported camera type.  It is not the cheapest way to go, but then again, time costs too.  There do not seem to be too many easy solutions to video/image capture systems.
0 Kudos
Message 4 of 6
(4,208 Views)

I've got the same problem, I'm trying to connect to a USB camera using LabWindows.  If they provide 'IMAQ for USB' for LabView, why not LabWindows?  The device doesn't even get recognized by NI-MAX.  I'm going to try turning it into a VISA device and seeing if the IMAQ drivers will communicate with it then.  But any other ideas would be appreciated.

The manufacturers don't include drivers, but they claim that it is compatible with Microsoft Directshow.  I tried downloading the Microsoft SDK and including the appropriate headers and libraries into LabWindows according to the documentation for how to get Directshow to work in ANSI C, but I can't get anything to link properly.  I get odd errors with int64 variables.  I hate working with Microsoft libraries.

0 Kudos
Message 5 of 6
(3,968 Views)

Hello Brian,

Thank you for contacting National Instruments.  A similar discussion is going on about this issue.  Please refer to the following forum post:

http://forums.ni.com/ni/board/message?board.id=200&message.id=11497

Regards,

Mike T

National Instruments

 

 

0 Kudos
Message 6 of 6
(3,927 Views)