Using NI-HSDIO in Visual C and C++

NI Digital Waveform Generator/Analyzer Help

Edition Date: June 2013

Part Number: 370520P-01

»View Product Info
Download Help (Windows Only)

This topic assumes that you are using the Microsoft Visual C or C++ ADE to manage your code development.

To develop an NI-HSDIO application with Microsoft Visual C++ 6.0, follow these general steps:

  1. Open an existing or new Visual C/C++ project to manage your application code.
  2. Create source code files of type .c (C) or .cpp (C++).
  3. Add the source code files to the project.
  4. Add the following code in the source code files:

    #include "nihsdio.h"

  5. Add the NI-HSDIO include and library files to the project. <IVIROOTDIR32> is an alias to a specific National Instruments file folder location. Refer to the NI-HSDIO Readme for more information about installed file locations.
    Tip Tip  You can modify an NI-HSDIO C example to create an application, and all required include and library files are added to the project for you.
    1. Select Project»Settings»C/C++»Preprocessor»Additional include directories, and add the paths, separated by a semicolon, to the nihsdio.h and visa.h files. The nihsdio.h and visa.h files are located in the <IVIROOTDIR32>\Include and <VXIPNPPATH>\WinNT\Visa\include directories, respectively.
    2. Select Project»Link»General»Object/Library Modules, and add nihsdio.lib.
    3. Select Project»Link»Input»Additional library path, and add the path to the nihsdio.lib file. The nihsdio.lib file is located in the <IVIROOTDIR32>\Lib\msc or the <IVIROOTDIR32>\Lib x64\msc directory.
  6. Build your application using the appropriate programming flow steps.

Creating an Application with Microsoft Visual Studio 2010

To develop an NI-HSDIO application with Microsoft Visual Studio 2010, follow these general steps:

  1. Open an existing or new Visual C++ project to manage your application code.
  2. Create source code files of type .c (C) or .cpp (C++).
  3. Add the source code files to the project.
  4. Add the following code in the source code files:

    #include "nihsdio.h"

  5. Add the NI-HSDIO include and library files to the project. <IVIROOTDIR32> is an alias to a specific National Instruments file folder location. Refer to the NI-HSDIO Readme for more information about installed file locations.
    1. Select Project»Properties»Configuration Properties»C/C++»General»Additional Include Directories, add the paths, separated by a semicolon, to the nihsdio.h and visa.h files. The nihsdio.h and visa.h files are located in the <IVIROOTDIR32>\Include and <VXIPNPPATH>\WinNT\Visa\include directories, respectively.
    2. Select Linker»Input»Additional Dependencies, and add nihsdio.lib.
    3. Select Linker»General»Additional Dependencies, and add the path to the nihsdio.lib file. The nihsdio.lib file is located in the <IVIROOTDIR32>\Lib\msc or the <IVIROOTDIR32>\Lib x64\msc directory.
  6. Build your application using the appropriate programming flow steps.

Microsoft Visual C and Visual C++ Examples

The C examples were built and tested using Microsoft Visual C++ 6.0 with Service Pack 5.0. These examples are console-based with no graphical interface.

To build the examples in Microsoft Visual C++ 6.0 using the Microsoft NMAKE utility, complete the following steps:

  1. Go to the directory for the particular example you want to use.
  2. Run the VCVARS32.BAT batch file (located in the \bin directory of the MSVC compiler) to set up the environment variables for command line usage if they are not already set. You might need to increase the initial environment size of the DOS box to accommodate the added environment variables.
  3. To build an example, run nmake examplename.mak. The executable is built to the debug subdirectory by default.

To build the examples in Microsoft Visual C++ 6.0 using the Microsoft Developer Studio workspace, complete the following steps:

  1. Go to the directory for the example you want to use.
  2. Open the project workspace file (.dsw) that launches Developer Studio. You can find the installed location of this file in the NI-HSDIO Readme.
  3. Build the example.

WAS THIS ARTICLE HELPFUL?

Not Helpful