I’m using Integrated Vision and I would like to detect if the Cognex camera is connected or disconnected. Is there a way to check this, so the program execution will not be stopped?
I know there is a error (ERR_CAM_COM_TIMEOUT) which will be raised but this is only once, how do i know the error is solved?
Hi @rob_lentz
unfortunately there aren’t any functions that return the state of the camera.
As you said you can use the error handling in order to detect if the camera is properly working. For example:
ERROR
IF ERRNO=ERR_CAM_COM_TIMEOUT THEN
TPWRITE “Connection to camera: error.”;
WaitTime 5;
RETRY;
ENDIF
ENDPROC
And modify the number of retry or the error handler before the retry command in order to solve your problem.
Other solution could be to use (if avaiable) a phisical signal from the camera in order to check the connection.