New commands added by Andrew Studer to SICS Release 2.4
r2896 | ffr | 2010-04-30 14:14:59 +1000 (Fri, 30 Apr 2010) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
e6e3c3be52
commit
c3ed712321
126
site_ansto/instrument/hipd/config/commands/hvcommands.tcl
Normal file
126
site_ansto/instrument/hipd/config/commands/hvcommands.tcl
Normal file
@@ -0,0 +1,126 @@
|
||||
|
||||
proc SingleVolt {volt oscno} {
|
||||
histmem mode unlimited
|
||||
newfile HISTOGRAM_XY
|
||||
if {$volt== 0} {
|
||||
PulserOff
|
||||
} else {
|
||||
set pulservolt [expr {($volt*1.0)/4000.0}]
|
||||
pulser send VOLT:OFFS $pulservolt
|
||||
# PulserOn
|
||||
# pulser send "APPL:DC DEF,DEF,$pulservolt"
|
||||
}
|
||||
oscmd start $oscno
|
||||
hmm countblock
|
||||
save 0
|
||||
oscmd stop
|
||||
}
|
||||
|
||||
proc SetDC {} {
|
||||
pulseroff
|
||||
pulser send FUNC DC
|
||||
pulser send VOLT:OFFS 0
|
||||
pulseron
|
||||
}
|
||||
|
||||
proc VoltRamp {start step fin oscno} {
|
||||
histmem mode unlimited
|
||||
set waszero 0
|
||||
newfile HISTOGRAM_XY
|
||||
set loopvar 1
|
||||
set i 0
|
||||
while {$loopvar} {
|
||||
set j [expr {$i*$step+$start}]
|
||||
if {$j> $fin && $step > 0} {break}
|
||||
if {$j< $fin && $step < 0} {break}
|
||||
if {$j== 0} {
|
||||
PulserOff
|
||||
set waszero 1
|
||||
} else {
|
||||
set pulservolt [expr {($j*1.0)/4000.0}]
|
||||
pulser send VOLT:OFFS $pulservolt
|
||||
if {$waszero==1} {
|
||||
PulserOn
|
||||
set waszero 0
|
||||
}
|
||||
# pulser send "APPL:DC DEF,DEF,$pulservolt"
|
||||
}
|
||||
oscmd start $oscno
|
||||
hmm countblock
|
||||
save $i
|
||||
incr i
|
||||
}
|
||||
oscmd stop
|
||||
}
|
||||
|
||||
proc SquarePulseVolt {start step fin freq oscno} {
|
||||
histmem mode unlimited
|
||||
newfile HISTOGRAM_XYT
|
||||
set loopvar 1
|
||||
set i 0
|
||||
while {$loopvar} {
|
||||
set j [expr {$i*$step+$start}]
|
||||
if {$j> $fin && $step > 0} {break}
|
||||
if {$j< $fin && $step < 0} {break}
|
||||
if {$j== 0} {
|
||||
PulserOff
|
||||
} else {
|
||||
set pulservolt [expr {($j*1.0)/4000.0}]
|
||||
PulserSquare $freq $pulservolt
|
||||
PulserOn
|
||||
# pulser send "APPL:SQU $freq,$pulservolt,0"
|
||||
}
|
||||
oscmd start $oscno
|
||||
hmm countblock
|
||||
save $i
|
||||
incr i
|
||||
}
|
||||
oscmd stop
|
||||
}
|
||||
|
||||
proc SquarePulseFreq {volt freqlist bins oscno} {
|
||||
histmem mode unlimited
|
||||
newfile HISTOGRAM_XYT
|
||||
set loopvar 1
|
||||
set i 0
|
||||
foreach freq $freqlist {
|
||||
set pulservolt [expr {($volt*1.0)/4000.0}]
|
||||
histmem_period_strobo $freq $bins
|
||||
wait 3
|
||||
PulserSquare $freq $pulservolt
|
||||
PulserOn
|
||||
# pulser send "APPL:SQU $freq,$pulservolt,0"
|
||||
oscmd start $oscno
|
||||
hmm countblock
|
||||
save $i
|
||||
incr i
|
||||
}
|
||||
oscmd stop
|
||||
}
|
||||
|
||||
proc UniPulseFreq {volt freqlist bins oscno} {
|
||||
histmem mode unlimited
|
||||
newfile HISTOGRAM_XYT
|
||||
set loopvar 1
|
||||
set i 0
|
||||
foreach freq $freqlist {
|
||||
set pulservolt [expr {($volt*1.0)/4000.0}]
|
||||
histmem_period_strobo $freq $bins
|
||||
wait 3
|
||||
PulserSquareOffs $freq $pulservolt [expr {$pulservolt/2}]
|
||||
PulserOn
|
||||
# pulser send "APPL:SQU $freq,$pulservolt,[expr {$pulservolt/2}]"
|
||||
oscmd start $oscno
|
||||
hmm countblock
|
||||
save $i
|
||||
incr i
|
||||
}
|
||||
oscmd stop
|
||||
}
|
||||
|
||||
publish SetDC user
|
||||
publish SingleVolt user
|
||||
publish VoltRamp user
|
||||
publish SquarePulseVolt user
|
||||
publish SquarePulseFreq user
|
||||
publish UniPulseFreq user
|
||||
54
site_ansto/instrument/hipd/config/commands/pulser.tcl
Normal file
54
site_ansto/instrument/hipd/config/commands/pulser.tcl
Normal file
@@ -0,0 +1,54 @@
|
||||
proc PulserOn {} {
|
||||
pulser send "OUTP ON"
|
||||
|
||||
}
|
||||
|
||||
proc PulserOff {} {
|
||||
pulser send "OUTP OFF"
|
||||
|
||||
}
|
||||
|
||||
proc PulserSin {Freq Volt} {
|
||||
pulser send FUNC SIN
|
||||
pulser send VOLT $Volt
|
||||
pulser send FREQ $Freq
|
||||
pulser send VOLT:OFFS 0
|
||||
|
||||
}
|
||||
|
||||
proc PulserSquare {Freq Volt} {
|
||||
pulser send FUNC SQU
|
||||
pulser send VOLT $Volt
|
||||
pulser send FREQ $Freq
|
||||
pulser send VOLT:OFFS 0
|
||||
|
||||
}
|
||||
|
||||
proc PulserSquareOffs {Freq Volt Offs} {
|
||||
pulser send FUNC SQU
|
||||
pulser send VOLT $Volt
|
||||
pulser send FREQ $Freq
|
||||
pulser send VOLT:OFFS $Offs
|
||||
|
||||
}
|
||||
|
||||
|
||||
proc PulserDC {Volt} {
|
||||
set resp [pulser send FUNC?]
|
||||
broadcast $resp
|
||||
if {$resp != "DC"} {
|
||||
pulser send FUNC DC
|
||||
}
|
||||
pulser send VOLT:OFFS $Volt
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
publish PulserOn user
|
||||
publish PulserOff user
|
||||
publish PulserSin user
|
||||
publish PulserSquare user
|
||||
publish PulserDC user
|
||||
publish PulserSquareOffs user
|
||||
Reference in New Issue
Block a user