diff --git a/site_ansto/instrument/util/motor_utility.tcl b/site_ansto/instrument/util/motor_utility.tcl index d40f6363..815a2b0a 100644 --- a/site_ansto/instrument/util/motor_utility.tcl +++ b/site_ansto/instrument/util/motor_utility.tcl @@ -54,7 +54,15 @@ publish reldrive user proc prun {args} { if [ catch { foreach {mot pname} $args { - lappend drlist $mot [SplitReply [$mot posit2unit $pname]] + set posnames [SplitReply [$mot position_names]] + if {([llength $posnames] == 0) && [string is double $pname]} { + lappend drlist $mot $pname + } else { + if {[lsearch $posnames $pname] == -1} { + error "$pname must be one of $posnames for $mot" + } + lappend drlist $mot [SplitReply [$mot posit2unit $pname]] + } } clientput run {*}$drlist anstocapture run {*}$drlist @@ -75,7 +83,15 @@ publish prun user proc pdrive {args} { if [ catch { foreach {mot pname} $args { - lappend drlist $mot [SplitReply [$mot posit2unit $pname]] + set posnames [SplitReply [$mot position_names]] + if {([llength $posnames] == 0) && [string is double $pname]} { + lappend drlist $mot $pname + } else { + if {[lsearch $posnames $pname] == -1} { + error "$pname must be one of $posnames for $mot" + } + lappend drlist $mot [SplitReply [$mot posit2unit $pname]] + } } clientput drive {*}$drlist anstocapture drive {*}$drlist