Jump to content
  • 0

Script Execution timing.


silverdiamond

Question

For example

        Scope.single();
        Wavegen.Channel1.run();
        var ptp = Scope.Filter1.measure("Peak2Peak");

How is the timing going to work?  I am arming the Scope to run single scan upon trigger, then I am generating a pulse, then I am measuring.  Are these statements simply start off each of the processes?  In other words, should I wait for Scope to complete the scan or will the measure method wait till the single scan is done?  How long should I wait before doing the measurement?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Interesting, I did this and yes, code just kicks thing off, you have to wait for scope to complete:

 

        print("Pre Armed => State: "+Scope.State.text+"  Running: "+Scope.State.running());  // Done, false
        Scope.single();  
        print("Post Armed => State: "+Scope.State.text+"  Running: "+Scope.State.running());  // Config, true
        Wavegen.Channel1.run();
        print("Post Wavegen T1 => State: "+Scope.State.text+"  Running: "+Scope.State.running());   // Config, true
        while (Scope.State.running() == true) {
           wait(0.1)
        }
        print("Post Wavegen T2 => State: "+Scope.State.text+"  Running: "+Scope.State.running());   // Done, false
        var ptp = Scope.Filter1.measure("Peak2Peak");
        print("Post measure => State: "+Scope.State.text+"  Running: "+Scope.State.running());    // Done, false

Does this makes sense?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...