DaqStream.ReadRaw Method
- Updated2023-02-21
- 1 minute(s) read
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: ByteA byte array of raw data from the task.
Exceptions
Exception | Condition |
---|---|
DaqException | The NI-DAQmx driver returned an error. |
OutOfMemoryException | There 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.