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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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
WorkBench Wednesdays
  • Challenges & Projects
  • element14 presents
  • WorkBench Wednesdays
  • More
  • Cancel
WorkBench Wednesdays
Documents How to Program Test Tools with Python - Workbench Wednesdays 66
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join WorkBench Wednesdays to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 28 Dec 2022 7:30 PM Date Created
  • Last Updated Last Updated: 14 Jun 2024 5:21 PM
  • Views 34868 views
  • Likes 5 likes
  • Comments 57 comments
Related
Recommended

How to Program Test Tools with Python - Workbench Wednesdays 66

If your test tools have a USB or LAN port, there is a good chance that they support SCPI. Using pyVISA, you can write automated test programs for most equipment without expensive software. This video explains terms like VISA, SCPI, and USBTMC. Then it shows how to use Python and pyVISA to connect to test equipment with a Raspberry Pi (or any Linux computer.)

Watch the Video:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Bonus Content:

  • PyVISA
  • RsInstrument, R&S Python Implementation (also uses pyvisa!)
  • Keysight IO Suite
  • R&S VISA
  • Standard Commands for Programmable Instruments (SCPI) Syntax. (web archive mirror IVI Foundation)
  • SCPI Specification
  • Blog post, Early peak at bode plot script
  • Snapshot of Code
  • Github link for code

Bill of Material:

Product Name Manufacturer Quantity Buy Kit
34465A Bench Multimeter, Truevolt, 6.5 digit Keysight 1 Buy Now
TL081 - JFET General Purpose, 4 MHz SOIC-8 ST Microelectronics 1 Buy Now
Bench Oscilloscope - 200 MHz, 1 GSa/s, 14-bit, AFG, DMM Multicomp Pro 1 Buy Now
MXO4 - 4 Channel Oscilloscope 200 MHz Rohde & Schwarz 1 Buy Now
HMC8043 Bench Power Supply, Programmable, 3 Output, 0 V, 32 V, 3 A Rohde & Schwarz 1 Buy Now
RPI400-KIT-US Raspberry Pi 400 Kit, BCM2711, Quad-Core, 64bit, ARM, Cortex-A72, US PSU, US Keyboard Layout Raspberry Pi 1 Buy Now
 

element14 presents

element14 Presents  |  About James |  Workbench Wednesdays

  • Remote Programming
  • VXI
  • gpib
  • USBTMC
  • visa
  • lxi
  • IVI
  • scpi
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • baldengineer
    baldengineer over 2 years ago in reply to zack_el +3
    For some reason, posting these instructions here causes errors. You need to create a udev rule. Here's how to do it: www.baldengineer.com/accessing-usb-instruments-with-pyvisa-on-linux.html
  • mayermakes
    mayermakes over 3 years ago +1
    ohoh..I sense some automation i have to implement....
  • mayermakes
    mayermakes over 3 years ago in reply to baldengineer +1
    if anyone has a gripe with using a pi, I can warmly recommend doing it with a Beaglebone black. this also gave me the idea of maybe developing some sort of plug and play box with a pocketbeagle that reads…
  • zack_el
    zack_el over 2 years ago in reply to baldengineer

    Dear Mr. James, I would like to express my sincere gratitude for your support. Thanks to your help, it is now working. I greatly appreciate your patience and expertise. image

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

    For some reason, posting these instructions here causes errors. You need to create a udev rule. Here's how to do it:

    www.baldengineer.com/accessing-usb-instruments-with-pyvisa-on-linux.html

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to Ayoub_Ghaoui

    One action you could take, is to wrap the check for IDN in an exception handler, and ignore instruments that don't reply.

    If an IDN is returned, you know you're talking to an existing, and connected, test instrument.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to Ayoub_Ghaoui

    Both. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Ayoub_Ghaoui
    Ayoub_Ghaoui over 2 years ago in reply to Jan Cumps

    Do you use Windows or Linux operating system?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to zack_el

    ASRL/dev...   , I believe, is not a real device. It's one of the entries generated by NI-VISA software.

    They pop up in my system too, although no device is connected.

    image

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

    image

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

    Well, the good news is that Linux is enumerating the device. But for some reason, pyvisa-py cannot see it.

    My new guess is that it is a permissions issue.

    Outside of VScode (or whatever the IDE is), run the python script as root to see if ResourceManager shows it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Ayoub_Ghaoui
    Ayoub_Ghaoui over 2 years ago in reply to zack_el

    I have the same problem!!!!

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

    image

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