12.07.2015 Views

spec - Local Sector 7 web page

spec - Local Sector 7 web page

spec - Local Sector 7 web page

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Change a motor limitdef set_lm ’if ($# != 3) {print "Usage:’}{}exitset_lm motor low high"_check0 "$1"if (!set_lim($1, dial($1, $2), dial($1, $3))) {onpprintf("\n%s limits set to %g %g (dial units).\n",\motor_name($1), get_lim($1, -1), get_lim($1, +1))offp}The macros in the above list that begin with a u continuously read motor positionsfrom the controller and show the positions on the screen. The frequency of screenupdates is set by the global variable UPDATE ,which is used as an argument to thesleep() function. Setting UPDATE=.25 places a 1/4 second pause between updates.The umv macro first calls _mv and then calls the internal _update1 macro. The otherupdated-move macros are defined similarly.def umv _’mv $*; _update1 $1 ’# "update" version of mv# Displays updated position of 1 motor while it is movingdef _update1 ’if (chk_move)) {printf("\n%10.9s\n", motor_name($1))while (wait(0x22)) {getanglesprintf("%10.4f\r", A[$1])sleep(UPDATE)}getanglesprintf("%10.4f\n", A[$1])}’The technique for displaying status information about all the motors is a little complicated.<strong>spec</strong> places no restriction on what order the motors are assigned to the controller,but does recognize that there is a preferred order for displaying motor information.To this end, the macros use an array mA[] which contains reordered motornumbers. The four-circle macro source file contains the following code, which is executedwhen the command file is read and when the config macro is run.INTERIM WORK-IN-PROGRESS (8/16/01) NOT FOR GENERAL DISTRIBUTION STANDARD MACRO GUIDE 137

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!