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?