12-03-2019 08:56 PM
Hi there. I am trying write code in VB.net language and communicate with Keithley electrometer via GPIB-USB-HS with NI-VISA language.While debugging my vbproj codes, I encounterer the following message; "System.Reflection.TargetInvocationException, COM target does not implement IDispatch.". I wonder what it does mean and how to work it around.
The related statement is "DMM.IO = RM.Open("GPIB0::21::INSTR)". One could communicate with it via NI-MAX. So, I guess the problem probably stems from that I am not familiar with NI-VISA language.
Dim RM As Ivi. Visa.Interop.ResourceManager
Dim DMM As Ivi.Visa.Interop.FormattedIO488
RM = New Ivi.Visa.Interop.ResourceManager
DMM = New Ivi.Visa.Interop.FormattedIO488
DMM.IO = RM.Open("GPIB0::21::INSTR) ' Here is an error generated point!
Thanks in advance for your kind advice.
Solved! Go to Solution.
12-09-2019 12:43 PM
Have you looked at the example provided by NI ?
C:\Users\Public\Documents\National Instruments\NI-VISA\Examples\DotNET4.0\SimpleReadWrite\vb
12-09-2019 12:45 PM
have you looked at the example program
C:\Users\Public\Documents\National Instruments\NI-VISA\Examples\DotNET4.0\SimpleReadWrite\vb
12-09-2019 04:54 PM
Thanks! I tried to copy and paste the example program. While pasting it, my Visual Studio environment generated a warning (System.Reflection.TargetInvocationException). I am using Visual Studio 2019 (free-of-charge version). Should I downgrade the VS to, for example, 2011? How can I downgrade?
12-09-2019 08:14 PM
There should be installed examples for newer .NET Framework.