Timestamp

The Timestamp camera feature counts the number of ticks generated by the camera's internal device clock.

The timestamp value is used by several camera features, e.g., Chunk Features and Event Notification.

In this topic Hide

Using the Feature

How It Works

As soon as the camera is powered on, it starts generating and counting clock ticks. The counter is reset to 0 whenever the camera is powered off and on again. On some camera models, you can also reset the counter during camera operation.

The number of ticks per second, i.e., the tick frequency, depends on your camera model. To determine the current tick frequency, get the value of the GevTimestampTickFrequency parameter.

The timestamp counter is also used to synchronize multiple cameras via PTP. On cameras synchronized via PTP, the timestamp value will be (nearly) identical.

Determining the Current Timestamp Value

To determine the current value of the timestamp counter:

  1. Execute the GevTimestampControlLatchTimestampLatch command.
    A "snapshot" of the camera’s current timestamp value is taken.
  2. Get the value of the GevTimestampValueTimestampLatchValue parameter.
    The value of the parameter refers to the point in time when the GevTimestampControlLatchTimestampLatch command was executed.

There is an unspecified and variable delay between sending the GevTimestampControlLatchTimestampLatch command and it becoming effective.

Specifics

Camera Model

Timestamp Tick Frequency

Counter Can Be Reset during Camera Operation

All ace 2 GigE camera models
  • PTP disabled: 125 MHz (= 125 000 000  ticks per second, 1 tick = 8 ns)
  • PTP enabled: 1 GHz (= 1 000 000 000 ticks per second, 1 tick = 1 ns)
Yes. To reset the counter, make sure that PTP (if available) is disabled and execute the TimestampReset command.
All ace 2 USB 3.0 camera models 1 GHz (= 1 000 000 000 ticks per second, 1 tick = 1 ns) No
All ace USB 3.0 camera models 1 GHz (= 1 000 000 000 ticks per second, 1 tick = 1 ns) No
All ace GigE camera models
  • PTP disabled: 125 MHz (= 125 000 000  ticks per second, 1 tick = 8 ns)
  • PTP enabled: 1 GHz (= 1 000 000 000 ticks per second, 1 tick = 1 ns)
Yes. To reset the counter, make sure that PTP (if available) is disabled and execute the GevTimestampControlReset command.
All boost CXP-12 camera models tbd tbd
All dart BCON for LVDS camera models Timestamp feature not supported Timestamp feature not supported
All dart BCON for MIPI camera models Timestamp feature not supported Timestamp feature not supported
All dart USB 3.0 camera models Timestamp feature not supported Timestamp feature not supported
All pulse USB 3.0 camera models Timestamp feature not supported Timestamp feature not supported

Sample Code

// Take a "snapshot" of the camera's current timestamp value
camera.GevTimestampControlLatch.Execute();
// Get the timestamp value
int64_t i = camera.GevTimestampValue.GetValue();
// Take a "snapshot" of the camera's current timestamp value
camera.TimestampLatch.Execute();
// Get the timestamp value
int64_t i = camera.TimestampLatchValue.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Take a "snapshot" of the camera's current timestamp value
CCommandPtr(nodemap.GetNode("GevTimestampControlLatch"))->Execute();
// Get the timestamp value
int64_t i = CIntegerPtr(nodemap.GetNode("GevTimestampValue"))->GetValue();
// Take a "snapshot" of the camera's current timestamp value
CCommandPtr(nodemap.GetNode("TimestampLatch"))->Execute();
// Get the timestamp value
int64_t i = CIntegerPtr(nodemap.GetNode("TimestampLatchValue"))->GetValue();
// Take a "snapshot" of the camera's current timestamp value
camera.Parameters[PLCamera.GevTimestampControlLatch].Execute();
// Get the timestamp value
Int64 i = camera.Parameters[PLCamera.GevTimestampValue].GetValue();
// Take a "snapshot" of the camera's current timestamp value
camera.Parameters[PLCamera.TimestampLatch].Execute();
// Get the timestamp value
Int64 i = camera.Parameters[PLCamera.TimestampLatchValue].GetValue();
// Take a "snapshot" of the camera's current timestamp value
Pylon.DeviceExecuteCommandFeature(hdev, "GevTimestampControlLatch");
// Get the timestamp value
Int64 i = Pylon.DeviceGetIntegerFeature(hdev, "GevTimestampValue");
// Take a "snapshot" of the camera's current timestamp value
Pylon.DeviceExecuteCommandFeature(hdev, "TimestampLatch");
// Get the timestamp value
Int64 i = Pylon.DeviceGetIntegerFeature(hdev, "TimestampLatchValue");
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
int64_t i = 0;
/* Take a "snapshot" of the camera's current timestamp value */
errRes = PylonDeviceExecuteCommandFeature(hdev, "GevTimestampControlLatch");
CHECK(errRes);
/* Get the timestamp value */
errRes = PylonDeviceGetIntegerFeature(hdev, "GevTimestampValue", &i);
CHECK(errRes);
int64_t i = 0;
/* Take a "snapshot" of the camera's current timestamp value */
errRes = PylonDeviceExecuteCommandFeature(hdev, "TimestampLatch");
CHECK(errRes);
/* Get the timestamp value */
errRes = PylonDeviceGetIntegerFeature(hdev, "TimestampLatchValue", &i);
CHECK(errRes);

You can also use the pylon Viewer to easily set the parameters.