#------------------------------------------------------------------------
# install a SPS-Controller
MakeSPS sps1 lnsp25.psi.ch 4000 7

#----------------- the beam command
proc beam {} {
#---------- read the SPS
   set ret [catch {SPS1 adc 3} msg]
   if {$ret != 0} {
     ClientPut $msg
     ClientPut "ERROR: SPS reading failed"
     return
   }
#--------- convert the data
  set l [split $msg "="]
  set raw [lindex $l 1]
  set val [expr $raw/13.96]
  return [format "beam = %f" $val]
}
Publish beam Spy
