Python: Oscilloscope (plotting)
-
Moku:Go
Moku:Go Arbitrary Waveform Generator Moku:Go Data Logger Moku:Go Frequency Response Analyzer Moku:Go Logic Analyzer & Pattern Generator Moku:Go Oscilloscope & Voltmeter Moku:Go PID Controller Moku:Go Spectrum Analyzer Moku:Go Waveform Generator Moku:Go Power Supplies Moku:Go Digital Filter Box Moku:Go FIR Filter Builder Moku:Go Lock-in Amplifier Moku:Go General Moku:Go Logic Analyzer/Pattern Generator Moku:Go Time & Frequency Analyzer Moku:Go Laser Lock Box Moku:Go Phasemeter
-
Moku:Lab
Moku:Lab General Moku:Lab Arbitrary Waveform Generator Moku:Lab Data Logger Moku:Lab Digital Filter Box Moku:Lab FIR Filter Builder Moku:Lab Frequency Response Analyzer Moku:Lab Laser Lock Box Moku:Lab Lock-in Amplifier Moku:Lab Oscilloscope Moku:Lab Phasemeter Moku:Lab PID Controller Moku:Lab Spectrum Analyzer Moku:Lab Waveform Generator Moku:Lab Time & Frequency Analyzer Moku:Lab Logic Analyzer/Pattern Generator
-
Moku:Pro
Moku:Pro Arbitrary Waveform Generator Moku:Pro Data Logger Moku:Pro Frequency Response Analyzer Moku:Pro Oscilloscope Moku:Pro PID Controller Moku:Pro Spectrum Analyzer Moku:Pro Waveform Generator Moku:Pro Lock-in Amplifier Moku:Pro Digital Filter Box Moku:Pro FIR Filter Builder Moku:Pro Phasemeter Moku:Pro Multi-instrument Mode Moku:Pro General Moku:Pro Logic Analyzer/Pattern Generator Moku:Pro Time & Frequency Analyzer
- Python API
- MATLAB API
- Arbitrary Waveform Generator
- Data Logger
- Digital Filter Box
- FIR Filter Builder
- Frequency Response Analyzer
- Laser Lock Box
- Lock-in Amplifier
- Oscilloscope
- Phasemeter
- PID Controller
- Spectrum Analyzer
- Time & Frequency Analyzer
- Waveform Generator
- Logic Analyzer & Pattern Generator
- Multi Instrument Mode
- Moku Cloud Compile
- Moku general
- LabVIEW
Example Python script to implement the Oscilloscope (plotting)
# # Moku example: Plotting Oscilloscope # # This example demonstrates how you can configure the Oscilloscope instrument, # and view triggered time-voltage data frames in real-time. # # (c) 2023 Liquid Instruments Pty. Ltd. # import matplotlib.pyplot as plt from moku.instruments import Oscilloscope # Launch Oscilloscope and connect to your device via IP i = Oscilloscope('192.168.###.###', force_connect=True) try: # Trigger on input Channel 1, rising edge, 0V i.set_trigger(type='Edge', source='Input1', level=0) # View +-5usec, i.e. trigger in the centre i.set_timebase(-5e-6, 5e-6) # Generate an output sine wave on Channel 1, 1Vpp, 1MHz, 0V offset i.generate_waveform(1, 'Sine', amplitude=1, frequency=1e6) # Set the data source of Channel 1 to be Input 1 i.set_source(1, 'Input1') # Set the data source of Channel 2 to the generated output sinewave i.set_source(2, 'Input2') # Get initial data frame to set up plotting parameters. This can be done # once if we know that the axes aren't going to change (otherwise we'd do # this in the loop) data = i.get_data() # Set up the plotting parameters plt.ion() plt.show() plt.grid(True) plt.ylim([-1, 1]) plt.xlim([data['time'][0], data['time'][-1]]) line1, = plt.plot([]) line2, = plt.plot([]) # Configure labels for axes ax = plt.gca() # This loops continuously updates the plot with new data while True: # Get new data data = i.get_data() # Update the plot line1.set_ydata(data['ch1']) line2.set_ydata(data['ch2']) line1.set_xdata(data['time']) line2.set_xdata(data['time']) plt.pause(0.001) except Exception as e: print(f'Exception occurred: {e}') finally: # Close the connection to the Moku device # This ensures network resources and released correctly i.relinquish_ownership()