LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple webcam

Unfortunally, there's no way to avoid the Labview's crash when press the Abort button.. You HAVE to use the loop STOP button, so the labview can close the webcam resource.

The errors showed when you unplug the camera can be avoided to show on screen, use the Clear Errors function (VI)... Search it on your pallet...
0 Kudos
Message 21 of 53
(2,846 Views)
Hi  luizmenezesjr,

I am unable to track the source of the error- 1074396030 occured at IMAQ  USB Grab.vi. In order to clear it I need to know where does it occur.

I am using the one of the shipped examples "IMAQ USB Grab with Property Page Example".

Thank you for your time.

Regards,

Mozill
0 Kudos
Message 22 of 53
(2,832 Views)

Mozill,

This error code is usually associated with a timeout error.  Are you using the IMAQ for USB driver fron NI's website, linked here?  This driver will only work with cameras that are compatible with DirectShow, do you know if your camera is compatible with this format?

Regards,

Jasper S

0 Kudos
Message 23 of 53
(2,816 Views)
Hi Jasper,

Actually  I know the reason behind the error. I am using the drivers provided by NI as you mentioned in your previous post. My wireless webcamera is compatible as it is directshow complaint.

My project requires me to turn off the camera when not in use, so I power it off from the transmitter side. I have placed the shipped example in a while loop because I want the camera to be started when I again power it up. This trick works fine for me as I want it to work that way. But the problem is that when I power it off, the error keeps popping up every 4 seconds beacause it is searching for the camera. When it is searching for the camera in that while loop, it does not do anything in the main while loop which takes care of other stuff I wanna do. So, basically I wanna find a way with which I can get rid of that error by using a clear error function. But I am unable to find in what part of code does this error occur.

Any help is appreciated. Thank you for your time.

Regards,
Mozill
0 Kudos
Message 24 of 53
(2,809 Views)
Hi Mozill,

 the Webcam's VI has an ERROR output. Use the CLUSTER UNBUNDLE vi to get the BOOLEAN component.

With this component you can use as input on a CASE loop. When the error is TRUE (no error) you should put your webcam routine, and when the error is FALSE (there's an error) you may wire to nothing, or anything you want.
Message 25 of 53
(2,803 Views)
Hi luizmenezesjr,

The webcam vi does have an error output, but that is the end of that example.
You asked me to put the webcam routine in the case structure  When the error is TRUE (no error). I dont understand how can I do that as the error output is from the webcam example I am using.

I will just show you a snapshot of my code. Any help is appreciated as this problem is causing a lot of trouble.  The time out error as attached is causing lot of problems as it halts other stuff which i wanna do when i am turning off the camera.

Thank you for your time.

sincerely,
Mozill


Download All
0 Kudos
Message 26 of 53
(2,780 Views)

You might want to eliminate the general error handler dialog box.  That is what is causing the dialog box to pop up on every iteration.  Even though you clear the error, it is not being cleared until after the dialog box pops up.

Just kill the general error handler and execute the clear error VI.  You don't even need the unbundle of the error cluster and the case structer to clear the error.  I believe that is even wired wrong, as you are telling it to clear the error when the error cluster is false.  And false means there is no error.

0 Kudos
Message 27 of 53
(2,768 Views)
I tried that but that causes the program to go back and forth from between the main while loop and the camera loop. The error does not pop up as you said, but the program keeps on going to the camera loop halting whatever stuff is goin in the main while loop which I wanna continue all the time..no matter what...

thank you for your time

mozillb
0 Kudos
Message 28 of 53
(2,765 Views)
You may want to post your code.  Or at least a better screen shot of your code.  The left hand and right hand sides of the code are cut off.  And I have no idea why there is a large blue wallpaper image on the right hand side of the jpg.
 
Seeing all of the code may give a better idea of your architecture.  You may want to look into some of the architectures that handle multiple loops.  Producer/consumer or master/slave.  Templates can be seen by selecting File/New ....
 
You talk about the main loop and the camera loop, but it is hard to tell where they are or how they interact.  You only want to have the camera loops run if the camera is actually running and prepared to do something.  If you get an unexpected error message, you may need to do some special code to reset the camera.  That is what luizmenezesjr by putting code or not putting code into a case structure that executes based on the condition of the error cluster.  If you have an error, execute the clear error code and issue any reset type commands if necessary, if you don't have an error, issue the commands that grab images.  You actually don't have to unbundle the error cluster to get the error status, you can wire the error cluster directly to the selector node of the case structure.  Or at least you can in LV 8.2
0 Kudos
Message 29 of 53
(2,760 Views)
Thanks a lot for the information. I will definately try your suggestions and let you know if I have any more problems.

Thank you for your time.

Mozill
0 Kudos
Message 30 of 53
(2,749 Views)