diff --git a/site_ansto/instrument/util/motor_utility.tcl b/site_ansto/instrument/util/motor_utility.tcl index 910d7891..3436d2ef 100644 --- a/site_ansto/instrument/util/motor_utility.tcl +++ b/site_ansto/instrument/util/motor_utility.tcl @@ -177,4 +177,23 @@ proc make_coll_motor_2 { vm1 vm1_name pm1 pm2 aunits } { sicslist setatt $vm1 hdbchain $pm1,$pm2 } - +# Report limit switch status for a given list of motors +proc limswi {args} { + foreach m $args { + if { [SplitReply [sicslist $m type]] == "Motor" } { + set lims [$m send MG _LF`,_LR`] + if { [lindex $lims 0 ] == 0 } { + set FL "on " + } else { + set FL "off" + } + if { [lindex $lims 1 ] == 0 } { + set RL on + } else { + set RL off + } + } + clientput $m FL=$FL RL=$RL + } +} +publish limswi user