Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

USB cam stops working after first IMAQ session

Hi , 

 

I got a logitech C250 USB webcam that I've been trying to use to take ordinary snap-shots with the snap.vi that is included in IMAQ.

 

I am using labview 2010 with NI vision 2010 and NI IMAQ 4.5.

 

What is working right now: I can run snap.vi once and get a picture, or run grab.vi and display video but after the VI is stopped(not aborting) and started again I get an error message:

Error -1074360293 occured at IMAQdx Get Image.vi   Possible reason: NI IMAQ Timeout.

 

Same thing with the measurement and automation explorer that has a preview of the camera, I can grab and take as many snapshots as I like but after i close the explorer the webcam dies. 

 

After this the webcam does not function at all, not in any software.

 

To restore the cam I have to unplugg/replugg and everything works fine until I run a VI again.

 

Haven't found anything about this issue so perhaps its just for my model of webcam? I've also tried it on different computers and with different drivers for the webcam. The webcam works with all other programs. 

 

Anyone who knows what it can be?

0 Kudos
Message 1 of 13
(5,874 Views)

The best I can suggest is trying different drivers. That model should support both a UVC (universal) driver by Microsoft as well as Logitech's own driver. Oftentimes the hardwarw UVC implementations are buggy, so I'd suggest making sure you are using Logitech's latest.


Eric

0 Kudos
Message 2 of 13
(5,858 Views)

Did you ever find a solution to this? I have literally the exact same problem (works for only one run) with the same camera........

 

Also tried different drivers (the standard windows driver that installs when the camera is plugged in, the Logitech driver on the install CD (ca 2009), and the upgrade to the latest Logitech driver (March 2011)). Still no better.

 

 

 

As an extra note, when attempting to run the camera the second time (the point I get the timeout error), the green status light on the camera turns on, so it's being communicated with somehow even though it won't grab an image...

0 Kudos
Message 3 of 13
(5,699 Views)

Ha Daan,

 

If you change the timeout in MAX does it help? Maybe it is taking longer than the default 5 sec to grab a frame (the higher resolution Logitechs seem to be fairly slow at starting up).

 

Eric

0 Kudos
Message 4 of 13
(5,692 Views)

Hi Eric, I just tried a 50s second timeout with no success.

 

Any suggestions on how to see lower level communication with the camera to find out what it needs/isn't getting? I've used other USB cameras with labview without any problems so it's a bit of a black art to me how Labview/MAX actually interface.

0 Kudos
Message 5 of 13
(5,689 Views)

Yeah actually I did. 

 

Since the problem is dealing with the sessions I downloaded virtual webcam software that handles the session with the webcam, and

then let IMAQ load the virtual webcam instead of the real one.

 

hope it helps

 

//T

0 Kudos
Message 6 of 13
(5,685 Views)

Thanks Tony, glad there is a fix for this! Can you recommend a good virtual webcam software?

0 Kudos
Message 7 of 13
(5,682 Views)

Hi all,

 

We'll try to get this particular Logitech C250 model into NI's hands to investigate why it is not behaving correctly with IMAQdx. The other Logitech models we have used have not shown similar problems, but they are likely very different.

 

Eric

0 Kudos
Message 8 of 13
(5,679 Views)

fyi for anyone intersted, I just tried the first program I searched for in google (ManyCam) and it does indeed handle the virtual session and allow the camera to function as "normal" (ie, run multiple times with no more timeout error). Problem fixed, in a non-ideal but acceptable way for my uses.

0 Kudos
Message 9 of 13
(5,665 Views)

Hi all,

 

I think the problem is not in that particular webcam model only. I think there is indeed a glitch in LabVIEW or a component of the Vision Acquisition Software.

 

As I remember, I didn't have such issues earlier (in LV8.6). But recently it's happening on my LG laptop which has the inbuilt webcam (so no such issues as driver etc.).

 

I am using LV2010 and when I run the Grab.vi (from example), it does not work in the first attempt, then (as the example has a control to manually select the webcam), I select cam0 and it starts working in the subsequent run(s). I run it at least 3-4 times and stopped normally as well as aborted and I could run it again successfully.

 

Then, I copied my code to select a "working" camera automatically out of the list of cameras give by "Enumerate Cameras.vi" and it didn't work (the code to automatically detect a working cam is simple, just checking all cameras in loop until there is a camera which has no Error while running "IMAQdx configure grab.vi" and this code is tested and works well since many months). And as if it was a big mistake, the program stopped working, throwing the same error as the thread starter has mentioned in the first post.

I then tried to run the other example of IMAQdx and it didn't work either. As if the software or camera felt really bad.

This happened few days back too, while I was testing.

 

I closed LabVIEW completely and started it again, but with no success. I guess I will have to restart the computer as I did the previous time. But this is not a good behaviour. It was just an error in selection of the camera name and that stops it all, until we seriously apologize (restart the computer).

 

Any clues what I might be doing wrong?

 

Thanks ahead!

 

Edit: attached is the code to automatically detect a working camera -

SelectCam.png

Vaibhav
0 Kudos
Message 10 of 13
(5,640 Views)