# Monika997

Members

15

• Rank
Member
1. ## How to generate a lot of waveforms using for loop?

Unfortunately, I don't really understand how to fix it.

3. ## How to generate a lot of waveforms using for loop?

So now my code look like this: clear() if(!('Wavegen' in this) || !('Scope' in this)) throw "Please open a Scope and a Wavegen instrument"; function conf(amp, freq){ Wavegen.Channel1.Simple.Amplitude.value = amp if(freq==0){ Wavegen.Channel1.stop() }else{ Wavegen.Channel1.Simple.Frequency.value = freq Wavegen.Channel1.run() } wait(0.1) //100ms Scope.single() if(!Scope.wait()) throw "stopped" } if (Tool.question("Frequency should be constant?") == true) { frequencyconst = Tool.getInteger("Frequency constant value is", 0,
4. ## How to generate a lot of waveforms using for loop?

Thank you so much @attila I've got one more question. These values are already given in the code - var rgAmp = [0.005, 0.01] var rgFreq = [0,2,6,8,10] but in my program I enter the range and the number of steps in the popup window. I would like the two-dimensional array to be made up of these values entered in the window. if (Tool.question("Frequency should be constant?") == true) { frequencyconst = Tool.getInteger("Frequency constant value is", 0, 0, 10000) } else { frequencyfrom= Tool.getInteger("Frequency range from [Hz]", 0, 0, 100) frequencyto = Tool.getI
5. ## How to generate a lot of waveforms using for loop?

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 + " H