RobotStudio event

Vision camera connected or disconnected

Hi All,

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?

Regards Rob

Answers

  • 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:

    PROC initCAM()
            CamSetProgramMode mycamera;
            CamLoadJob mycamera, "myjob.job";
            CamSetRunMode mycamera;
            ....

    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.

    Hoping this help, U.
  • Hi YuGo,

    what you write is correct but works only in manual mode.
    in automatic mode the robot create a execution error before the error handler is called.

    I forwarded this issue to ABB.

    thx