namespace eval tdklambda {} {
}

proc stdConfig::tdklambda {{adr 6}} {
  controller std "\r" 5
  prop startcmd "ADR $adr"

  obj TDK-LAMBDA wr
  prop readcmd "PC?"
  prop write tdklambda::write

  kids "TDK lambda" {
    node curr_meas rd
    prop readcmd "MC?"

    node volt_set wr
    prop readcmd "PV?"
    prop writecmd "PV %.2f"

    node volt_meas rd
    prop readcmd "MV?"

  }
}


proc tdklambda::write {{switch 1}} {
  if {$switch} {
    if {[sct target] != 0} {
      sct send "OUT 1"
    } else {
      sct send "OUT 0"
    }
    return "tdklambda::write 0"
  }
  sct send "PC [format %.4f [sct target]]"
  return stdSct::completeUpdate
}

