Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7987309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:06:35+00:00 2026-06-04T12:06:35+00:00

For exmaple, as follows, I can simply initialize my device by using following code

  • 0

For exmaple, as follows, I can simply initialize my device by using following code if my device is connected properly.

from visa import *
my_instrument = instrument("GPIB::14")

But what if the device is not connected to the computer? What I want to do is that before I initialize the device, firstly I want to check whether the device is connected properly? How to achieve that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:06:37+00:00Added an answer on June 4, 2026 at 12:06 pm

    You could do it two ways:

    1) Check if it is in the get_instruments_list()

    from visa import *
    my_instrument_name = "GPIB::14"
    if my_instrument_name in visa.get_instruments_list():
        print('Instrument exists connecting to it')
        my_instrument = instrument(my_instrument_name)
    else:
        print('Instrument not found, not connecting')
    

    2) Try to connect and catch the exception, you will need to wait for the timeout to occur

    from visa import *
    my_instrument_name = "GPIB::14"
    try:
        my_instrument = instrument(my_instrument_name)
        print('Instrument connected')
    except(visa.VisaIOError):
        print('Instrument not connected (timeout error)')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this plugin: http://www.jeremymartin.name/projects.php?project=kwicks And my code follows this example: http://www.jeremymartin.name/examples/kwicks.php?example=7 I'm using
I'm using Visual Studion 2010, and given the following example function obtained from WinGDI.h:
I've developed a nice rich application interface using Backbone.js where users can add objects
I've got a table structure that can be summarized as follows: pagegroup * pagegroupid
This follows on from my previous question about Moose structured types. I apologise for
I'm having a problem with the following code. I want to use one UIImageView
I have to implement a strange requirement that goes as follows: Users can hover
When using C preprocessor one can stringify macro argument like this: #define TO_STRING(x) a
I'm trying to follow the Auth example for Webapp2 that can be found here:
I would like to POST an entity as follows POST /example.org/MyEntity/100 Based on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.