niSync_ReadLastGPSTimestamp

C Function Prototype

ViStatus _VI_FUNC niSync_ReadLastGPSTimestamp (ViSession vi, ViUInt32 * timestampSeconds, ViUInt32 * timestampNanoseconds, ViUInt16 * timestampFractionalNanoseconds, ViUInt32 * gpsSeconds, ViUInt32 * gpsNanoseconds, ViUInt16 * gpsFractionalNanoseconds);

Purpose

Returns two timestamps: one with the module's board time when the module received the GPS pulse per second signal, and the other with the time of the onboard GPS receiver. Use these two values to determine the delay between GPS and your module.

The read operation is a single-timestamp, nonblocking read. That is, the newest timestamp is returned. If no valid timestamp has ever been received, a value of zero is returned for the timestamp and the decoded time. A single timestamp can be read multiple times; only the reception of a subsequent timestamp updates the values returned. The function does not block waiting for a new timestamp to become available.

Prior to calling niSync_ReadLastGPSTimestamp, you must enable GPS timestamping by calling niSync_EnableGPSTimestamping.

Note Note  
  • You can combine the values returned in timestampSeconds, timestampNanoseconds, and timestampFractionalNanoseconds to get the board time the GPS pulse per second was received. You can combine the values returned in gpsSeconds, gpsNanoseconds, and gpsFractionalNanoseconds to get the time reported by the onboard GPS receiver.
  • This attribute is supported only on certain targets. Refer to Target Support for Timing Attributes and Functions to determine whether or not this attribute is supported on your target.

Parameters

Name Type Description
vi ViSession The session handle that you obtain from niSync_init. The handle identifies a particular instrument session.
timestampSeconds ViUInt32 * An input integer pointer. The caller of this function must allocate a ViUInt32 and pass the pointer in this argument. The function sets the ViUInt32 value to the seconds field of when the timestamp occurred.
timestampNanoseconds ViUInt32 * An input integer pointer. The caller of this function must allocate a ViUInt32 and pass the pointer in this argument. The function sets the ViUInt32 value to the nanoseconds field of when the timestamp occurred.
timestampFractionalNanoseconds ViUInt16 * An input integer pointer. The caller of this function must allocate a ViUInt16 and pass the pointer in this argument. The function sets the ViUInt16 value to the fractional nanoseconds field of when the timestamp occurred.
gpsSeconds ViUInt32 * An input integer pointer. The caller of this function must allocate a ViUInt32 and pass the pointer in this argument. The function sets the ViUInt32 value to the seconds field of time reported by the onboard GPS receiver.
gpsNanoseconds ViUInt32 * An input integer pointer. The caller of this function must allocate a ViUInt32 and pass the pointer in this argument. The function sets the ViUInt32 value to the nanoseconds field of the time reported by the onboard GPS receiver.
gpsFractionalNanoseconds ViUInt16 * An input integer pointer. The caller of this function must allocate a ViUInt16 and pass the pointer in this argument. The function sets the ViUInt16 value to the fractional nanoseconds field of the time reported by the onboard GPS receiver.

Return Values