Using NI-DMM in Visual C/C++

NI Digital Multimeters Help (NI-DMM 18.1)

Edition Date: March 2018

Part Number: 370384V-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 and that you are familiar with the following ADEs:

Creating an Application with Microsoft Visual C++ 6.0

To develop an NI-DMM 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 "niscope.h"

  5. Add the NI-DMM include and library files to the project. <IVIROOTDIR32> is an alias to a specific National Instruments file folder location. Refer to the NI-DMM Readme for more information about installed file locations.
    1. Select Project»Settings»C/C++»Preprocessor»Additional include directories, and add the paths, separated by a semicolon, to the nidmm.h and visa.h files. The niscope.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 nidmm.lib.
    3. Select Project»Link»Input»Additional library path, and add the path to the ndmm.lib file. The nidmm.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-DMM application with Microsoft Visual Studio 2010, 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 "nidmm.h"

  5. Add the NI-DMM include and library files to the project. <IVIROOTDIR32> is an alias to a specific National Instruments file folder location. Refer to the NI-DMM 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 niscope.h and visa.h files. The niscope.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 nidmm.lib.
    3. Select Linker»General»Additional Dependencies, and add the path to the nidmm.lib file. The nidmm.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.

Example Programs

You can find the installed locations of example programs in the NI-DMM Readme File. For additional information regarding NI-DMM examples, refer to the Examples section.

String Passing

To pass strings, pass a pointer to the first element of the character array. Be sure that the string is null-terminated.

Parameter Passing

By default, C passes parameters by value. Remember to pass pointers to variables when you need to pass by address.

Related Topics

Examples

Programming Flow

Related Documentation

WAS THIS ARTICLE HELPFUL?

Not Helpful