Code Monkey home page Code Monkey logo

rigol_ds1054z's Introduction

rigol_ds1054z

picture

Python Class for controlling the Rigol DS1054z Oscilloscope

There is no license for this work... it is use at your own risk (I assume no liability).

This python class uses visa, which means that you will need to install: pyusb, pyvisa and pyvisa-py

See this article on setting these up and testing: https://hackaday.com/2016/11/16/how-to-control-your-instruments-from-a-computer-its-easier-than-you-think/

If using linux and a raspberry pi, you will want to make the pi user a member of the usb group. This will allow you to not need to run as root.

I wanted to control my Rigol DS1054z in python to automate my scope initization and data collection. I am a hardware guy and my only formal training is a C++ class in college. My purpose in sharing the code is to help others... if you find any bugs please let me know and I will upload the fix.

The two coolest parts of the code is (1) save a screen capture to a file and (2) easily collect waveform data. You may also like how I can easily perform any measurement the scope offers, and specify units like s, ms, us and v, mv and uv.

**Note: you will need to edit rigol_ds1054z.py to specify your specific scope device. See the hackaday webpage for how to do this.

**Note: when using "write_waveform_data" the first character in the data file is invalid, it needs to be manually stripped from the file. I could not find an easy way to remove it. If you find a way, please let me know.

Files:

rigol_ds1054z.py <- this is a class which will be imported by the high-level script

test_rigol.py <- this is the high-level script that creates an instance of the class and calls functions

Here is the link to the official Rigol Programming Guide that I referenced: http://beyondmeasure.rigoltech.com/acton/attachment/1579/f-0386/1/-/-/-/-/DS1000Z_Programming%20Guide_EN.pdf

I hope this helps at least one person.

rigol_ds1054z's People

Contributors

charkster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rigol_ds1054z's Issues

I can't get this working

Hi Here,

I ca,'t get this working on my Rasperry Pi.
What is the requried version of PyVISA, ? Pyvisa-Py ? python ?

Hope you could help me !

Major refactor. Should I hard-fork?

I am doing a major refactor of this code which includes/will include

  • Bringing the code to modern python and pyvisa, starting with #2 pull request from @battlecoder
  • Reformat with Black to PEP8 (including changing from tab indent to spaces)
    -- I am protecting the table-like parts of the code so they don't rewrap.
  • Packaging it to be pip-installable as an importable module
  • Making the running commentary optional. (Probably just a verbose flag, as opposed to doing it right and using the logging system)
  • Binary transfer instead of ASCII, to support long readouts and selective readouts.

You can see the changes in my packaging branch (work in progress).

At some point, even if most of the lines of code are exactly the same, the change in structure makes it a different package, or at least hard to merge without conflict. Then the choices are:

  1. Pull-request the changes back to the main @charkster repo and call it version 2
  2. Hard fork it with a new name and copious crediting in the README

What is your preference?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.