Jump to content
  • 0

How to make a program to automatically triggering by using wavegen?


suke

Question

Hi.
I saw this article.
(https://forum.digilentinc.com/topic/4668-how-to-use-wavegen-to-trigger-scope/)

But I can't use this function by using SDK.

Can we make a program to automatically triggering by using wavegen?

Thank you so much.


 

Edited by suke
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi @attila
Thank you for replying.
I actually used this command and I didn't give you enough information about what I want to do.


What I try to do is repeatedly acquiring waves from channnel of oscilloscope by trigger using wavegen in SDK.
(Concretely, I would like to measure the response of a system by oscilloscope and the system is driven by the wavegen)

・notes
input of the system= the wavegen.
output of the system = the channel of the oscilloscope.

But I can't do it now.
I assume that trigger isn't moving correctly when I try to measure waves of oscilloscope at the moment of aplying wavegen to the system.

for example:
 

FDwfAnalogInTriggerSourceSet(hdwf, trigsrcAnalogOut1)
print("Starting repeated acquisitions")
dwf.FDwfAnalogInConfigure(hdwf, c_bool(False), c_bool(True))

for iTrigger in range(5):
# new acquisition is started automatically after done state
while True:
dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts))
if sts.value == DwfStateDone.value :
break
time.sleep(1)

dwf.FDwfAnalogInStatusData(hdwf, 0, rgdSamples1, nSamples) # get channel 1 data
dwf.FDwfAnalogInStatusData(hdwf, 1, rgdSamples2, nSamples) # get channel 2 data

 

Edited by suke
Link to comment
Share on other sites

  • 0

Hi @suke

The above approach should work but you have to process the data to look for transition in the sample array(s).

For higher precision measurement you can use the Network Analyzer feature.
First you could experiment with the WF app NA instrument then see the WF SDK/ samples/ py/ AnalogNetwork_Analyzer.py example.
To use it at fixed frequency:

...
for i in range(steps):
    while True:
        if dwf.FDwfAnalogImpedanceStatus(hdwf, byref(sts)) == 0:
...

 

Link to comment
Share on other sites

  • 0

Hi @attila
Thank you for your great help.

I tried to use NA instrument at WF.
But NA maybe only generate sine waves.
I want to use the pulse of the wavegen.

And I allow me to introduce you more details about what a want to do.

For example, I would like to trigger when the pulse of the wavegen is transitioning from 5 to 0V, and acquire response waves from the channnel of oscilloscope at the same time.

But the program which I sent you at my 2nd messsage stop at next code.
"while True:
dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts))
if sts.value == DwfStateDone.value :
break".

How can I go through this point while trigger correctly apply from wavegen?

Excuse me if I only don't understand your advice(you have to process the data to look for transition in the sample array(s)).

Regards.
 

Link to comment
Share on other sites

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...