DAQmxWaitForNextSampleClock

NI-DAQmx C Functions

DAQmxWaitForNextSampleClock

int32 DAQmxWaitForNextSampleClock (TaskHandle taskHandle, float64 timeout, bool32 *isLate);

Purpose

Waits until the next pulse of the Sample Clock occurs. If an extra Sample Clock pulse occurs between calls to this function, the second call returns an error or warning and waits for the next Sample Clock pulse. Use the get/set/reset functions for the RealTimeConvLateErrorsToWarnings property to specify whether this function returns errors or warnings.

Use this function to ensure I/O cycles complete within Sample Clock periods. National Instruments recommends you use this function for certain applica tions only.

Use the DAQmx Real-Time properties to configure error reporting and waiting options.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
timeout float64 The maximum amount of time, in seconds, to wait for the next Sample Clock pulse. If the time elapses, this VI returns an error. The default timeout is 10 seconds. If you set timeout to -1, this VI waits indefinitely.
Output
Name Type Description
isLate int32 A value of 0 indicates the read or write function executed in real time. A value of 1 indicates the function did not execute in real time.

Return Value

Name Type Description
isLate int32 Indicates if this function detected an extra Sample Clock pulse after the specified number of warmup iterations execute. If you are using the C API, use DAQmxSetRealTimeNumOfWarmupIters to specify the number of warmup iterations. If you are using the CVI API, use DAQmxSetRealTimeAttribute to specify the number of iterations. This output is always FALSE until that number of loop iterations execute.