clear()if(!('Wavegen' in this)||!('Scope' in this))throw"Please open a Scope and a Wavegen instrument";if(Tool.question("Frequency should be constant?")==true){
frequencyconst =Tool.getInteger("Frequency constant value is",0,0,10000)
print("Frequnecy is constant and the value is "+ frequencyconst )}else{
frequencyfrom=Tool.getInteger("Frequency range from [Hz]",0,0,100)
frequencyto =Tool.getInteger("Frequency range to [Hz]",0,0,100)
frequencystep=Tool.getInteger("Frequency number of steps",0,0,100)
print("Frequnecy range is from: "+ frequencyfrom +" Hz to "+ frequencyto +" Hz and the step is "+ frequencystep)}if(Tool.question("Generator voltage should be constant?")==true){
voltageconst =Tool.getInteger("Generator voltage constant value is",0,0,10000)
print("Generator voltage is constant and the value is "+ voltageconst )}else{
voltagefrom=Tool.getInteger("Generator voltage range from [mV]",0,0,100)
voltageto =Tool.getInteger("Generator voltage range to [mV]",0,0,100)
voltagestep=Tool.getInteger("Generator voltage number of steps",0,0,100)
print("Generator voltage range is from: "+ voltagefrom +" mV to "+ voltageto +" mV and the step is "+ voltagestep)}Wavegen.Channel1.Mode.text ="Simple";Wavegen.Channel1.Simple.Frequency.value = frequencyconst;Wavegen.Channel1.Simple.Amplitude.value = voltageconst;Wavegen.run();Scope.run();
Hello! This is my code to generate sinusoidal waveform. But it works only for constant frequency and voltage.
I need help with for loop or something to generate this waveform but for example after choosing:
Frequnecy range is from: 0 Hz to 10 Hz and the step is 5
Generator voltage range is from: 5 mV to 10 mV and the step is 2
0,2,6,8,10 Hz with 5 mV and 0,2,6,8,10 Hz with 10 mV. So i want to generate 10 waveforms with an interval of for example 5 sec.
Question
Monika997 0
Hello! This is my code to generate sinusoidal waveform. But it works only for constant frequency and voltage.
I need help with for loop or something to generate this waveform but for example after choosing:
Frequnecy range is from: 0 Hz to 10 Hz and the step is 5
Generator voltage range is from: 5 mV to 10 mV and the step is 2
0,2,6,8,10 Hz with 5 mV and 0,2,6,8,10 Hz with 10 mV. So i want to generate 10 waveforms with an interval of for example 5 sec.
Link to post
Share on other sites
7 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