# MemReadPretrig()

Reads pre-trigger data from a memory board that has been collected with the APretrig() method and re-arranges the data in the correct order (pre-trigger data first, then post-trigger data). This method can only be used to retrieve data that has been collected with the APretrig() method with ExtMemory set in the options parameter. After each APretrig() call, all data must be unloaded from the memory board with this method. If any more data is sent to the memory board then the pre-trigger data will be lost.

Member of the MccBoard class.

## Function Prototype

VB .NET

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

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

C# .NET

publicMccDaq.ErrorInfo MemReadPretrig(short[] dataBuffer, int firstPoint, int numPoints)

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

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

C# .NET

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

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

## Parameters

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 samples (words) to read.

## Returns

- An ErrorInfo object that indicates the status of the operation.
- dataBuffer - data read from 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 MemReadPretrig() when working with large amounts of data.
- For example, to read 300,000 points in 100,000 chunks, the calls would look like this:

DaqBoard0.MemReadPretrig(dataBuffer, 0, 100000)

DaqBoard0.MemReadPretrig(dataBuffer, FROMHERE, 1000000)

DaqBoard0.MemReadPretrig(dataBuffer, FROMHERE, 1000000)

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