These days I'm testing an Allied Vision GigE camera (Alvium G1-1236, to be more exact) using Vimba SDK 6.0. I'm using C++, Ubuntu 18.04.

With the help of the user guide, API documentation, and the example code, I can successfully write C++ code to find the camera, open it, and start continuous image acquisition (and then stop and close it).

However, when I unplugged the Ethernet cable and plugged it back a few seconds later, I found the image acquisition seemed to stop (because I was printing the meta data of every received image, and I didn't see any new printed meta data after I re-plugged the Ethernet cable).

So I'm trying to implement the automatic resuming of image acquisition after the Ethernet cable is unplugged and plugged back again. I thought I needed to observe the camera list change, so I implemented my CameraListObserver:

class CameraListObserver : public AVT::VmbAPI::ICameraListObserver
{
public:
    virtual void CameraListChanged(
        AVT::VmbAPI::CameraPtr pCam,
        AVT::VmbAPI::UpdateTriggerType reason
    );
};

Then, yes, in the callback method CameraListChanged, I could now receive event notifications about camera plugged-in and -out.

However, I could not figure out how to restart the image acquisition appropriately. Inside the method CameraListChanged, I tried to directly start continuous image acquisition, but I got the error Invalid call. I guessed maybe the image acquisition was still not stopped yet, so I tried to stop the acquisition before starting it again, but calling StopContinuousImageAcquisition on the camera returned VmbErrorOther.

I tried a few example code but none of them seemed to implement the automatic resuming image acquisition function. Can somebody give me some advice/hint/clue how I can resume image continuous acquisition after disconnecting and reconnecting the Ethernet cable?

1

There are 1 answers

0
T F On

there are a number of functions that can't be called inside the CameraListObserver, you can see a list on page 22 (chapter 4) of the Vimba CPP Manual, including setting values of features or running feature commands. There are lists like these for the feature observer and frame observer as well. So the observer should just be used as an event trigger. The opening of the camera and image acquisition needs to be started outside of the observer. Maybe you can have it modify a global status variable that you check in a different thread or loop?