62 lines
1.0 KiB
Tcl
62 lines
1.0 KiB
Tcl
# keithley 2182 nanovoltmeter
|
|
namespace eval nanov {} {
|
|
}
|
|
|
|
proc stdConfig::nanov {} {
|
|
controller std "\n" 5
|
|
prop startcmd "*IDN?"
|
|
|
|
obj Keithley2182 rd -none
|
|
prop read nanov::read
|
|
kids channels {
|
|
node u1 upd
|
|
node u2 upd
|
|
node chan out
|
|
default 0
|
|
prop write nanov::setchan
|
|
prop enum auto,chan1,chan2
|
|
}
|
|
}
|
|
|
|
proc nanov::read {} {
|
|
sct send ":FETCH?"
|
|
return nanov::update
|
|
}
|
|
|
|
proc nanov::update {} {
|
|
set mode [hvali [sct]/chan]
|
|
if {$mode == 0} {
|
|
set chan [silent 1 sct channel]
|
|
} else {
|
|
set chan $mode
|
|
}
|
|
hupdate [sct]/u$chan [sct result]
|
|
hdelprop [sct]/u$chan geterror
|
|
if {$mode != 0} {
|
|
return idle
|
|
}
|
|
set chan [expr 3-$chan]
|
|
sct send ";SENS:CHAN $chan;:SENS:CHAN?"
|
|
sct channel $chan
|
|
return stdSct::complete
|
|
}
|
|
|
|
proc nanov::setchan {} {
|
|
set mode [sct target]
|
|
if {$mode == 0} {
|
|
sct update $mode
|
|
return idle
|
|
}
|
|
set chan $mode
|
|
sct send ";SENS:CHAN $chan;:SENS:CHAN?"
|
|
sct channel $chan
|
|
return nanov::updatechan
|
|
}
|
|
|
|
proc nanov::updatechan {} {
|
|
sct update [sct result]
|
|
return idle
|
|
}
|
|
|
|
|