How to Run Getting Started with PXIe-5763 and PXIe-5764 FlexRIO C API Example in Visual Studio

Updated Nov 19, 2024

Environment

Hardware

  • PXIe-5764
  • PXIe-5763
  • PCIe-5763
  • PCIe-5764

Overview:

This article explains the steps to run the "Getting Started with PXIe-5763 and PXIe-5764" example for NI FlexRIO C API. Some of the steps described below such as including proper header files and library files also applies to other example C programs provided in National Instruments hardware drivers.

Steps:

  1. Open Visual Studio and make sure that Visual C++ component is installed

  2. Create a new project from File > New > Project. From the popup menu, Select Template > Visual C++ > Windows > Empty Project and create a new project
    new project.png 

  3. On the toolbar, select Build > Configuration Manager and set Active solution configuration to Debug and Active solution platform to x86.
    config manager.png 

  4. Make sure that Solution Explorer is open. If not, go to View > Solution Explorer to display it

  5. Right Click on Project and select Properties

  6. Select Configuration Properties > VC++ Directories and click on General > Include Directories. Upside down triangle will be displayed, so click it and select <Edit…> to open Include Directories popup menu.
    Property Page.png 

  7. Create a new line by clicking the new folder icon and add the directories for niflexrioapi.h (C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\include), IviVisaType.h (C:\Program Files (x86)\IVI Foundation\IVI\Include) and asciiplot.h (C:\Users\Public\Documents\National Instruments\FlexRIO\Examples\Getting Started with PXIe-5763 and PXIe-5764). Click OK button to save the directories.
    Include.png 

  8. Select General > Library Directories and open Library Directories popup. Add the directory for niflexrioapi.lib (C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib32\msvc) and click OK button to save.

  9. Click Apply button to apply the changes to the source directories

  10. In Solution Explorer, right click on Resource Files and select Add > Existing Item... to add getting_started_5763_5764.c and asciiPlot.c, both located in C:\Users\Public\Documents\National Instruments\FlexRIO\Examples\Getting Started with PXIe-5763 and PXIe-5764

  11. Right click on Resource Files and select Add > Existing Item... to add niflexrioapi.lib located in C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib32\msvc
    solution explorer.png 

  12. From Toolbar, go to Build > Build Solution. On Output console, you should see the following message.

    ========== Build: succeeded 1、failed 0、up-to-date 0、skipped 0 ==========

  13. Go to Debug > Start Debugging to run the program

Result:

After build is succeeded, you should see the debugging console with the result similar to the image below:

console.png