# cbMemWrite()

Writes data from an array to the memory card.

## Function Prototype

C/C++

int cbMemWrite(int BoardNum, unsigned short DataBuffer[], long FirstPoint, long Count)

Visual Basic

Function cbMemWrite(ByVal BoardNum&, DataBuffer%, ByVal FirstPoint&, ByVal Count&) As Long

## Arguments

BoardNum

The number associated with the board when it was installed with InstaCal or created with cbCreateDaqDevice(). BoardNum may be 0 to 99.

DataBuffer

Pointer to the data array.

FirstPoint

Index of first point to write or FROMHERE. Use FirstPoint to specify the first point to write data to. For example, to write to location numbers 200 through 250, set FirstPoint = 200 and Count = 50.

Count

Number of data points (words) to write.

## Returns

- Error code or 0 if no errors

## Notes

- To write a large amount of data to the board in small chunks, set FirstPoint to FROMHERE to write each successive chunk. For example, to write 300,000 points in 100,000 point chunks:

cbMemWrite(0, DataBuffer, 0, 100000)

cbMemWrite(0, DataBuffer, FROMHERE, 100000)

cbMemWrite(0, DataBuffer, FROMHERE, 100000)

- DT-Connect Conflicts: The cbMemWrite() function 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 cbAInScan() with the DTCONNECT + BACKGROUND options). You cannot call cbMemWrite() until the cbAInScan() is complete. Doing so will generate a DTACTIVE error.