niHSDIO_ConfigureSampleClock

NI Digital Waveform Generator/Analyzer

niHSDIO_ConfigureSampleClock

Specific Function

C Function Prototype

ViStatus niHSDIO_ConfigureSampleClock (ViSession vi, ViConstString clockSource, ViReal64 clockRate);

Purpose

Configures the Sample clock. This function allows you to specify the clock source and rate for the Sample clock.

If clockSource is set to NIHSDIO_VAL_ON_BOARD_CLOCK_STR, NI-HSDIO coerces the rate to a value that is supported by the hardware. Use the niHSDIO_GetAttributeViReal64 function to get the value for NIHSDIO_ATTR_SAMPLE_CLOCK_RATE to see to what value NI-HSDIO has coerced the Sample clock rate.

clockSource can be set to NIHSDIO_VAL_STROBE_STR for acquisition only.

Parameters

Name Type Description
vi ViSession This handle identifies your instrument session. vi was obtained from the niHSDIO_InitAcquisitionSession or niHSDIO_InitGenerationSession function.
clockSource ViConstString Specifies the Sample clock source. Refer to NIHSDIO_ATTR_SAMPLE_CLOCK_SOURCE for details.

Defined Values

NIHSDIO_VAL_ON_BOARD_CLOCK_STR ("OnBoardClock")—The device uses the On Board Clock as the Sample clock source.
NIHSDIO_VAL_STROBE_STR ("STROBE")—The device uses the signal present on the STROBE channel as the Sample clock source. This choice is only valid for acquisition operations.
NIHSDIO_VAL_CLK_IN_STR ("ClkIn")—The device uses the signal present on the front panel CLK IN SMB jack connector as the Sample clock source.
NIHSDIO_VAL_PXI_STAR_STR ("PXI_STAR")—The device uses the signal present on the PXI_STAR line as the Sample clock source. This choice is valid for devices in slots that support PXI_STAR.

Default Value: NIHSDIO_VAL_ON_BOARD_CLOCK_STR
clockRate ViReal64 Specifies the Sample clock rate, expressed in Hz. You must set this property even when you supply an external clock because NI-HSDIO uses this property for a number of reasons, including optimal error checking and certain pulse width selections.

Default Value: 50000000

Return Value