niHSDIO_WaitUntilDone

NI Digital Waveform Generator/Analyzer

niHSDIO_WaitUntilDone

Specific Function

C Function Prototype

ViStatus niHSDIO_WaitUntilDone (ViSession vi, ViInt32 maxTimeMilliseconds);

Purpose

Call this function to pause execution of your program until the dynamic data operation is completed or the function returns a timeout error. niHSDIO_WaitUntilDone is a blocking function that periodically checks the operation status. It returns control to the calling program if the operation completes successfully or an error occurs (including a timeout error).

This function is most useful for finite data operations that you expect to complete within a certain time.

Parameters

Name Type Description
vi ViSession This handle identifies your instrument session. vi was obtained from the niHSDIO_InitAcquisitionSession or niHSDIO_InitGenerationSession function.
maxTimeMilliseconds ViInt32 This parameter specifies the number of milliseconds to allow the function to complete before returning. If the specified time elapses before the data operation has completed, the function returns a timeout error.

Setting a value of 0 causes the function to return immediately. This setting can be useful to manually poll for hardware errors after a data operation has been initiated. If no other error has occurred and the data operation is still not complete, the function returns a timeout error.

Setting a value of -1 causes the function to never timeout. Be careful not to use this value during a continuous operation, as it will never return unless a hardware error occurs. Perform a manual device reset from Measurement & Automation Explorer if you get stuck in this state or use niHSDIO_reset or niHSDIO_ResetDevice from the other session of the device.

Default Value: 10000

Return Value