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

View File

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