element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum PyVisa shows multiple devices when only one device is connected
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 7 replies
  • Answers 1 answer
  • Subscribers 286 subscribers
  • Views 2256 views
  • Users 0 members are here
  • pivisa
  • ask_the_expert
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

PyVisa shows multiple devices when only one device is connected

AdeelHAL123
AdeelHAL123 over 1 year ago

Hi, 

I am trying to use Pyvisa to automate testing. Issue I am having is that pyvisa.ResourceManager() is displaying multiple devices when infact there is only one device.

Here are the screen shots of my code and ouput: 

image

Output: 

image

  • Sign in to reply
  • Cancel

Top Replies

  • AdeelHAL123
    AdeelHAL123 over 1 year ago in reply to ggabe +3 suggested
    Yeah I did the same. Text for copy: import pyvisa rm = pyvisa.ResourceManager() lr = rm.list_resources() Valid_device ='' for i in lr: ## print(i) try: if 'GPIB' in i: rm.open_resource(i…
  • AdeelHAL123
    AdeelHAL123 over 1 year ago in reply to AdeelHAL123 +2
    the reason I had to fix this issue is if you are working with multiple PCs or devices, everytime you had to open NI Max or other app to find out the real device thats connected to your PC. Now with this…
  • ggabe
    ggabe over 1 year ago +1
    For this reason, I wrote a helper, to inspect all ASRL devices with an IDN? command to see if they real SCPI devices or not.
Parents
  • Gough Lui
    0 Gough Lui over 1 year ago

    This is normal and it is because your VISA Layer itself has either autodetected or has been manually configured to represent serial ports (ASRL) and GPIB addresses 7 and 9 on one controller and 9 on a second as having devices available.

    Depending on your VISA Layer, you may be able to configure this behaviour, using whatever "device explorer" or configuration tools it comes with (e.g. NI MAX).

    This can also occur where a test device is connected to multiple interfaces at once.

    This is, in itself, not a problem as you should only be opening connections to specific devices of interest. It is very common to see all your serial ports listed as some older instruments had serial ports as the only alternative to GPIB and even some new instruments can be configured for USB-CDC as an alternative to USB-TMC

    - Gough

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Gough Lui
    0 Gough Lui over 1 year ago

    This is normal and it is because your VISA Layer itself has either autodetected or has been manually configured to represent serial ports (ASRL) and GPIB addresses 7 and 9 on one controller and 9 on a second as having devices available.

    Depending on your VISA Layer, you may be able to configure this behaviour, using whatever "device explorer" or configuration tools it comes with (e.g. NI MAX).

    This can also occur where a test device is connected to multiple interfaces at once.

    This is, in itself, not a problem as you should only be opening connections to specific devices of interest. It is very common to see all your serial ports listed as some older instruments had serial ports as the only alternative to GPIB and even some new instruments can be configured for USB-CDC as an alternative to USB-TMC

    - Gough

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • AdeelHAL123
    0 AdeelHAL123 over 1 year ago in reply to Gough Lui

    Is there a way to kind of reset the Resource Manager either manually or through python ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Gough Lui
    0 Gough Lui over 1 year ago in reply to AdeelHAL123

    Not that I know of. This is down to your VISA layer's behaviour.

    You'll need to use the tools corresponding to the VISA layer you're using to configure its behaviour.

    Many will autodetect devices on a continuous basis but anything that was manually configured in the VISA's connection manager will permanently stay.

    Again, I don't see this as unusual or a problem.

    - Gough

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • AdeelHAL123
    0 AdeelHAL123 over 1 year ago in reply to Gough Lui

    Thank you for your help :) 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube