Vision device in the ERROR state

Camera function blocks switch between the ERROR and INITIAL state

Situation

The instance of the function block FB_VN_Gev_CameraControl or FB_VN_SimpleCameraControl alternately returns TCVN_CS_ERROR and TCVN_CS_INITIAL on calling the method GetState.

In the TCVN_CS_ERROR state, the Reset() method of the function block is executed successfully and the camera instance changes to the TCVN_CS_INITIAL state. If the camera remains in the TCVN_CS_ERROR state, refer to Device is permanently in ERROR state.

eState := fbCamera.GetState()
IF eState = TCVN_CS_ERROR THEN
    fbCamera.Reset();
END_IF

 

In the TCVN_CS_INITIAL state, either function block method OpenCamera() or StartAcquisition() is called. The call fails and the instance returns to state TCVN_CS_ERROR.

eState := fbCamera.GetState()
IF eState = TCVN_CS_INITIAL THEN
    fbCamera.OpenCamera();
END_IF

or

eState := fbCamera.GetState()
IF eState = TCVN_CS_INITIAL THEN
    fbCamera.StartAcquisition();
END_IF

Solution 1

Check the physical connection to the camera and the power supply of the camera.

Solution 2

Check the settings for the camera connection (IP address of the camera, network port).

Function block permanently in the ERROR state

Situation

The instance of the function block FB_VN_GevCameraControl, FB_VN_SimpleCameraControl or FB_VN_FileSourceControl permanently returns the state TCVN_CS_ERROR. Even when calling the function block method Reset, there is no change of state to TCVN_CS_INITIAL (if there is, see Device switches between ERROR and INITIAL state).

fbCamera.Reset();

Vision device in the ERROR state 1:

 

Solution 1

The symbol instance must be linked to the Image Provider - each instance of a FB_VN_GevCameraControl, a FB_VN_SimpleCameraControl and a FB_VN_FileSourceControl must be linked to a camera or File Source Control created in the Vision node.

Proceed as follows:

1. Perform a successful rebuild of the PLC project.
2. Then double-click on the instance of the PLC project.
3. Under the Symbol Initialization tab, assign the Image Provider of the corresponding camera or the corresponding File Source Control to the instances of FB_VN_GevCameraControl.
4. Reactivate the configuration.
Vision device in the ERROR state 2:

The FB_VN_GevCameraControl can only be linked to the Image Provider of a camera.

The FB_VN_FileSourceControl can only be linked to the Image Provider of a File Source Control.

The FB_VN_SimpleCameraControl can be linked to the Image Provider of a camera or to the Image Provider of a File Source Control.

Solution 2

The instance of FB_VN_GevCameraControl or FB_VN_SimpleCameraControl or FB_VN_FileSourceControl is assigned the Image Provider of a camera or a File Source Control, yet the device is permanently in error state.

Check the method calls of the instance of FB_VN_GevCameraControl or FB_VN_SimpleCameraControl or FB_VN_FileSourceControl. Many methods may only be called in a certain state. A detailed description of the states of Vision devices can be found in the section Function blocks for image acquisition.

  • In all states
    • GetState
    • GetCalibPatternRef (from FB_VN_GevCameraControl)
    • GetCameraMatrix (from FB_VN_GevCameraControl)
    • GetDistortionCoefficients (from FB_VN_GevCameraControl)
    • GetRotationMatrix (from FB_VN_GevCameraControl)
    • GetTranslationVector (from FB_VN_GevCameraControl)
    • SetCameraMatrix (from FB_VN_GevCameraControl)
    • SetDistortionCoefficients (from FB_VN_GevCameraControl)
    • SetRotationMatrix (from FB_VN_GevCameraControl)
    • SetTranslationVector (from FB_VN_GevCameraControl)
  • In the INITIAL state and in the INITIALIZING state
    • InitializeCamera (from FB_VN_GevCameraControl)
  • In INITIAL state and in OPENING state
    • OpenCamera (from FB_VN_GevCameraControl)
    • StartAcquisition
  • In OPENED state and in STARTACQUISITION state
    • StartAcquisition
  • In OPENED state and in CLOSING state
    • CloseCamera (from FB_VN_GevCameraControl)
  • In ACQUIRING state
    • GetCurrentImage
    • GetCurrentImageUndistorted (from FB_VN_GevCameraControl)
    • GetCurrentImageWithGvspInfo (from FB_VN_GevCameraControl)
    • GetCurrentImageAndFileName (from FB_VN_FileSourceControl)
    • ClearImageQueue (from FB_VN_GevCameraControl)
    • GetLastImageFromQueue (from FB_VN_GevCameraControl)
    • GetOmittedImagesNum (from FB_VN_GevCameraControl)
  • In ACQUIRING state and TRIGGERING state
    • TriggerImage
    • TriggerImageExp (from FB_VN_FileSourceControl)
    • TriggerImageByName (from FB_VN_FileSourceControl)
  • In ACQUIRING state and in STOPACQUISITION state
    • StopAcquisition
  • In ERROR state
    • Reset