Digital Multimeters (DMMs) and Precision DC Sources

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Include errors for NiDMM.h

Solved!
Go to solution

I am writing software in MS Visual C++ 6 to talk to a USB-4065 DMM. I copied the required include files nidmm_32.lib and nidmm.h files into the project directory. But the linker complained about a .h file missing, I'd copy it to the project directory & get yet another missing file. This is the summary of what I copied:

 

ivi.h -> visa.h -> visatype.h -> vpptype.h -> ividmm.h -> ivi.h, which is already in the directory, yet it can't be found!

 

I have programmed VISA and GPIB in the past, and thought the DMM interface would be like the GPIB with an included file.

 

Any help would be appreciated.

 

Thanks

0 Kudos
Message 1 of 3
(7,371 Views)
Solution
Accepted by Gary B.

Hello Gary,

 

Have you installed NI-VISA? If not, please download and install it. If you do have VISA, how are you going about linking the .h files to the project?

 

You should import the nidmm.lib file to the project since this is the actual file that contains your definition. For the walkthrough on how to do this, just open up the NI Digital Multimeter help (Start>>All Programs>>National Instruments>>NI DMM>>Documentation). Once this opens, go to the Contents tab and go to NI Digital Multimeters Help>>Programming with NI-DMM>>Getting Started>>Using NI-DMM in Visual C++.

 

Also, Although you may be instructing the compiler as to where it should look for your .lib file by giving it this path, you may have not yet told it the exact name of that .lib. Just because your ".h" file is called nidmm.h doesn't mean that the corresponding ".lib" file is required to be called "nidmm.lib".

 

What you may need to do is to either add nidmm.lib to your project or you can go to the project properties and go to Configuration Properties>>Linker>>Input and within the Input window you need to add "nidmm.lib" to the Additional Dependencies field so the compiler knows which .lib file you would like it to search through for your nidmm_init function.

 

Let me know if any of this helps.

 

Thanks,

Ryan

 

 

0 Kudos
Message 2 of 3
(7,363 Views)

Ryan,

 

   I had made the mistake of assuming that the DMM library was self contained, like the GPIB library - just copy it into your project directory, include it & compile. When I added in the VISA stuff it compiled fine.

 

   For future reference, here are the changes I made to my project in Debug mode of VC++ 6.0 (should be the same for Release):

 

Project|Settings|C/C++|Category: Preprocessor

   in the "Additional Include Directories" box insert the text C:\Program Files\IVI Foundation\VISA\WinNT\include

 

Project|Settings|Link| Category: Input

   Add visa32.lib and nidmm.lib to the "Object/Library Modules" box. Both are needed.

   in the "Additional Library Path" box insert the text C:\Program Files\IVI Foundation\VISA\WinNT\lib\msc\

 

Note that the text is exactly as shown, no quotes are needed.

 

This is for NIVISA version 4.5.1, which I loaded from the NI-DMM 3.0.1 DVD.

 

Thanks for the help!

 

    ~garyb

 

0 Kudos
Message 3 of 3
(7,321 Views)