Detect Instrument is Connected When Opening VISA Session Using VISA .NET Library

Updated May 7, 2018

Reported In

Driver

  • NI-VISA

Programming Language

  • C# .NET

Issue Details

An error is thrown  from a disconnected instrument when I perform a read, write, or query, but I would like to check for instrument connection when the VISA session is first opened.

Solution

  • Send a query (e.g. *IDN?) or write command when you first open the session. You can then trap the error indicating a missing instrument.
  • Use Find method in IResourceManager. Check your expected instrument against the list of available VISA resources.

Additional Information

See Related Links for the VISA documentation including more info about the Find method mentioned above.

WAS THIS ARTICLE HELPFUL?

Not Helpful