niSync_SetTimeReferencePPS

C Function Prototype

ViStatus _VI_FUNC niSync_SetTimeReferencePPS (ViSession vi, ViConstString terminalName, ViBoolean useManualTime, ViUInt32 initialTimeSeconds, ViUInt32 initialTimeNanoseconds, ViUInt16 initialTimeFractionalNanoseconds);

Purpose

Sets the selected time reference of the device to PPS (pulse per second).

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.

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.
terminalName ViConstString Specifies the terminal that contains the PPS signal.
useManualTime ViBoolean Specifies whether to use a user-supplied time or the OS system time to set the board time when the module receives the first pulse. After the first pulse sets the board time, every subsequent pulse is interpreted to be received one second later, and the function adjusts the board time accordingly.
initialTimeSeconds ViUInt32 Specifies the seconds field of the time to set the board time to when the module receives the first pulse. Only use this parameter if you set useManualTime to TRUE.
initialTimeNanoseconds ViUInt32 Specifies the nanoseconds field of the time to set the board time to when the module receives the first pulse. Only use this parameter if you set useManualTime to TRUE.
initialTimeFractionalNanoseconds ViUInt16 Specifies the fractional nanoseconds field of the time to set the board time to when the module receives the first pulse. Only use this parameter if you set useManualTime to TRUE.

Return Values