NI-DAQmx .NET Framework 4.5 API Reference

Table of Contents

Task.Stop Method

  • Updated2023-02-21
  • 1 minute(s) read
Task.Stop Method
Transitions the task from the running to the committed state, which ends the measurement or generation.

Namespace:  NationalInstruments.DAQmx
Assembly:  NationalInstruments.DAQmx (in NationalInstruments.DAQmx.dll) Version: 20.7.45.49302

Syntax

public void Stop()
Public Sub Stop

Exceptions

ExceptionCondition
DaqExceptionThe NI-DAQmx driver returned an error.

Remarks

If you do not use this method, the read method ends a measurement task automatically before returning. How you set the autoStart parameter of the write method determines if calling the write method automatically ends a generation task before returning. If you do not use Start and Stop when you use a read or write method multiple times, the task starts and stops repeatedly, which reduces the performance of the application.

If an asynchronous read or write on the task is in progress, Stop does not return until the data from the pending read or write has been transferred to or from the task buffer. Stop does not wait for read or write asynchronous callback methods to finish, however.

You may pass Abort to the Control(TaskAction) method stop the task immediately, without waiting for any currently running operation to complete.

See Also

Log in to get a better experience