Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Retreiving VISA error code in Visual Studio C#

Solved!
Go to solution

The example is the main .cs file from a simple console c# .net project.  All it does is attempt to open an invalid VISA resource, which will throw an exception.  Returning the error message string is easy, but I'd like to get the VISA error code.  See the comments in the code provided for the steps to see the VISA error.

0 Kudos
Message 1 of 2
(1,007 Views)
Solution
Accepted by topic author DAD

I have found that Keysight documentation and examples are much better for COM-Visa and .NET Visa.

See the exceptionHandler method in the attached keysight c# visa example

0 Kudos
Message 2 of 2
(976 Views)