Jump to content
  • 0

How to set the Impedance1.WaveGen settings via script?


Cleber Borges

Question

Hello
I'm trying to use the Impedance tool via script but I could not adjust the WaveGen parameters.
Is there any tutorial for AD2 in this part of the script?

In addition, is there any technical limitation for the amplitude to be exactly zero?
Because, for me ( voltammetric cyclic ), does it make any sense to just adjust the Offset and not have the Amplitude;
Thank you very much
Cleber Borges

Image of WaveForm Debugger below

//// script ///

// Step 01: Calculate the Impedance (Z) (fixed frequency) versus the Voltage variation (range)
// Step 02: Calculate the current (Ic)
// Step 03: Make a XY plot ( current as function of voltage )
/////////////////////////////////////////////////////////////////////
if( !('Impedance1' in this) ) throw "Please open the Impedance tool";
/////////////////////////////////////////////////////////////////////
// Configurations:
Impedance1.Frequency.value = 100
/////////////////////////////////////////////////////////////////////
var Z = []  // vector of Impedance values
var Ic = [] // vector of Current values
nScan = 100 // points numbers in scan
stepU = 10  // step (increment) in U
for( var i = 1; i < nScan; i++ ){
    U = i * stepU
    Impedance1.WaveGen.Offset.value = 0
    Impedance1.WaveGen.Amplitude.value = U
    Z = Impedance1.Traces.Ref.getData("Impedance")
    print("impedance value: "+Z );
    Ic = U / Z
    print("current value: "+Ic );
}

//////////////

error:

////////////

Error in line: 4

TypeError: Result of expression 'Impedance1.WaveGen' [undefined] is not an object.

Error in line: 10

TypeError: Result of expression 'Impedance1.WaveGen' [undefined] is not an object.

 

   

 

image.thumb.png.5ec7a7c44e796979c816f27c7d228ede.pngimage.png.d0afb9f275a9baac0526e80a04086438.png

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Hi @Cleber Borges

It should be Impedance1.Wavegen...
The uppercase G is typo in the manual. Thank you for the observation.

You can use the Ctrl+Space to list the child object/properties/functions:
image.png.d76f27134800b3ae90414e2cfb31d58d.png

The Amplitude can't be zero since the IA interface can handle only AC measurements. Zero phase measurements is not supported.
You can use Wavegen and Scope measurement for such:

image.thumb.png.206a67ecd9ecec3a4fd130459ef0ec0b.png

var ref = 1e3 // reference resistor
// take account the proble resistance
ref = 1/(1/ref+1/Impedance1.Frequency.ProbeRes.real)
// set DC voltage, offset has settling time, so it is better to use amplitude
Wavegen1.Channel1.Simple.Type.text = "Square"
Wavegen1.Channel1.Simple.Symmetry.value = 100
Wavegen1.Channel1.Simple.Amplitude.value = 1
Wavegen1.Channel1.start()
Scope1.single()
Scope1.wait()
var v1 = Scope1.Channel1.measure("Average")
var v2 = Scope1.Channel2.measure("Average")
var res = ref*(v1-v2)/v2
print(res)

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...