Use the sct_pulser sctcontroller generated from the agilent_33220A.sct wrapper.

This commit is contained in:
Ferdi Franceschini
2014-07-18 15:51:37 +10:00
parent bffd3ae130
commit 0becbe914a
2 changed files with 52 additions and 52 deletions

View File

@ -16,14 +16,14 @@ proc SetVolt {volt} {
PulserOff
} else {
set pulservolt [VoltScale $volt]
pulser send "VOLT:OFFS $pulservolt; OFFS?"
sct_pulser send "VOLT:OFFS $pulservolt; OFFS?"
PulserDC $pulservolt
PulserOn
}
}
proc GetVolt {} {
pulser transact VOLT:OFFS?
sct_pulser transact VOLT:OFFS?
}
proc SingleVolt {volt oscno} {
@ -33,7 +33,7 @@ proc SingleVolt {volt oscno} {
PulserOff
} else {
set pulservolt [VoltScale $volt]
pulser send "VOLT:OFFS $pulservolt; OFFS?"
sct_pulser send "VOLT:OFFS $pulservolt; OFFS?"
pulserDC $pulservolt
PulserOn
}
@ -47,7 +47,7 @@ proc SetDC {} {
pulseroff
#NOTE: Setting FUNC DC generates a remote ctrl error if the
# burst mode happens to be on
set resp [pulser transact "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS 0; OFFS?"]
set resp [sct_pulser transact "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS 0; OFFS?"]
pulseron
}
@ -187,7 +187,7 @@ proc SquarePulseVolt {start step fin freq bins oscno} {
set pulservolt [VoltScale $j]
PulserSquare $freq $pulservolt
PulserOn
# pulser send "APPL:SQU $freq,$pulservolt,0"
# sct_pulser send "APPL:SQU $freq,$pulservolt,0"
}
oscmd start $oscno
hmm countblock
@ -208,7 +208,7 @@ proc SquarePulseFreq {volt freqlist bins oscno} {
wait 3
PulserSquare $freq $pulservolt
PulserOn
# pulser send "APPL:SQU $freq,$pulservolt,0"
# sct_pulser send "APPL:SQU $freq,$pulservolt,0"
oscmd start $oscno
hmm countblock
save $i
@ -270,7 +270,7 @@ proc UniPulseFreq {volt freqlist bins oscno} {
set pulseroffs [VoltScale [expr {$volt*0.5}]]
PulserSquareOffs $freq $pulservolt $pulseroffs
PulserOn
# pulser send "APPL:SQU $freq,$pulservolt,[expr {$pulservolt/2}]"
# sct_pulser send "APPL:SQU $freq,$pulservolt,[expr {$pulservolt/2}]"
oscmd start $oscno
hmm countblock
save $i
@ -305,13 +305,13 @@ proc UniPulseFatigue {volt freq bins oscno reps runs} {
proc PulserBurst {} {
pulser send "BURS:MODE TRIG; MODE?"
pulser send "TRIG:SOUR BUS; SOUR?"
pulser send "BURS:STAT ON; STAT?"
sct_pulser send "BURS:MODE TRIG; MODE?"
sct_pulser send "TRIG:SOUR BUS; SOUR?"
sct_pulser send "BURS:STAT ON; STAT?"
PulserOn
pulser send "*TRG;:BURS:NCYC?"
sct_pulser send "*TRG;:BURS:NCYC?"
while {1} {
set sval [pulser transact *OPC?]
set sval [sct_pulser transact *OPC?]
if {[string first 1 $sval] >-1} {break}
}
PulserOff
@ -322,11 +322,11 @@ proc PulserBurst {} {
proc VoltPulseRun {vlo vhi freq cycl} {
PulserOff
pulser send "VOLT:LOW [VoltScale $vlo]; LOW?"
pulser send "VOLT:HIGH [VoltScale $vhi]; HIGH?"
pulser send "FREQ $freq;:FREQ?"
pulser send "BURS:PHAS [expr {90.0 - ($vhi*180.0)/(($vhi-$vlo)*1.0)}]; PHAS?"
pulser send "BURS:MODE TRIG; MODE?"
sct_pulser send "VOLT:LOW [VoltScale $vlo]; LOW?"
sct_pulser send "VOLT:HIGH [VoltScale $vhi]; HIGH?"
sct_pulser send "FREQ $freq;:FREQ?"
sct_pulser send "BURS:PHAS [expr {90.0 - ($vhi*180.0)/(($vhi-$vlo)*1.0)}]; PHAS?"
sct_pulser send "BURS:MODE TRIG; MODE?"
set ploop [expr {int($cycl/50000)}]
set prem [expr {$cycl % 50000}]
if {$ploop >0} {
@ -335,45 +335,45 @@ proc VoltPulseRun {vlo vhi freq cycl} {
PulserBurst
}
}
pulser send "BURS:NCYC $prem; NCYC?"
sct_pulser send "BURS:NCYC $prem; NCYC?"
PulserBurst
PulserOff
pulser send "BURS:STAT OFF; STAT?"
sct_pulser send "BURS:STAT OFF; STAT?"
}
proc VoltPulses {vlo vhi freq cycl} {
PulserOff
pulser send "FUNC SQU;:FUNC?"
sct_pulser send "FUNC SQU;:FUNC?"
VoltPulseRun $vlo $vhi $freq $cycl
}
proc VoltTriPulses {vlo vhi freq cycl} {
PulserOff
pulser send "FUNC RAMP;:FUNC?"
pulser send "FUNC:RAMP:SYMM 50;:FUNC:RAMP:SYMM?"
sct_pulser send "FUNC RAMP;:FUNC?"
sct_pulser send "FUNC:RAMP:SYMM 50;:FUNC:RAMP:SYMM?"
VoltPulseRun $vlo $vhi $freq $cycl
}
proc OneTri {volt period} {
PulserOff
if {$volt > 0} {
pulser send "VOLT:LOW 0; LOW?"
pulser send "VOLT:HIGH [VoltScale $volt]; HIGH?"
pulser send "BURS:PHAS -90; PHAS?"
sct_pulser send "VOLT:LOW 0; LOW?"
sct_pulser send "VOLT:HIGH [VoltScale $volt]; HIGH?"
sct_pulser send "BURS:PHAS -90; PHAS?"
} else {
pulser send "VOLT:LOW [VoltScale $volt]; LOW?"
pulser send "VOLT:HIGH 0; HIGH?"
pulser send "BURS:PHAS 90; PHAS?"
sct_pulser send "VOLT:LOW [VoltScale $volt]; LOW?"
sct_pulser send "VOLT:HIGH 0; HIGH?"
sct_pulser send "BURS:PHAS 90; PHAS?"
}
pulser send "FUNC RAMP;:FUNC?"
pulser send "FUNC:RAMP:SYMM 50;:FUNC:RAMP:SYMM?"
pulser send "FREQ [expr {1.0/$period}];:FREQ?"
sct_pulser send "FUNC RAMP;:FUNC?"
sct_pulser send "FUNC:RAMP:SYMM 50;:FUNC:RAMP:SYMM?"
sct_pulser send "FREQ [expr {1.0/$period}];:FREQ?"
pulser send "BURS:MODE TRIG; MODE?"
sct_pulser send "BURS:MODE TRIG; MODE?"
pulser send "BURS:NCYC 1; NCYC?"
sct_pulser send "BURS:NCYC 1; NCYC?"
PulserBurst
PulserOff
}

View File

@ -1,10 +1,10 @@
proc PulserOn {} {
pulser send "OUTP ON;:OUTP?"
sct_pulser send "OUTP ON;:OUTP?"
}
proc PulserOff {} {
pulser send "OUTP OFF;:OUTP?"
sct_pulser send "OUTP OFF;:OUTP?"
}
@ -12,41 +12,41 @@ proc PulserTTLOn {} {
#NOTE: Setting FUNC DC generates a remote ctrl error if the
# burst mode happens to be on
# Set 5.2 Volts to get about 5.1. (5 actually gives 4.8)
pulser send "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS 5.2; OFFS?"
sct_pulser send "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS 5.2; OFFS?"
PulserOn
}
proc PulserSin {Freq Volt} {
set resp [pulser transact FUNC?]
set resp [sct_pulser transact FUNC?]
if {[string first "SIN" $resp ] == -1 } {
pulser send "FUNC SIN;:FUNC?"
sct_pulser send "FUNC SIN;:FUNC?"
}
pulser send "VOLT $Volt;:VOLT?"
pulser send "FREQ $Freq;:FREQ?"
pulser send "VOLT:OFFS 0; OFFS?"
sct_pulser send "VOLT $Volt;:VOLT?"
sct_pulser send "FREQ $Freq;:FREQ?"
sct_pulser send "VOLT:OFFS 0; OFFS?"
}
proc PulserSquare {Freq Volt} {
set resp [pulser transact FUNC?]
set resp [sct_pulser transact FUNC?]
if {[string first "SQU" $resp ] == -1 } {
pulser send "FUNC SQU;:FUNC?"
sct_pulser send "FUNC SQU;:FUNC?"
}
pulser send "VOLT $Volt;:VOLT?"
pulser send "FREQ $Freq;:FREQ?"
pulser send "VOLT:OFFS 0; OFFS?"
sct_pulser send "VOLT $Volt;:VOLT?"
sct_pulser send "FREQ $Freq;:FREQ?"
sct_pulser send "VOLT:OFFS 0; OFFS?"
}
proc PulserSquareOffs {Freq Volt Offs} {
set resp [pulser transact FUNC?]
set resp [sct_pulser transact FUNC?]
if {[string first "SQU" $resp ] == -1 } {
pulser send "FUNC SQU;:FUNC?"
sct_pulser send "FUNC SQU;:FUNC?"
}
pulser send "VOLT $Volt;:VOLT?"
pulser send "FREQ $Freq;:FREQ?"
pulser send "VOLT:OFFS $Offs; OFFS?"
sct_pulser send "VOLT $Volt;:VOLT?"
sct_pulser send "FREQ $Freq;:FREQ?"
sct_pulser send "VOLT:OFFS $Offs; OFFS?"
}
@ -54,7 +54,7 @@ proc PulserSquareOffs {Freq Volt Offs} {
proc PulserDC {Volt} {
#NOTE: Setting FUNC DC generates a remote ctrl error if the
# burst mode happens to be on
set resp [pulser transact "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS $Volt; OFFS?"]
set resp [sct_pulser transact "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS $Volt; OFFS?"]
broadcast $resp
}