NI-DAQmx .NET Framework 4.0 API Reference

Content Type
Programming Language
Current manual
Table of Contents

DaqStream.ReadRaw Method

DaqStream.ReadRaw Method

DaqStreamReadRaw Method

Reads raw, unprocessed samples from the channels in the task.

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

Syntax

public byte[] ReadRaw(
	int samplesPerChannel
)
Public Function ReadRaw ( 
	samplesPerChannel As Integer
) As Byte()

Parameters

samplesPerChannel
Type: SystemInt32
The number of samples to read. If you set samplesPerChannel to -1 for a continuous acquisition, the read retrieves all samples available in the buffer at the time of the read. If you set samplesPerChannel to -1 for a finite acquisition, the read behavior is set by the ReadAllAvailableSamples property of the DaqStream you are reading from.

Return Value

Type: Byte
A byte array of raw data from the task.

Exceptions

ExceptionCondition
DaqExceptionThe NI-DAQmx driver returned an error.
OutOfMemoryExceptionThere is not enough memory to carry out this operation.

Remarks

The format of the raw samples depends on the device from which you are reading. Consult your device documentation for more information.

You can use the MemoryStream class to translate the returned byte array data into other types.

Refer to NI-DAQmx Readers and Writers for more information about memory limitations in NI-DAQmx read methods.

See Also

Was this information helpful?