GigE Vision Events C++

I read the great instructions from @parsd regarding the handling of GigE Vision Events for the C API.

Now I’d like to do adapt that to CVB++.
Actually, I was hoping that this should be even easier to implement. However, my callback function is never called even if the node in the camera has changed. Does someone has an idea what I’m doing wrong here?

This is how I set up my callback:

auto devideNodeMap = device->NodeMap(CVB_LIT("Device"));
    
// get node
auto nodeEventAcqStart = devideNodeMap->Node<Cvb::IntegerNode>(CVB_LIT("EventAcquisitionStartTimestamp"));

// register node callback
auto cookie = nodeEventAcqStart ->RegisterEventUpdated([&](Cvb::Node*)
{
   // do processing
});

Later on I would expect the callback to be called with the start of the acquisition.

// get the first stream of the device
auto stream = device->Stream();

// start the stream - start the acquisition
stream->Start();

Figured out why it didn’t jump into the callback.

The timestamp node itself wasn’t accessable when trying to register the callback. Seems like I have to acquire an initial image by adding the GetSnapshot() function in order to get access to the node. This way I’m able to do the registration of the node and my code works.

    // get node map
    auto devideNodeMap = device->NodeMap(CVB_LIT("Device"));
    
    // get the first stream of the device
    auto stream = device->Stream();

    // get node
    auto nodeEventAcqStart = devideNodeMap->Node<Cvb::IntegerNode>(CVB_LIT("EventAcquisitionStartTimestamp"));

    // get initial snapshot (required for access to timestamp node!)
    stream->GetSnapshot();

    // register node callback
    auto cookie = nodeEventAcqStart->RegisterEventUpdated([&](Cvb::Node*)
    {
      std::cout << "Acq Start Timestamp changed: "<<nodeEventAcqStart->Value()<<std::endl;
      // do processing
    });

    // start the stream - start the acquisition
    stream->Start();
1 Like