Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Knowledge Base Home
  • Contact Us
  • Home
  • Moku:Lab
  • Software integrations
  • Python examples

Python: Waveform Generator (triggered)

Written by Paul Cracknell

Updated at December 22nd, 2020

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • 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:Lab
    Windows Moku:Lab general Moku:Lab Instruments iPad app Software integrations
  • Moku:Pro
    Moku:Pro Instruments
+ More

Example Python script to implement the Waveform Generator with trigger

#
# pymoku example: Waveform Generator Triggering
#
# This example demonstrates how you can use the Waveform Generator instrument
# to generate a gated sinewave on Channel 1, and a swept frequency squarewave
# on Channel 2.
#
# (c) 2019 Liquid Instruments Pty. Ltd.
#
from pymoku import Moku
from pymoku.instruments import WaveformGenerator

# Connect to your Moku by its device name
# Alternatively, use Moku.get_by_serial('#####') or Moku('192.168.###.###')
m = Moku.get_by_name('Moku')

try:
 # Deploy the Signal Generator to your Moku
 i = m.deploy_instrument(WaveformGenerator)

 # Generate a sinewave (amp = 1Vpp, freq = 10 Hz) on channel 1. Squarewave
 # (amp = 1 Vpp, freq = 500 Hz) on channel 2.
 i.gen_sinewave(1, amplitude=1.0, frequency=10)
 i.gen_squarewave(2, amplitude=1.0, frequency=500)

 # Configure the Moku's frontend
 i._set_frontend(channel=1, fiftyr=True, atten=True, ac=False)
 i._set_frontend(channel=2, fiftyr=True, atten=True, ac=False)

 # Configure gated trigger mode on channel 1. Sweep trigger mode on
 # channel 2.
 i.set_trigger(1, mode='gated', trigger_source='internal',
 internal_trig_period=2.0, internal_trig_high=0.5)
 i.set_trigger(2, mode='sweep', trigger_source='adc1', sweep_end_freq=10.0,
 sweep_duration=2.0, trigger_threshold=0.1)

finally:
 m.close()
moku:lab

Was this article helpful?

Yes
No

Related Articles

  • Python: Frequency Response Analyzer (basic)
  • Python: Frequency Response Analyzer (plotting)
  • Python: Phasemeter (streaming)
  • Python: Lock-in Amplifier

Sitemap

  • Moku:Lab
  • Instruments
  • Software
  • Company
  • Support
  • Store
  • Terms & Conditions
  • Privacy Policy

Offices

United States
+1 (619) 332-6230
740 Lomas Santa Fe Dr
Suite 102
Solana Beach, CA 92075

Australia
+61 2 6171 9730
243 Northbourne Avenue
Suite 2
Lyneham, ACT 2602

Follow us

Youtube LinkedIn

官方微信

Contact us
© 2021 Liquid Instruments. All rights reserved.

Definition by Author

0
0
Expand