# MemWrite()

Writes data from an array to the memory card.

Member of the MccBoard class.

## Function Prototype

VB .NET

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

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

C# .NET

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

public MccDaq.ErrorInfo MemWrite(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 MemWrite(ByRef dataBuffer As Short, ByVal firstPoint As Integer, ByVal numPoints As Integer) As MccDaq.ErrorInfo

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

C# .NET

public MccDaq.ErrorInfo MemWrite(ref short dataBuffer, int firstPoint, int numPoints)

public MccDaq.ErrorInfo MemWrite(ref ushort dataBuffer, int firstPoint, int numPoints)

## Parameters

dataBuffer

Reference to the data array.

firstPoint

Index of first point to write or FromHere. Use the firstPoint parameter to specify where in the board's memory to write the first point. For example, to write to location numbers 200 through 250, set firstPoint = 200 and numPoints = 50.

numPoints

Number of data points (words) to write.

## Returns

- An ErrorInfo object that indicates the status of the operation.

### Notes

- To write large amounts of data to the board in small chunks, set firstPoint to FromHere to write each successive chunk. Using FromHere speeds up the operation of MemWrite() when working with large amounts of data.
- For example, to write 300,000 points in 100,000 point chunks, the calls would look like this:

DaqBoard1.MemWrite(dataBuffer, 0, 100000)

DaqBoard1.MemWrite(dataBuffer, FromHere, 100000)

DaqBoard1.MemWrite(dataBuffer, FromHere, 100000)

- DT-Connect conflicts: The MemWrite() 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 MemWrite() until the AInScan() has completed. If you do, you will get a DTACTIVE error.