i would like to take some measurements with the AD2.
OS: Xubuntu 20.04.2
It should go like this:
- Switch On MasterEnable of the PowerSupply
- Set W1 to DC -0.2V
- wait 10ms (settling time)
- take the DC voltage on CH1 and save it
- Set W1 to DC -0.1V
- wait 10 ms
...
- Switch Off MasterEnable of the PowerSupply
I tried to change the example "Scope and Wavegen" for my purposes
but it doesn't realy work.
My script:
clear()
if(!('Wavegen' in this) || !('Scope' in this)) throw "Please open a Scope and a Wavegen instrument";
But the results are
0 Average: -0.20239697277474542 V
1 Average: -0.20253002566270656 V
2 Average: -0.10329074933481859 V
3 Average: -0.0045972176319548546 V
4 Average: 0.1936384543240268 V
I used a time base of 100µs/div so a full acquisition takes 1ms.
Waiting for a second before catching the average should be enough to get a full aquisition.
Is there a command to trigger the scope by software like "Scope.Trigger.now"?
I changed the lines
for(var idx = 0; wait(1) && idx < 5; idx++){
if(!Scope.wait(1)) throw "Stopped";
The second wait() doesn't really wait for a ms. Instead it checks if you pressed
the "Stop"-button.
The third wait() seams to trigger the scope.
Is that right? Is that the way to go?
Next question:
I can't find a command to to switch the MasterEnable of the power supply on or off.
What is the command for that?
Question
Lidong
Hi folks,
i would like to take some measurements with the AD2.
OS: Xubuntu 20.04.2
It should go like this:
- Switch On MasterEnable of the PowerSupply
- Set W1 to DC -0.2V
- wait 10ms (settling time)
- take the DC voltage on CH1 and save it
- Set W1 to DC -0.1V
- wait 10 ms
...
- Switch Off MasterEnable of the PowerSupply
I tried to change the example "Scope and Wavegen" for my purposes
but it doesn't realy work.
My script:
clear()
if(!('Wavegen' in this) || !('Scope' in this)) throw "Please open a Scope and a Wavegen instrument";
Wavegen.Channel1.Mode.text = "Simple";
Wavegen.Channel1.Simple.Type.text = "DC";
Wavegen.Channel1.Simple.Offset.value = -0.2;
Scope.Trigger.Trigger.text = "Repeated";
Wavegen.run();
Scope.run();
for(var idx = 0; wait(1) && idx < 5; idx++){
if(!Scope.wait(1)) throw "Stopped";
var average = Scope.Channel2.measure("Average");
print(idx+" Average: "+average+" V");
Wavegen.Channel1.Simple.Offset.value += 0.1;
}
Wavegen.Channel1.Simple.Offset.value = 0;
The results should be:
-0.2V
-0.1V
0.0V
0.1V
0.2V
But the results are
0 Average: -0.20239697277474542 V
1 Average: -0.20253002566270656 V
2 Average: -0.10329074933481859 V
3 Average: -0.0045972176319548546 V
4 Average: 0.1936384543240268 V
I used a time base of 100µs/div so a full acquisition takes 1ms.
Waiting for a second before catching the average should be enough to get a full aquisition.
Is there a command to trigger the scope by software like "Scope.Trigger.now"?
I changed the lines
for(var idx = 0; wait(1) && idx < 5; idx++){
if(!Scope.wait(1)) throw "Stopped";
into
for(var idx = 0; wait(0.05) && idx < 5; idx++){
if(!Scope.wait(1)) throw "Stopped";
Scope.wait(0.05);
The second wait() doesn't really wait for a ms. Instead it checks if you pressed
the "Stop"-button.
The third wait() seams to trigger the scope.
Is that right? Is that the way to go?
Next question:
I can't find a command to to switch the MasterEnable of the power supply on or off.
What is the command for that?
Many thanks in advance.
Link to comment
Share on other sites
4 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