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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

diffractometer. For example, they may be set to zero at the direct beam. The relationsbetween the two positions are:dial = hardware_register / steps_per_unituser = sign × dial + offsetThe hardware_register contains the value maintained by the stepper motor controller.The value of steps_per_unit is assigned in the hardware configuration file, asis sign. The latter must be chosen to agree with the conventions of the built-in geometrycalculations.The motor positions are often placed in the A[] array. The array is built-in and itselements can be used like any other variables. What makes it <strong>spec</strong>ial, however, arethe commands that use the array to convey the positions of the diffractometermotors. For example, the command getangles sets all of the elements of the A[]array to the current motor positions in user angles, while the move_all commandsends the motors to the positions contained in A[] (in user angles). Typical usage is,50.FOURC> waitmove# Make sure no motors are active.51.FOURC> getangles# load A[] with user angles.52.FOURC> A[0] = 3 # move motor #0 to 3.53.FOURC> move_all# start the move.54.FOURC>(The # symbols introduce comments.) It is important to first wait for any previousmotions to complete. Then getangles is used to load the angle array with the currentpositions. Only the values for the motors to be moved are reassigned beforeusing move_all to set the motors in motion.Amacro that would list the user positions of all the configured motors might be:54.FOURC> def wa ’55.quot> getangles56.quot> for (i = 0; i < MOTORS; i++)57.quot>printf("%9.9s = %g\n", motor_name(i), A[i])58.quot> ’59.FOURC> waTwo Theta = 3Theta = 1.5Chi = 0Phi = 060.FOURC>INTERIM WORK-IN-PROGRESS (8/16/01) NOT FOR GENERAL DISTRIBUTION USER MANUAL AND TUTORIALS 29

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

Saved successfully!

Ooh no, something went wrong!