New 'limswi' function/command found on Pelican

r3553 | dcl | 2012-05-29 10:27:54 +1000 (Tue, 29 May 2012) | 1 line
This commit is contained in:
Douglas Clowes
2012-05-29 10:27:54 +10:00
parent a9a90feaaf
commit 4887c8959a

View File

@@ -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