Jump to content
  • 0

Triggering with Analog Discovery 2


daanwielens

Question

Hi,

I wrote a piece of code based on the python wrapper of the WaveForms SDK (https://github.com/Digilent/WaveForms-SDK-Getting-Started-PY) to control the Analog Discovery 2 (btw, I opened an issue there because of the dwfconstants file).

I reshuffled the commands into something that fits within our modular measurement framework code (source file for the AD2 https://github.com/ICE-QTM/QTMtoolbox/blob/master/instruments/DigiAD2.py).

My first test was to generate a waveform on channel 1, trigger and read it with the scope. I wrote the following code snippet:

# Load module
from instruments.DigiAD2 import *

# Bind to instrument
a = DigiAD2(1)

# Open scope first
a.open_scope(20e6, 10e3)

# Set up trigger
a.trigger(True, 'analog', 0, 3, edge_rising=False, level=0.25)

# Write waveform
a.set_wav1(constants.funcTriangle, offset=0, frequency=3e3, amplitude=1)

# Measure 10 times and plot
a.trigger(True, 'analog', 0, 3, edge_rising=False, level=0.25)
plt.figure()
for i in range(10):
    t, y = a.get_wav1()
    plt.plot(t, y)

What I would expect to see is 10 traces that perfectly (up to drift, etc.) overlap. What I get is attached in the file: it seems that the code triggers on both positive and negative edges. However, following the example code in the SDK, the system should only trigger on positive edges. 

What is happening and how can I solve this?

 

Thanks, Daan

 

DigiAD2.png

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...