How Do I Get the Timestamp Information From the Leader Packet of GVSP?

Updated Apr 5, 2023

Environment

Hardware

  • Camera

Software

  • LabVIEW

Driver

  • NI-IMAQ
  • NI-IMAQdx

I have a 3rd party camera that I want to acquire timestamp information of the image as I capture it, not when LabVIEW sees it. I have contacted the camera supplier who have stated that the timestamp information is in the leader part of GVSP. How can I access the timestamp information in LabVIEW?

GVSP (GigE Vision Stream Protocol) uses UDP packets to stream data from the device to the application. The device includes a GigE Vision header as part of the data packet that identifies the image number, packet number and the timestamp. The application uses this information to construct the image in user memory.

With GVSP, the timestamp of when the camera captures the image is in the header part pf the packet, which can be accessed via inputting custom keys into specific NI-IMAQ functions in LabVIEW. A timestamp in LabVIEW consists of 64 bits of data, and both keys represent 32-bits of this information corresponding to the upper and lower halves. The two custom data keys, IMAQdxTimestampHigh and IMAQdxTimestampLow, can inputted into the IMAQ Read Custom Data VI to get the camera timestamp.
 


Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

Next Steps

If you are unable to use IMAQdxTimestampHigh and IMAQdxTimestampLow to get the camera timestamp, you can use the IMAQ Get Custom Keys VI to see what custom keys you have access to:


Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

If the IMAQdxTimestampHigh and IMAQdxTimestampLow keys aren't available, then its likely that the IMAQdxReceiveTimestampHigh and IMAQdxReceiveTimestampLow are available, which will give access to the system timestamp instead of the camera capture timestamp. Read How Do I Acquire a Timestamp from my NI-IMAQdx Supported Camera? for more information.