Control(TaskAction)
- Updated2026-02-03
- 1 minute(s) read
Alters the state of the task according to the mode you specify.
Syntax
Namespace: NationalInstruments.DAQmx
public void Control(TaskAction mode)
Remarks
To start a task more quickly, set mode to Commit to program the hardware with all parameters of the task prior to starting it.
If the task is in the running state and an asynchronous read or write on the task is in progress, calling Control(TaskAction) to move the task out of the running state does not return until the data from the pending read or write has been transferred to or from the task buffer. However, if mode is Abort, then Control(TaskAction) does not wait for the asynchronous read or write callback methods to finish. The pending asynchronous call stops immediately and raises a DaqException.
Parameters
| Name | Type | Description |
|---|---|---|
| mode | TaskAction | The action to use to alter the state of the task. |
Exceptions
| Type | Description |
|---|---|
| NationalInstruments.DAQmx.DaqException | The NI-DAQmx driver returned an error. |