# MemRead()

Reads data from a memory board into an array.

Member of the MccBoard class.

## Function Prototype

VB .NET

Public Function MemRead(ByVal dataBuffer As Short(), ByVal firstPoint As Integer, ByVal numPoints As Integer) As MccDaq.ErrorInfo

Public Function MemRead(ByVal dataBuffer As System.UInt16(), ByVal firstPoint As Integer, ByVal numPoints As Integer) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo MemRead(short[] dataBuffer, int firstPoint, int numPoints)

public MccDaq.ErrorInfo MemRead(ushort[] dataBuffer, int firstPoint, int numPoints)

##### Deprecated methods

The following methods are deprecated, and should only be used for legacy applications. The methods above are preferred, and must be used for 64-bit application development.

VB .NET

Public Function MemRead(ByRef dataBuffer As Short, ByVal firstPoint As Integer, ByVal numPoints As Integer) As MccDaq.ErrorInfo

Public Function MemRead(ByRef dataBuffer As System.UInt16, ByVal firstPoint As Integer, ByVal numPoints As Integer) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo MemRead(out short dataBuffer, int firstPoint, int numPoints)

public MccDaq.ErrorInfo MemRead(out ushort dataBuffer, int firstPoint, int numPoints)

## Parameter

dataBuffer

Reference to the data array.

firstPoint

Index of first point to read, or FromHere. Use the firstPoint parameter to specify the first point to be read. For example, to read data sample numbers 200 through 250, set firstPoint = 200 and numPoints = 50.

numPoints

Number of data points (words) to read.

## Returns

- An ErrorInfo object that indicates the status of the operation.
- dataBuffer - data read from the memory board.

## Notes

- If you are going to read a large amount of data from the board in small chunks, set firstPoint to FromHere to read each successive chunk. Using FromHere speeds up the operation of MemRead() when working with large amounts of data.
- For example, to read 300,000 points in 100,000 point chunks, the calls would look like this:

DaqBoard0.MemRead(dataBuffer, 0, 100000)

DaqBoard0.MemRead(dataBuffer, FROMHERE, 1000000)

DaqBoard0.MemRead(dataBuffer, FROMHERE, 1000000)

- DT-Connect conflicts: The MemRead() method cannot be called while a DT-Connect transfer is in progress. For example, if you start collecting A/D data to the memory board in the background (by calling AInScan() with the DTConnect + Background options) you cannot call MemRead() until the AInScan() has completed. If you do you will get a DTACTIVE error.