Quantcast
Channel: Measurement Studio for .NET Languages topics
Viewing all articles
Browse latest Browse all 1999

Visa Interop exception with C#

$
0
0

I'm developing a Windows console application that will talk to an Agilent DAQ via an NI IEEE-488 interface. I'm pretty sure I have the right objects in use, but when it gets to the "open" method it throws an exception. Here's a snippet of the code and the resulting error:

 

 

// attempt communications with 34980A DAQ Ivi.Visa.Interop.FormattedIO488 Data_Logger = new FormattedIO488(); //create the resource manager ResourceManager mgr = new ResourceManager(); string DAQ_Address = "GPIB0"; // Try to open the device string option_string = ""; Data_Logger.IO = (IMessage)mgr.Open(DAQ_Address, AccessMode.NO_LOCK, 2000, option_string); // This throws an exception Exception: {"Unable to cast COM object of type 'System.__ComObject' to interface type 'Ivi.Visa.Interop.IMessage'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{DB8CBF05-D6D3-11D4-AA51-00A024EE30BD}' failed due to the following error: No such interface supported (0x80004002 (E_NOINTERFACE))."}

 

 

Can anyone point me to a solution? Thanks.


Viewing all articles
Browse latest Browse all 1999

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>