Copies 64-bit data from a Windows global memory buffer into a one-dimensional or two-dimensional array. This method is typically used to retrieve data from the buffer after executing an input scan method.
Member of the MccService class.
VB .NET
Copies data into a two-dimensional array of long values:
Public Shared Function WinBufToArray64(ByVal memHandle As IntPtr, ByVal dataArray(,) As Long(), ByVal firstPoint As Integer, ByVal numPoints As Integer, ByVal numChannels As Integer) As MccDaq.ErrorInfo
Copies data into an array of integer values:
Public Shared Function WinBufToArray64(ByVal memHandle As IntPtr, ByVal dataArray As Integer(), ByVal firstPoint As Integer, ByVal numPoints As Integer) As MccDaq.ErrorInfo
Copies data into an array of System.UInt64 values:
Public Shared Function WinBufToArray64(ByVal memHandle As IntPtr, ByVal dataArray As System.UInt64(), ByVal firstPoint As Integer, ByVal numPoints As Integer) As MccDaq.ErrorInfo
C# .NET
Copies data into a two-dimensional array of long values:
public int MccDaq.ErrorInfo WinBufToArray64(IntPtr MemHandle, long[] dataArray, int firstPoint, int numPoints)
Copies data into an array of integer values:
public int MccDaq.ErrorInfo WinBufToArray64(IntPtr memHandle, int[] dataArray, int firstPoint, int numPoints)
Copies data into an array of System.UInt64 values:
public int MccDaq.ErrorInfo WinBufToArray64(int memHandle, uint[] dataArray, int firstPoint, int numPoints)
memHandle
The memory handle that was returned by WinBufAlloc64() when the buffer was allocated. The buffer should contain the data that you want to copy.
dataArray
The array where the data is copied.
firstPoint
The index of the first point in the memory buffer that data is copied from.
numPoints
The number of data points to copy.
numChannels
The number of channels to copy into dataArray.
/*declare and initialize the variables*/
long numPoints= 1000;
unsigned short *dataArray = NULL;
int MemHandle = 0;
/*allocate the buffer and cast it to a pointer to an unsigned long*/
MemHandle = WinBufAlloc64(numPoints);
dataArray = (unsigned long*)MemHandle;
/*scan in the data*/
CInScan(......,MemHandle,...);
/*print the results*/
for(int i=0; i<numPoints; ++i)
printf("Data[%d]=%d\n", i, dataArray[i]);
/*free the buffer and NULL the pointer*/
WinBufFree(MemHandle);
dataArray = NULL;