Zephyrnet Logo

How to talk to your oscilloscope #Python @Hackaday

Date:

Historically, test gear used IEEE-488 (also known as GPIB or, from the originator Hewlett-Packard, HPIB). Today, a device will likely talk over a USB port, a serial port, or a LAN connection. Each vendor and even model has its unique command language. There has been a significant effort to standardize some aspects of test instrument control, and you can quickly write code to control things on any platform using many different programming languages. Al Williams on Hackaday shows just how easy it can be.

The key is to use VISA. This protocol is defined by the IVI Foundation that lets you talk to instruments regardless of how they communicate. You do have to build an address that tells the VISA library how to find your device. For example: “TCPIP::192.168.1.92::INSTR.” But once you have that, it is easy to talk to any instrument anywhere.

Since I also wanted to use this in scripts and I was freshly off the Hackaday Supercon badge, which used MicroPython, I decided to do this all in Python. My general plan of attack was simple:

  • Use VISA to connect to the scope
  • Abstract the direct SCPI commands using Python methods or properties in a class that represents the scope
  • Create a GUI to use adjacent to the web interface

See how VISA is used in the article on Hackaday here.

spot_img

Latest Intelligence

spot_img