12-08-2016 05:59 PM
I recently upgraded the NI488.2 driver from version 3.0.2 to 16.0. Now when compiling my program for x64, I receive the following exception when trying to construct a NationalInstruments.NI4882.Device object:
System.TypeInitializationException "The type initializer for 'NationalInstruments.NI4882.Internal.GpibDll' threw an exception."
with an inner exception of:
System.OverflowException "Arithmetic operation resulted in an overflow."
This problem only happens when I compile for x64, not for 32-bit. I don't find any x64 specific dll's in the NI installation directory.
12-09-2016 09:42 AM
Hello,
First thing I would like to know is which version of Measurement Studio are you using? Which version of Visual Studio are you using with that? What OS are you using as well?
I would like to know is if this exception still occurs with prebuilt example code. I would recommend the example located in C:\Users\Public\Documents\National Instruments\NI-488.2\Examples\DotNET4.5\SimpleReadWrite\cs. If you build that for both x64 and x32, do you see similar errors? If you do, then there may be issues with your driver installation, in which reinstalling might be the best solution.
If you do not see any errors with the example code, then there may be some issues within your code itself. Would you then be able to post a small reproducing snippet of code that we could look into?
Best,
Shamik C
Applications Engineer
National Instruments