NI-Sync C API Reference

niSync_ReadLastIRIGTimestamp

  • Updated2023-02-21
  • 3 minute(s) read
 niSync_ReadLastIRIGTimestamp

C Function Prototype

ViStatus _VI_FUNC niSync_ReadLastIRIGTimestamp (ViSession vi, ViConstString terminal, ViUInt32 * timestampSeconds, ViUInt32 * timestampNanoseconds, ViUInt16 * timestampFractionalNanoseconds, ViUInt32 * irigbSeconds, ViUInt32 * irigbNanoseconds, ViUInt16 * irigbFractionalNanoseconds);

Purpose

Returns two timestamps: one with the board time when the module received the IRIG message, and one with the time encoded in the IRIG message. Use these two values to determine the delay between the external IRIG source and your module, or to test the stability of an external IRIG source against an external time reference.

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 will update the values returned. The function does not block waiting for a new timestamp to become available.

Prior to calling niSync_ReadLastIRIGTimestamp, you must enable IRIG timestamping by calling niSync_EnableIRIGTimestamping.

Note Note  
  • You can combine the values returned in timestampSeconds, timestampNanoseconds, and timestampFractionalNanoseconds to get the board time the IRIG message was received. You can combine the values returned in irigbSeconds, irigbNanoseconds, and irigbFractionalNanoseconds to get the time reported in the IRIG message.
  • 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.
activeItem viConstString Specifies the terminal to which the IRIG input is connected.
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.
irigbSeconds 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 in the IRIG message.
irigbNanoseconds 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 in the IRIG message.
irigbFractionalNanoseconds 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 in the IRIG message.

Return Values

Log in to get a better experience