The bottom left corner indicates that channel 1 has been configured for 125 mV/division. In the top left, beside the Rigol logo, the image shows the scope is in stop mode and that the horizontal (“H”) axis has 50 ms/division. For example, the top right shows the trigger configured for a rising edge with a threshold value of 100 mV. The screen capture confirms the configuration parameters. bmap_scope = scope.display_dataĭisplay(Image(bmap_scope)) Screen image returned by the oscilloscope
#Jupyter python download code
For example, the image below the code shows what my oscilloscope returned. Specifically, the image provides a reference to check the values returned by some of the lines below. The display_data command returns a bitmap showing the signal and oscilloscope configuration. Next, I take a screenshot of the data from the scope. This ensures the buffer contents do not change as I pull configuration information. With the signals captured, I place the oscilloscope in STOP mode.
#Jupyter python download download
Scope.write(':trigger:edge:level ' + format(d_trigger_level)) Download the Rigol screen bitmap Scope.write(':trigger:edge:source CHAN1') The write function sends the VISA commands. I switched to VISA commands instead of using the DS1054Z functions. For this reason, I put the trigger level at 100 mV, about half of the peak. The magnetic pickup signal rises to approximately 200 mV. Setting the trigger fixes the signal with respect to the grid. I want to set the trigger to capture a similar waveform each time I read data from the oscilloscope. Scope.timebase_scale = 0.050 Configure the trigger These commands use the DS1054Z library, but VISA commands could also be used. I will also set the probe ratio to unity and the vertical scale to 125 mV/division. For this reason, I will set the horizontal time scaling to 50 ms/division. I would like to see about 5-6 revolutions on the screen.
The pickup views a shaft rotating about 600 RPM. Check out my blog post on selecting magnetic pickups for details on which magnetic pickup I used and how I wired it. I have channel 1 connected to a magnetic pickup. n() Download a waveform (source screen) Configure the oscilloscope With the connection established, place the oscilloscope in RUN mode to collect some data. For example, my oscilloscope responded with the text string shown below.
#Jupyter python download serial
The scope should respond with the make, model, and serial number. Next, I need to connect to the oscilloscope to verify it responds to basic commands. from scipy.fft import rfft, rfftfreq Connect to oscilloscope These libraries enable single-sided spectral analysis. from IPython.display import Image, displayįinally, include the libraries from the SciPy package. Specifically, this project uses the Image and display functions. The IPython package provides libraries needed to display the oscilloscope bitmap images. from ds1054z import DS1054Zįrom matplotlib.ticker import FormatStrFormatter Lastly, the code brings in the NumPy package to support vector operations. First, the code imports the DS1054Z library-next, the code imports two libraries from the Matplotlib package. We begin by importing libraries to connect to the oscilloscope and display the data. Import the sys library and print the version information. I want to document the Python version used in this example. Setup the notebook and import the libraries Of course, the programming manual itself also proved useful. Ken Shirrif’s blog includes spectrographic analysis and how-to export to. I want to mention some sites I found helpful in learning about this. This library is required to replicate these examples in your environment. This tutorial uses the DS1054Z library written by Philipp Klaus. This post will take you through the steps to control and download data from your Rigol DS1054Z oscilloscope over ethernet using Python in a Jupyter notebook.