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 34930 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…
  • baldengineer
    baldengineer over 2 years ago in reply to zack_el

    The DP832 does not require NI's VISA. None of Rigol's tools do. Any VISA driver can connect to to the DP832.

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

    a excellent video. My goal is to program and control the Rigol DP832 DC power supply using a Raspberry Pi 5 and Python via the USB interface. This requires the NI-VISA driver. However, the driver could not be installed on the Raspberry Pi because it is not compatible with the ARM architecture. Now I am wondering how you managed to control your device via USB and LAN interfaces. Do you not need the NI-VISA driver for that?"

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

    Here is the latest code: github.com/.../baldee-plot

    And here's another pyVISA project. It uses a power supply and load to calculate / plot the efficiency of a DC-DC converter with varied load: https://github.com/baldengineer/bald-efficiency. (Video on this: DC-to-DC Converter Efficiency: How to Automate Measurements and Improve Performance - Workbench Wednesdays 72.)

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

    Download page is here:

    /challenges-projects/element14-presents/workbenchwednesdays/m/files/147059

    click the blue download button

    ( tariq.ahmad  code link looks like it needs updating )

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

    I just signed up but when I click on the Code link the page is not found.  Where can I find the Python code?

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

    This is a generic TCP/IP problem and not specific to Python or pyvisa.

    However, if the instruments support LXI or VXI11, then you can follow the instructions in "Ethernet resources" to auto-discover them.

    https://pyvisa.readthedocs.io/projects/pyvisa-py/en/latest/installation.html

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

    Hello, Thanks for the video. I have a small question regarding pyvisa programming with LAN.

    I can connect with different Siglent devices such as SDM3055 multimeter, SDL1020X-E electronic load, SPD3303X-E Power Supply, etc. I am connecting all these devices with different LAN cables and can see the IP addresses of each device individually and can work with them using pyvisa without any problem.

    My doubt is, can I get the IP addresses of all these devices automatically with Python without finding them manually? Because, I could not see the IP addresses of these devices with any of the commands such as 'arp -a', 'ifconfig', or any other way. 

    Once I connect them by manually entering the IP addresses, I can see those IP's later If I use the 'arp -a' command, etc.

    Q: is there any way to detect and connect automatically using LAN?

    Thanks and Best regards,

    Sai

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

    In general, the name from list_resources() is the name you need to use. All of the example resources names are from me copy/pasting them.

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

    One more question for you. Where are your resource names coming from that "open_resources" uses? We tried using the output of each instrument we got from the "list_resources", but kept getting errors. Some of the resource names used by "open_resources" seem to be very long. Is there something else we need to do to get/set them?

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

    Thank you so much! This is huge!

    • 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