LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Reference an FPGA Array of Controls

Solved!
Go to solution

I am developing a cRIO application that has an array of 23 controls in the FPGA.  The FPGA Interface C API Generator defined them as a name and size.

 

typedef enum
{
   NiFpga_ControlArrayU32_Setpoints = 0x8118,
} NiFpga_ControlArrayU32;

 

typedef enum
{
   NiFpga_ControlArrayU32Size_Setpoints = 24,
} NiFpga_ControlArrayU32Size;

 

How would I reference the 15th setpoint, as NiFpga_ControlArrayU32[15] or as an offest to 0x8118?

 

0 Kudos
Message 1 of 3
(4,603 Views)
Solution
Accepted by topic author Paul_Knight_Lockheed_Mart

Hi Paul_Knight,

 

When the C headers are generated, there should be one called NiFPGA.h.

 

There is a function within this header for reading a U32 array. The function is called NiFpga_ReadArrayU32. Here is some documentation on the various read array functions.

 

http://zone.ni.com/reference/en-XX/help/372928G-01/capi/functions_readarray/

 

You should be able to read the array values and store them into an array in C. Then you can access them as you would normally within your C program. Hope this helps!

Robert B
RF Product Support Engineer
National Instruments
0 Kudos
Message 2 of 3
(4,572 Views)

Thanks, I should have looked there first.

0 Kudos
Message 3 of 3
(4,566 Views)