Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Preventing VB from Displaying IMAQ errors

Hi.

I have a VB application that uses IMAQ Vision for Visual Basic and cycles through a series of cameras, acquiring images from each camera. If one of the cameras gets disconnected, I get a VB Runtime Error for error 30831 Can't Lock On Video Source. I would like to prevent this error from being displayed and let the application continue on to acquire an image from the next camera. It is important to do this to ensure that the application keeps running without the user having to respond to a message box.

I have error handling in my VB function, but when I get error 30831 on the line "Me.CWIMAQ1.AcquireImage", it displays the error right away instead of going to my error handling.

Is there a special way to handle IMAQ err
ors?
0 Kudos
Message 1 of 2
(2,964 Views)
I just found the answer to my own question. I have to set the ExceptionOnError property for the CWIMAQ control to False, which will cause the error code to be returned from the AcquireImage command instead of displaying the VB Runtime Error.
0 Kudos
Message 2 of 2
(2,964 Views)