I am new to the Analog Discovery and WaveForm software, so this might be a "silly" question. I did try to run some scripts in WaveForm3,0 (The latest version). Right now, I am just running the example code coming with the tool. It is shown in the following, it gave errors, like Can't find variable: Wavegen1, etc. I believe I have to add a library which includes all the definitions of this variables, but I didn't find them. Can anyone help with me and show me how to get codes like this to run successfully? Thanks so much!
function main(){
if(!('Wavegen1' in this) || !('Scope1' in this)) {
throw("Please open a Scope and a Wavegen instrument");
Question
Charlie
Hello,
I am new to the Analog Discovery and WaveForm software, so this might be a "silly" question. I did try to run some scripts in WaveForm3,0 (The latest version). Right now, I am just running the example code coming with the tool. It is shown in the following, it gave errors, like Can't find variable: Wavegen1, etc. I believe I have to add a library which includes all the definitions of this variables, but I didn't find them. Can anyone help with me and show me how to get codes like this to run successfully? Thanks so much!
function main(){
if(!('Wavegen1' in this) || !('Scope1' in this)) {
throw("Please open a Scope and a Wavegen instrument");
}
Wavegen1.run();
for(var idx = 0; wait(1) && idx < 10; idx++){
Scope1.single();
if(!Scope1.wait()){
return;
}
var average = 0;
var data = Scope1.Channel1.data;
data.forEach(function(sample){average += sample;})
average /= data.length;
print(idx+" Average: "+average+" V");
}
}
main();
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.