NI-Sync C API Reference

niSync_SetTimeReferenceGPS

  • Updated2023-02-21
  • 2 minute(s) read
 niSync_SetTimeReferenceGPS

C Function Prototype

ViStatus _VI_FUNC niSync_SetTimeReferenceGPS (ViSession vi);

Purpose

Sets the selected time reference of the specified device to GPS. This function is a nonblocking call that returns immediately regardless of the state of the time reference selected. Selecting the time reference is a system-wide (per device) configuration that persists after the session exits. The time reference is not reservable; the last call to select the time reference takes precedence.

If the selected time reference is not providing valid time information, the board time goes into free running mode, starting at the last known time and running at the last frequency that was applied.

Note Note  
  • The servo may apply a macro phase adjustment when your device's board time and the selected time reference varies by more than 1 ms. A macro phase adjustment adjusts the selected time reference by a significant amount, and the time no longer atomically increments. This should not occur on a well-designed and stable network. A macro phase adjustment may affect future time events, clocks, and timestamps. If the selected time reference is set forward, future time events and clock transitions that were missed occur immediately. If the selected time reference is set backward, future time events and clock transitions are delayed.
  • An alternative to calling this function is to configure the default selected time reference through Measurement & Automation Explorer. The selected state is then reapplied at every restart.
  • Closing the session that calls this function does not alter the value of the selected time reference.
  • 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.

Return Values

Log in to get a better experience