#! /bin/sh # # This script moves the motor to the requested position. # # \ exec mxtclsh_script "$0" ${1+"$@"} proc main { record_list argv } { if { [ llength $argv ] != 2 } { puts stderr "" puts stderr "Usage: mt_get_position motorname new_position" puts stderr "" exit } set motor_name [ lindex $argv 0 ] set new_position [ lindex $argv 1 ] set motor [ $record_list get_record $motor_name ] set units [ $motor get_field "units" ] puts "Moving motor '$motor_name' to $new_position $units" $motor move_absolute $new_position # Wait for the move to complete. while {1} { set position [ $motor get_position ] puts " $position" if { [ $motor is_busy ] == 0 } { break } after 1000 } puts "Motor move complete." }