Hi
I am using Cvb++ (14.1) and am in the process of registering callback functions for all possible events.
So far I have succesfully retrieved all the relevant IntegerNodePtr’s from the device nodemap (for example Std::EventAcquisitionStart).
Then I try to attach the callback by using the RegisterEventUpdated function on each node:
please be aware that there are two differnt kinds of events to consider for any GenTL based technology like GEV or U3V. Device events that delivered from the device (on the wire) and handed to the GenApi to appear on nodes of the node map. And events that are created by the GenTL implmentation itself and do not involve data sent over the wire (like disconnected event) these events cannot be delivered the same way as the device is already gone. NotifyObservable should only be used for the second event type.
What exactly does not work? The registration or do you never see it triggered? If the later, be aware that a camera usually does not send event data for every node change. Events may need to be enabled first. See the post from @Chris .
It did not work as I never saw the event triggered. I found out that it was due to the firmware of the camera being too old. When I updated the camera to the newest firmware - it worked.
What kind of informaiton is retrieveable from the nodemap events? So far, I have only been able to extract the EventID, but any other information, i.e. timestamp would be very nice to have.
auto devices = DeviceFactory::Discover(DiscoverFlags::IgnoreVins);
auto device = DeviceFactory::Open<GenICamDevice>(devices[0].AccessToken(), AcquisitionStack::GenTL);
auto stream = device->Stream<CompositeStream>(); // default: index = 0 (1)
stream->Start(); // (2)
for (int i = 0; i < 10; ++i)
{
CompositePtr composite;
WaitStatus status;
NodeMapEnumerator nodeMaps;
std::tie(composite, status, nodeMaps) = stream->Wait(); // C++14 (3)
auto [composite, status, nodeMaps] = stream->Wait(); // C++17 (3)
}
stream->Abort(); // (4)
Information like FrameID and Timestamp can be easily accessed from the nodemap that is returned from your Wait() call.
Maybe you want to have a look if this is already all you need.
for completeness let me add some things. Event data for GEV and U3V contains a dedicated device timestamp. However, GenTL does not offer an interface for that so only the raw event buffer would be available. See the GevEventData@Chris posted. Please also note, that this layout is only valid for GEV 1.x. If you have a more recent GEV device it is most likly GEV 2.x