#! /usr/bin/env mpscript # # This script reports the position of the requested motor. # def main( record_list, argv ): if ( len(argv) != 1 ): print( "" ) print( "Usage: mp_get_position motorname" ) print( "" ) sys.exit(1); motor_name = argv[0] motor = record_list.get_record( motor_name ) position = motor.get_position() units = motor.get_field("units") print( "Motor '%s' position = %g %s" % (motor_name, position, units) )