niSync_SetTime

C Function Prototype

ViStatus _VI_FUNC niSync_SetTime (ViSession vi, ViInt32 timeSource, ViUInt32 timeSeconds, ViUInt32 timeNanoseconds, ViUInt16 timeFractionalNanoseconds);

Purpose

Sets the absolute board time of the specified device to a certain time. You can set the device to a specific time or to the system time of your OS. This function does not change the frequency at which the board time increments; use niSync_ResetFrequency to reset the board time increment frequency.

Note Note  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.

timeSource ViInt32 Specifies the time source for the board time.

Valid Values:
NISYNC_VAL_INIT_TIME_SRC_SYSTEM_CLK
NISYNC_VAL_INIT_TIME_SRC_MANUAL
timeSeconds ViUInt32 Specifies the seconds portion of the time to which the board time will be set. Note that NI-Sync supports setting the initial time between 0 hours on 1 January 1970 and 0 hours on 1 January 2100. This parameter is ignored unless the timeSource parameter is set to NISYNC_VAL_INIT_TIME_SRC_MANUAL.
timeNanoseconds ViUInt32 Specifies the nanoseconds portion of the time to which the board time will be set. Note that NI-Sync supports setting the initial time between 0 hours on 1 January 1970 and 0 hours on 1 January 2100. This parameter is ignored unless the timeSource parameter is set to NISYNC_VAL_INIT_TIME_SRC_MANUAL.
timeFractionalNanoseconds ViUInt16 Specifies the fractional nanoseconds portion of the time to which the board time will be set. Note that NI-Sync supports setting the initial time between 0 hours on 1 January 1970 and 0 hours on 1 January 2100. This parameter is ignored unless the timeSource parameter is set to NISYNC_VAL_INIT_TIME_SRC_MANUAL.

Return Values