10-01-2007 01:15 PM
10-02-2007 11:44 AM - edited 10-02-2007 11:44 AM
Hi,
The reason you are getting the "no interface found" message is because USB cameras use the NI-IMAQ for USB Cameras drivers, which are only supported in LabVIEW, Vision Assistant, and Vision Builder for AI. If you would like to program in C++ with a USB camera, one option would be to create your own DirectShow driver for use with the code. Also, webcams (USB) will not show up in Measurement and Automation Explorer, so it is expected that you will not see it in the MAX devices but will be able to use it in Vision Assistant. Hope this info was helpful!
Message Edited by Carlton H on 10-02-2007 11:45 AM
10-02-2007 08:52 PM
Thanks for the answer.
Can you guide me how to create DirectShow for my webcam step-by-step?
I'm a noob..
How am I going to know if my webcam supports DirectShow or not?
10-03-2007 10:17 AM
Hi looky,
DirectShow is an interface that Microsoft uses for media types. NI-IMAQ for USB drivers are written to do the communication between LabVIEW and DirectShow, so that's why it is going to take a custom driver to do this communication for programs outside of LabVIEW. Although I have never tried this before, it may be possible to create a VISA driver to control the webcam in C++. Here is a link to a tutorial that steps through the process of creating this driver:
http://zone.ni.com/devzone/cda/tut/p/id/4478
Is there any reason you need to stick with text-base coding for your application rather than LabVIEW?
10-04-2007 01:55 AM
Thanks Charlton for the explaination. I'll try to use NI-VISA after this.
I need to use C because I want to integrate my system with some other C functions like creating output file etc.
Do we have feature of creating output file (records the output in a text-file format) in LabVIEW? In that case, my problem would be easier to solve then.
10-04-2007 11:04 AM
What kind of data are you wanting to write to the text file? LabVIEW has built in VIs and examples that can write data to a spreadsheet or .txt file format. A good simple example to look at is the "Write to Text File.vi" example.
Hope this helps you!
10-07-2007 12:36 AM
10-08-2007 10:14 AM
Hello looky,
One solution would be to have four separate case structures which, if true, will write that color code to a string variable. Using the Write to Text File VI you will be able to write the value of that string to file each iteration. You can also add the Get Date and Time VI and add the timestamp. You would also need to add a 5th structure that would choose to either write or not write on that specific iteration if you have cases in which an image is none of the four colors you have specified. If an image was all black then none of the cases would trigger and it would write the value from the previous iteration. Hope this helps!
10-09-2007 04:19 AM
Hello Charlton,
I'm sorry I couldn't be able to solve the case structures. I have problem to wire them.
Do you have any example on how to use the case structure? I'm really new with LabVIEW and depend a lot on example programs.
Thanks!
10-09-2007 09:23 AM
Hello looky,
I understand where you are coming from, I rely heavily on examples as well. I have attached a quick and dirty example VI that demonstrates the case structures. In this example, a random number (0 to 10) is generated every second and depending on what range the number falls into, the program writes either Red, Blue, Green, or Yellow to the front panel and a text file. I hope this spurs some ideas.
p.s. I wrote the code in LabVIEW 8.5 so if you need me to repost it for an earlier version, just let me know.