element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
  • 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 | Trouble I identifying Resources | Rigol DS1054 | Keithly 2200-20-5
  • 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
  • Replies 23 replies
  • Subscribers 287 subscribers
  • Views 5693 views
  • Users 0 members are here
  • ask_an_expert
  • USBTMC
  • automation
  • pyvisa
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 | Trouble I identifying Resources | Rigol DS1054 | Keithly 2200-20-5

dustin1986
dustin1986 over 2 years ago

Hi I am new to automating lab equipment. I am playing around with an oscope and psu to learn. I am using the usb connections. I am using Manjaro linux. I have the usbtmc driver installed and working. My linux box does see the instruments when I plug them in. However, pyvisa doesnot seem to find them. I just get a long list of ASRL "devices" no way to identify which one is the hardware I attached.  

image

Does pyvisa not see the hardware or is thee another way to find devices?

  • Sign in to reply
  • Cancel

Top Replies

  • charlieo21
    charlieo21 over 2 years ago +2
    You can try this. i = 1 for key, value in rm.list_resources_info().items(): print('\nInstrument ', str(i), ': ', key) print(' Interface type: ', value.interface_type) print(' Interface board number…
  • baldengineer
    baldengineer over 2 years ago +1
    You need to create a udev rule for USBTMC devices. echo 'SUBSYSTEM=="usb", MODE="0666", GROUP="usbusers"' >> 99-com.rules sudo mv 99-com.rules /etc/udev/rules.d/99-com.rules Make sure you're in "usbusers…
  • baldengineer
    baldengineer over 2 years ago in reply to baldengineer +1
    Also also, "python-usbtmc" (via pip) can give you some troubleshooting information.
  • baldengineer
    baldengineer over 2 years ago

    You need to create a udev rule for USBTMC devices.

    echo 'SUBSYSTEM=="usb", MODE="0666", GROUP="usbusers"' >> 99-com.rules sudo mv 99-com.rules /etc/udev/rules.d/99-com.rules

    Make sure you're in "usbusers" and do a reboot after that. (And really, reboot. I'm not certain what service has to restart to make it work.) pyVISA may be able to see them then.

    Also, the license for R&S's VISA driver is not very restrictive. My interpretation is that you can use it with anyone's hardware/software. I also know they use pyVISA quite a bit, so it works really well with pyVISA. There are builds for various linux versions on their site.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • dustin1986
    dustin1986 over 2 years ago in reply to shabaz

    No this just my desktop in my office. There is no other lab equipment attached. In fact right now the only thing that is attached is the Rigol Oscope.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • baldengineer
    baldengineer over 2 years ago in reply to baldengineer

    Also also, "python-usbtmc" (via pip) can give you some troubleshooting information.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 2 years ago in reply to dustin1986

    I see.. In that case, your PC cannot see the instrument at all, since there's no instrument name beginning with USB in your screenshot. It's likely a Linux issue, as @baldengineer describes.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dustin1986
    dustin1986 over 2 years ago in reply to baldengineer

    Do I need to create the 99-com.rules file. My system had 99-nivisia_usbraw.rules file in the udev directory? Similar but not the same I can try both out until you reply.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • baldengineer
    baldengineer over 2 years ago in reply to dustin1986

    I cannot say for sure. The udev rule may only apply when you're using the pyvisa-py VISA driver.

    I do not own any NI software or hardware, so I am not able to use NI-VISA (it's against their license to use it unless it is with their tools, even though it is "free.")

    I don't have it installed on any of the machines I've used with pyvisa. I either use pyvisa-py, R&S VISA, or Keysight's IO Connect. (But I have only used IO Connect on Windows, not Linux.)

    If you have a VISA driver installed, such as NI-VISA, I would use their connection tools to verify what is connected and troubleshoot it. pyvsia's ResouceManager talks to it. For example, if NI-VISA's connection tool does not see the USB instruments, then pyvisa's ResourceManager won't either.

    Remember, pyvisa talks to a VISA driver. If you don't have one installed, then it can use its own "pyvisa-py" driver.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • dustin1986
    dustin1986 over 2 years ago in reply to baldengineer

    Yeah I went down the NI-VISA path because that is where the Keithely ( Tecktonix) site took me.  I can try to uninstall it and use pyvisapy as the backend.  To be clear that pyvisa acts like visa drive giving me the usbtmc backend then I use pyvisa for scripiting?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dustin1986
    dustin1986 over 2 years ago in reply to shabaz

    Yes so it would seem. I am using the NI-VISA driver so I guess I am going try switching to pyvisapy. All this is little confusing, I must admit.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dustin1986
    dustin1986 over 2 years ago in reply to dustin1986

    baldengineer 

    Ok so switching to the pyvisapy backend seemed to do the trick. It now shot the usb address as detailed in the manual. Many thanks to everyone in the thread for help. See output belowl.

    Python 3.10.10 (main, Mar  5 2023, 22:26:53) [GCC 12.2.1 20230201] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import visa
    /usr/lib/python3.10/site-packages/visa.py:13: FutureWarning: The visa module provided by PyVISA is being deprecated. You can replace `import visa` by `import pyvisa as visa` to achieve the same effect.
    
    The reason for the deprecation is the possible conflict with the visa package provided by the https://github.com/visa-sdk/visa-python which can result in hard to debug situations.
      warnings.warn(
    >>> import pyvisa as visa
    >>> rm =visa.ResourceManager('@py')
    >>> rm.list_resources()
    ('USB0::1510::8704::9201747::0::INSTR',)
    >>> 
    
    

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • colporteur
    colporteur over 2 years ago in reply to dustin1986

    I would still caution you on hosting devices on a computer connected to a corporate network. I have investigated cases of AC units upload 5G of data to a foreign site because someone thought it would be a good idea to automate making data available internally. Once the device is compromised internally and externally become the same place.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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