suke Posted December 12, 2021 Share Posted December 12, 2021 (edited) 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 December 14, 2021 by suke Link to comment Share on other sites More sharing options...
0 attila Posted December 13, 2021 Share Posted December 13, 2021 Hi @suke Use: FDwfAnalogInTriggerSourceSet(hdwf, trigsrcAnalogOut1) suke 1 Link to comment Share on other sites More sharing options...
0 suke Posted December 14, 2021 Author Share Posted December 14, 2021 (edited) 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 December 15, 2021 by suke Link to comment Share on other sites More sharing options...
0 attila Posted December 15, 2021 Share Posted December 15, 2021 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 More sharing options...
0 suke Posted December 16, 2021 Author Share Posted December 16, 2021 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 More sharing options...
0 attila Posted December 16, 2021 Share Posted December 16, 2021 Hi @suke The trigsrcAnalogOut outputs high while the instrument is running. The AnalogIn will trigger on rising edge (falling, either if configured), so the AnalogIn should be started before AnalogOut, or wait-run-repeat configured for AnalogOut. suke 1 Link to comment Share on other sites More sharing options...
Question
suke
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.
Link to comment
Share on other sites
5 answers 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 accountSign in
Already have an account? Sign in here.
Sign In Now