Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Updated USB Visa Drivers to Legacy 488.2 Code - 'unable to cast...'

Solved!
Go to solution

Hello Community,

I currently have a 'working' program which uses the NI 488.2 API in Visual Studio 2019. The program works great. Our GPIB VNA recently broke down and we purchase a more modern version network analyzer. This unit is controlled via USB (as opposed to our legacy using GPIB).

 

I'm trying to convert / add code (in VB.NET) to control but GPIB and USB devices using Keysight's VISA drivers. I've been able to get either the GPIB or USB versions to work but not merged. I also received this error which I was hoping someone could give me some insight on.

 

'Unable to case object of type 'NationalInstruments.NI4882.Device' to type 'Ivi.Visa.Interop.FormattedIO488'.

high-Q_0-1609894807725.png

 

Thanks for any help.

0 Kudos
Message 1 of 2
(1,628 Views)
Solution
Accepted by topic author high-Q

Found the problem.

I was mixing up VNA.Writestring with GPIBDevice.Write and vise versa.

0 Kudos
Message 2 of 2
(1,613 Views)