NI-DAQmx .NET Framework 4.0 API Reference

Content Type
Programming Language
Current manual
Table of Contents
Product DocumentationNI-DAQmx .NET Framework 4.0 API ReferenceCounterSingleChannelReader.EndMemoryOptimizedReadMultiSampleDouble MethodCurrent page
Table of Contents

CounterSingleChannelReader.EndMemoryOptimizedReadMultiSampleDouble Method

CounterSingleChannelReader.EndMemoryOptimizedReadMultiSampleDouble Method

CounterSingleChannelReaderEndMemoryOptimizedReadMultiSampleDouble Method

Handles the end of an asynchronous read initiated with BeginMemoryOptimizedReadMultiSampleDouble(Int32, AsyncCallback, Object, Double) and retrieves the read samples.

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

Syntax

public double[] EndMemoryOptimizedReadMultiSampleDouble(
	IAsyncResult asyncResult,
	out int actualNumberOfSamplesRead
)
Public Function EndMemoryOptimizedReadMultiSampleDouble ( 
	asyncResult As IAsyncResult,
	<OutAttribute> ByRef actualNumberOfSamplesRead As Integer
) As Double()

Parameters

asyncResult
Type: SystemIAsyncResult
An IAsyncResult that represents an asynchronous call started by calling BeginMemoryOptimizedReadMultiSampleDouble(Int32, AsyncCallback, Object, Double).
actualNumberOfSamplesRead
Type: SystemInt32
The actual number of samples read. This is useful when the reading operation yields fewer or more samples than the actual length of data.

Return Value

Type: Double
A 1D array of Double samples that contains the read data. Each element in the array corresponds to a sample from the channel.

Exceptions

ExceptionCondition
ArgumentException
  1. If data is or is uninitialized;
  2. If the first dimension of data does not match the number of channels;
  3. If ReallocationPolicy is not ToGrow, and data is not capable of holding the required number of samples; or
  4. For asynchronous reads, if asyncResult is or is not an instance of IAsyncResult returned from a call to BeginMemoryOptimizedReadMultiSampleDouble(Int32, AsyncCallback, Object, Double).
DaqExceptionThe NI-DAQmx driver returned an error during the asynchronous operation.
OutOfMemoryExceptionThere is not enough memory to carry out this operation.

Remarks

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

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.

Note Note
Refer to Asynchronous Reads and Writes for additional information.

See Also

Was this information helpful?