# keithley 2601B sourcemeter Voltage Source
namespace eval k2601bVS {} {
}

proc stdConfig::k2601bVS {} {
  controller std "\n" 5
  prop startcmd "reset() display.smua.measure.func = display.MEASURE_DCAMPS smua.source.func = smua.OUTPUT_DCVOLTS smua.source.autorangev = 1 smua.source.output = 0 print(localnode.description)"

  pollperiod 1.0 1.0

  obj k2601bVS -none
   

  kids k2601bVS {
    node Enable wr -int
    default 0
    prop label Output
    prop writecmd "smua.source.output = %d print(smua.source.output)"
    prop readcmd "print(smua.source.output)"
    prop readfmt "%d"
    prop enum off,on
    
    node Ilim wr
    default 2.0
    prop label Current_Limit
    prop writecmd "smua.source.limiti = %g  print(smua.source.limiti)"
    prop readcmd "print(smua.source.limiti)"
     prop readfmt "%g"

#    node Itrip rd
#    prop label CurrentTrip
#    prop readcmd ":SENS:AMPS:PROT:TRIP?"
#    prop readfmt "%g"
        
    node vset wr
    default  0.00
    prop label SetVoltage
    prop writecmd "smua.source.levelv = %g print(smua.source.levelv)"
    prop readcmd "print(smua.source.levelv)"
    prop readfmt "%g"

    node  Vmeas rd
    prop label Voltage
    prop readcmd "print(smua.measure.v())"
    prop readfmt "%g"
    
    node  Imeas rd
    prop label Current
    prop readcmd "print(smua.measure.i())"
    prop readfmt "%g"

    node  Rmeas rd
    prop label Resistance
    prop readcmd "print(smua.measure.r())"
    prop readfmt "%g"

    node  Pmeas rd
    prop label Power
    prop readcmd "print(smua.measure.p())"
    prop readfmt "%g"
  }
}
