Handles the end of an asynchronous read initiated with BeginMemoryOptimizedReadSingleSampleMultiLine(AsyncCallback, object, bool[, ]) and retrieves the read samples.

Syntax

Namespace: NationalInstruments.DAQmx

public bool[,] EndMemoryOptimizedReadSingleSampleMultiLine(IAsyncResult asyncResult)

Remarks

If you call this method before the asynchronous read is complete, it waits for the read to complete before returning.

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.

Note

Refer to Asynchronous Reads and Writes for additional information.


Asynchronous Reads and Writes

Parameters

NameTypeDescription
asyncResultIAsyncResult

An IAsyncResult that represents an asynchronous call started by calling BeginMemoryOptimizedReadSingleSampleMultiLine(AsyncCallback, object, bool[, ]).

Returns

A 2D array of Boolean samples from the task. Each element in the first dimension of the array corresponds to a channel in the task. Each element in the second dimension of the array corresponds to a line in that channel. The order of the channels in the array corresponds to the order in which you add the channels to the task or to the order of the channels you specify in ChannelsToRead.

Exceptions

TypeDescription
ArgumentException

  1. If data  is null or is uninitialized;  

  2. If the first dimension of data  does not match the number of channels; or  

  3. asyncResult  is null or is not an instance of IAsyncResult returned from a call to BeginMemoryOptimizedReadSingleSampleMultiLine(AsyncCallback, object, bool[, ]).  

NationalInstruments.DAQmx.DaqException

The NI-DAQmx driver returned an error during the asynchronous operation.

OutOfMemoryException

There is not enough memory to carry out this operation.