Digital Multimeters (DMMs) and Precision DC Sources

cancel
Showing results for 
Search instead for 
Did you mean: 

nidmm.h causing C Linkage error between two overloaded iviBufWrite functions

Solved!
Go to solution
Highlighted

I am using the PXIe-1078 box with the PXIe-4080 Multimeter and PXIe2636 Switch Matrix. I’m using Visual Basic 2013 C++ to write the program being used with the products.

 

I am trying to use the C:\Program Files (x86)\IVI Foundation\IVI\Include and C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Include directories in order to use the “niSwitch.h” and “nidmm.h” header files. However the C linkage is causing problems because  there are two functions, one in “visa.h”(line 147) and one in “ivi.h”(line 1446) called Ivi_BufWrite that have different parameters and cannot be overloaded thus causing me to be unable to build my project.

 

I have been been unable to determine what is causing this problem nor how to fix it and have come here for suggestions.

0 Kudos
Message 1 of 4
(440 Views)
Highlighted

Im having the same issue with a KEYSIGHT DMM and NIDMM. Not much out there on this. 

 

Have you been able to solve this issue? 

 

One possible solution that i have been trying:  

-Using Either VISA or IVI but not both for our instruments. 

 

Ill update if i am able to find a solution. 

 

 

0 Kudos
Message 2 of 4
(359 Views)
Highlighted
Solution
Accepted by DanyAllard

I have solved the issue by modifying one of the IviBufwrite functions, namely the one contained within the "ivi.h" file at line 1446 by changing the ViBuf buf to a ViConstBuf. This required modifying the header files which is not ideal, however, changing it to a Const is relatively safe but I don't know if it will cause any unexpected issues going forward. Non so far.

Message 3 of 4
(327 Views)

I'm having the same problem. NI support acknowledges a bug and cites the post marked as a "solution" in this post as the "official solution NI supports."

 

For some reason I can't really explain, it seems to be going in to an #if that it shouldn't be; commenting out the contents (line 1452 in ivi.h) also seems to resolve it (which is cleaner in my opinion):

 

cstryker_0-1581693850358.png

 

The above said, I'm working with inherited code with about a billion dependencies, so I haven't ruled out external factors. At some point I intend to attempt a simpler reproducing case to see if it persists.

 

Finally, if you're using a version of VISA prior to 2017, this shouldn't be an issue:

 

Revision 5.8, October 17, 2017
Defined new const types and updated public entry points to use the correct const type for input parameters.

 

https://www.ivifoundation.org/downloads/Architecture%20Specifications/IVIspecstopost10-22-2018/vpp43...

--------------------------------------
GCentral

Christopher Stryker    2020 Americas CLA Summit Co-Chair






0 Kudos
Message 4 of 4
(40 Views)