GxFpgaRead

Purpose

Reads the specified number of data elements from the User’s FPGA specified BAR memory.

Syntax

GxFpgaRead (nHandle, nMemoryBar, dwOffset, pvData, nElementSize, dwSize, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle for a GX3700 board.
nMemoryBar
SHORT
The board’s specified memory mapped address space BAR number, values are as follows:
1.   GXFPGA_MEMORY_BAR1: Memory mapped address space BAR 1.
2.   GXFPGA_MEMORY_BAR2: Memory mapped address space BAR 2.
3.   GXFPGA_MEMORY_BAR3: Memory mapped address space BAR 3.
4.   GXFPGA_MEMORY_BAR4: Memory mapped address space BAR 4.
dwOffset
DWORD
The offset in the FPGA’s shared memory space in terms of bytes, must be aligned to 4 bytes address.
pvData
PVOID
A buffer that will be written to the FPGA’s shared memory. Buffer size must be as indicated by the dwSize.
nElementSize
SHORT
The data Size in bytes.
dwSize
DWORD
The number of data elements to be read from the memory location.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Example

The following example read 100 DWORD data points from BAR2 memory space at offset 8:

 

DWORD adwData[100];

GxFpgaRead (nHandle, GXFPGA_MEMORY_BAR2, 0x8, &adwData, 4, 100, &nStatus);

 

See Also

GxFpgaWrite, GxFpgaWriteRegister, GxFpgaGetErrorString