Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to access VisaExceptions in cases where they are not explicitly thrown?

ArgumentException thrown with VISA ErrorInterfaceNumberNotConfigured embeded.  I know this exception will be thrown on occassion and want to check for it and other possible excpetions.  I can write a regular expression to extract the VISA error code from the message but this seems a bit sloppy.  Casting the exception as a VISAException also does not work because the ArgumentException is missing details found in the VISAException class.

Regards,
Peter
0 Kudos
Message 1 of 2
(2,880 Views)
Hello Peter,

Extracting the information that you want from the VISA error cluster is a great way to achieve what you are looking for.  You can then look specifically for that the exception you are interested in or all VISA errors.

Thanks,

Meghan
Applications Engineering
0 Kudos
Message 2 of 2
(2,861 Views)