NI-Sync C API Reference

Content Type
Programming Language
Current manual
Table of Contents

niSync_CreateClock

niSync_CreateClock

C Function Prototype

ViStatus _VI_FUNC niSync_CreateClock (ViSession vi, ViConstString terminal, ViUInt32 highTicks, ViUInt32 lowTicks, ViUInt32 startTimeSeconds, ViUInt32 startTimeNanoseconds, ViUInt16 startTimeFractionalNanoseconds, ViUInt32 stopTimeSeconds, ViUInt32 stopTimeNanoseconds, ViUInt16 stopTimeFractionalNanoseconds);

Purpose

Generates a clock that is synchronized to the board time associated with the specified session handle. The terminal associated with this clock cannot be used for other operations until the clock is cleared with the niSync_ClearClock function or the session is closed with the niSync_close function. When this function is invoked, the digital signal on the specified terminal is driven low until the clock starts.

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.
terminal ViConstString Specifies the line you would like to generate the clock on. You cannot use this terminal for other operations until you clear the generated clock using niSync_ClearClock or you close the session with niSync_close.
highTicks ViUInt32 Specifies the number of ticks the generated clock should spend in the high logic state. The clock resolution, which can be queried using the NISYNC_ATTR_1588_CLK_RESOLUTION attribute, determines the length of a tick.
lowTicks ViUInt32 Specifies the number of ticks the generated clock should spend in the low logic state. The clock resolution, which can be queried using the NISYNC_ATTR_1588_CLK_RESOLUTION attribute, determines the length of a tick.
startTimeSeconds ViUInt32 Specifies, in seconds, when to start the generated clock. This time is synchronized with the board time of the module you use to create the clock. The default value is 0, which generates the clock as soon as the function is invoked.
startTimeNanoseconds ViUInt32 Specifies, in nanoseconds, when to start the generated clock. This time is synchronized with the board time of the module you use to create the clock. The default value is 0, which generates the clock as soon as the function is invoked.
startTimeFractionalNanoseconds ViUInt16 Specifies, in fractional nanoseconds, when to start the generated clock. This time is synchronized with the board time of the module you use to create the clock. The default value is 0, which generates the clock as soon as the function is invoked.
stopTimeSeconds ViUInt32 Specifies, in seconds, when to stop the generated clock. This time is synchronized with the board time of the module you use to create the clock. The default value is 0, which never stops the clock.
stopTimeNanoseconds ViUInt32 Specifies, in nanoseconds, when to stop the generated clock. This time is synchronized with the board time of the module you use to create the clock. The default value is 0, which never stops the clock.
stopTimeFractionalNanoseconds ViUInt16 Specifies, in fractional nanoseconds, when to stop the generated clock. This time is synchronized with the board time of the module you use to create the clock. The default value is 0, which never stops the clock.

Return Values

Was this information helpful?