KIS Posted December 13, 2021 Share Posted December 13, 2021 Hello I want to measure the peak time of the waveform, the time at the start, and the end time. What should I do now? The waveform has only one peak. Please see the attached file. Thank you. waveforms q.pdf Link to comment Share on other sites More sharing options...
0 attila Posted December 16, 2021 Share Posted December 16, 2021 Hi @KIS The rise/fall time measurements represent the 10-90% trip. You could use the cursors to measure the full trip or write a custom measurement. Link to comment Share on other sites More sharing options...
0 attila Posted December 16, 2021 Share Posted December 16, 2021 (edited) Hi @KIS It is easier to write and print multiple measurements in Script tool. This code is working only for one pulse. You may need to use a bit higher value than low... Channel = Scope.Channel1 Time = Scope.Time data = Channel.visibledata cnt = data.length imax1 = 0 imax2 = 0 max = -1e6 for(var i = 0; i < cnt; i++){ v = data[i] if(max==v){ imax2 = i }else if(max<v){ max = v imax1 = imax2 = i } } low = Channel.measure("Low") imax = (imax1+imax2)/2 istart = imax; while(istart>0 && data[istart]>low) istart-- iend = imax while(iend<cnt && data[iend]>low) iend++ print("low:",low, "max:",max, "istart:",istart, "imax:",imax, "iend",iend) print("max at:",Channel.TimeOfVisibleIndex(imax), "dRise:",(imax-istart)/Time.Rate.real, "dFall:",(iend-imax)/Time.Rate.real) You could split it in different measurement(s) like this: data = Channel.visibledata cnt = data.length imax1 = 0 imax2 = 0 max = -1e6 for(var i = 0; i < cnt; i++){ v = data[i] if(max==v){ imax2 = i }else if(max<v){ max = v imax1 = imax2 = i } } low = Channel.measure("Low") imax = (imax1+imax2)/2 istart = imax; while(istart>0 && data[istart]>low) istart-- iend = imax while(iend<cnt && data[iend]>low) iend++ 100.0*(imax-istart)/(iend-istart) Edited December 20, 2021 by attila Link to comment Share on other sites More sharing options...
0 KIS Posted December 20, 2021 Author Share Posted December 20, 2021 Thank you for teaching. This is very helpful. attila 1 Link to comment Share on other sites More sharing options...
0 Sakshi Verma Posted December 21, 2021 Share Posted December 21, 2021 Measurement has to be done very accurately as its values and results are responsible for major decision making activities. While writing any measurement script it is very important to understand what is the process and goal of the measurement. A particular measurement tool is a scientific instrument that is used to monitor and observe the different attribution of the object. Before start creating any measurement script it will be a great idea to understand the few basics of measurement. Link to comment Share on other sites More sharing options...
0 Holden Veronese Posted April 17, 2022 Share Posted April 17, 2022 Hey thanks for the super helpful reply. I'm not sure how I missed that thread. I haven't quite mastered the search function on here. I think I'll pass with him this time around. If i want any further guideline we will contact you here https://forum.digilent.com/topic/22499-florida-measurement-script/. Thanks Link to comment Share on other sites More sharing options...
Question
KIS
Hello
I want to measure the peak time of the waveform,
the time at the start, and the end time.
What should I do now?
The waveform has only one peak.
Please see the attached file.
Thank you.
waveforms q.pdf
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