• 1
cephy

scripting waveforms network analyzer function

Question

Posted (edited)

I want to automate the network analyzer function in waveforms using script.  I want to run the network analyzer every 5 minutes for 10 times (with the same settings) on the same RLC circuit and save the results (frequency, gain and phase) to a file.  Is there a way to write a script to automate this? 

thanks

rob

Edited by cephy
clarification

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi @cephy

var time = new Date()

while(wait()){
    print(time.toISOString())
    
    for(var i = 0; i < 1; i++){
        Network1.single()
        Network1.wait()
        var szfile = "~/Desktop/na/"+time.getFullYear()+"_"+(time.getMonth()+1)+"_"+time.getDate()+"-"+time.getHours()+"_"+time.getMinutes()+"_"+time.getSeconds()+"-"+i+".csv"
        print(szfile)
        Network1.Export(szfile) // make sure the directory exists
    }

    time = new Date(time.valueOf()+5*60*1000) // add 5 minutes
    while(wait() && Date.now()<time.valueOf()); // wait
}

 

Share this post


Link to post
Share on other sites
  • 0

Hi Attila,

 

I am dealing with Analog Discovery 2 now. Would you like to show some scripts in python for getting the gain and phase values, and also how to save the results (frequency, gain and phase) to a file?

Thank you very much.

Best regards, Torau

 

Share this post


Link to post
Share on other sites
  • 0

Hi @Torau

Here you have a Bode plot in Python using the FDwfAnalogImpedance WF SDK functions:

AnalogNetwork_Analyzer.py

 

Edit: If you need the peak voltage values use:
    rgGaC1 = amplitude/gain1.value 
    rgGaC2 = amplitude/gain1.value/gain2.value 

 

image.png.539bb4e1f597fcef0729ec57322bdb85.png

image.png.181fae062e9bc549cc86d86056c10eb4.png

Edited by attila

Share this post


Link to post
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