Task.Control Method
- Updated2023-02-21
- 1 minute(s) read
TaskControl Method
Namespace: NationalInstruments.DAQmx
Assembly: NationalInstruments.DAQmx (in NationalInstruments.DAQmx.dll) Version: 20.7.40.49302
Syntax
public void Control( TaskAction mode )
Public Sub Control ( mode As TaskAction )
Parameters
- mode
- Type: NationalInstruments.DAQmxTaskAction
The action to use to alter the state of the task.
Exceptions
Exception | Condition |
---|---|
DaqException | The NI-DAQmx driver returned an error. |
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.