niHSDIO_ConfigureSampleClock
- Updated2023-02-21
- 2 minute(s) read
ViStatus = niHSDIO_ConfigureSampleClock ( ViSession vi, ViConstString clockSource, ViReal64 clockRate);
Purpose
Configures the Sample clock. This function allows you to specify the Sample clock source and rate.
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 the NIHSDIO_ATTR_SAMPLE_CLOCK_RATE attribute 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.
Related topics:
Parameters
| Input | ||
| Name | Type | Description |
| vi | ViSession | Identifies your instrument session. vi was obtained from the niHSDIO_InitAcquisitionSession or niHSDIO_InitGenerationSession function. |
| Clock Source | 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 valid only for acquisition operations. NIHSDIO_VAL_CLK_IN_STR ("ClkIn")—The device uses the signal present on the front panel CLK IN 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. |
| Clock Rate | ViReal64 | Specifies the Sample clock rate, expressed in Hz. You must set this parameter even when you supply an external clock because NI-HSDIO uses this parameter for a number of reasons, including optimal error checking and certain pulse width selections. |
Return Value
| Name | Type | Description | ||||||||
| Status | ViStatus | Reports the status of this operation. To obtain a text description of the status code, call the niHSDIO_error_message function. To obtain additional information concerning the error condition, use the niHSDIO_GetError and niHSDIO_ClearError functions. The general meaning of the status code is as follows:
|