AnalogSingleChannelWriter.EndWrite Method
- Updated2023-02-21
- 2 minute(s) read
AnalogSingleChannelWriterEndWrite Method
Namespace: NationalInstruments.DAQmx
Assembly: NationalInstruments.DAQmx (in NationalInstruments.DAQmx.dll) Version: 20.7.40.49302
Syntax
public void EndWrite( IAsyncResult asyncResult )
Public Sub EndWrite ( asyncResult As IAsyncResult )
Parameters
- asyncResult
- Type: SystemIAsyncResult
An IAsyncResult that represents an asynchronous call started by calling BeginWriteMultiSample(Boolean, Double, AsyncCallback, Object) or BeginWriteSingleSample(Boolean, Double, AsyncCallback, Object).
Exceptions
Exception | Condition |
---|---|
ArgumentException | asyncResult is or is not an instance of IAsyncResult returned from a call to BeginWriteMultiSample(Boolean, Double, AsyncCallback, Object) or BeginWriteSingleSample(Boolean, Double, AsyncCallback, Object). |
DaqException | The NI-DAQmx driver returned an error during the asynchronous operation. |
IndexOutOfRangeException | The data provided to BeginWriteMultiSample(Boolean, Double, AsyncCallback, Object) has a non-zero lower bound. |
Remarks
If you call EndWrite(IAsyncResult) before the asynchronous write represented by the provided IAsyncResult is complete, EndWrite(IAsyncResult) waits for the write to complete before returning. For a write to a buffered task, the write is considered complete when all of the written samples have been transferred to the task buffer. Use IsDone or WaitUntilDone(Int32) on the Task object to determine if a task has generated all of the data it was configured to generate.
NI-DAQmx scales the returned data to the units of the measurement, including any custom scaling you apply to the channel. You specify these units with the create channel methods or the DAQ Assistant.
NI-DAQmx read and write methods time out after the amount of time specified by the Timeout property on the task you are reading from or writing to.
![]() |
---|
Refer to Asynchronous Reads and Writes for additional information. |