Accurate Timestamp via G2GetGrabStatus

We retrieve the timestamp of the current image via the following call: G2GetGrabStatus(hCamera, GRAB_INFO_TIMESTAMP, camTimestamp);
As described in the manual, camTimestamp is a double value, which might cause accuracy loss due to the conversion from the original timestamp (i.e. int64).
Is there any possibility to get the raw timestamp via the C/C++ API for the current image?

We need the value since we are using a JAI SP5000M camera where the 64bit internal time representation is constructed as follows (as described by a JAI engineer): 35 bit of the counter are LSB which represents the internal counter, 29 Bits are MSB which come from the PTP server.

We use Ubuntu 16.04.5 with CVB 12.00.002

Yes, there will be precision loss. The question is more whether it will affect you:

The largest integer being able to be stored without precision loss is 253, which results in 285.62 years with microseconds granularity. So if IEEE 1588 (which normally uses 1970/01/01 as its time base) is used you can work until the year 2255.

If you are using the GenICam.vin, though, you can access the time stamp via device control DC_BUFFER_INFO_TIMESTAMP (defined in iDC_GenICam.h):

cvbuint64_t dummy = 0, timeStamp = 0;
size_t sizeOfTimeStamp = sizeof(cvbuint64_t);
cvbres_t result = DCBinaryCommand
  (
    hCamera,
    DeviceCtrlCmd(DC_BUFFER_INFO_TIMESTAMP, DC_GET),
    &dummy, sizeOfTimeStamp ,
    &timeStamp, sizeOfTimeStamp 
  );
3 Likes