Download X-Ray Diffraction Software USER MANUAL and TUTORIALS
Transcript
def _check0 ’{
local _i
for (_i = 0; _i <= MOTORS; _i++)
if (_i == MOTORS) {
print "Invalid motor name: $1"
exit
} else if ($1 == _i) {
if ("$1" != motor_mne(_i) && "$1" != _i) {
print "Invalid motor name: $1"
exit
} else
break
}
’
Next in ascan , the global variables used in the scan are initialized from the arguments.
{ _m1 = $1; _s1 = $2; _f1 = $3; _n1 = int($4); _ctime = $5 }
The global variables being assigned are shared by all the scans.
Next in ascan , a check is made to ensure the number of intervals is positive.
if (_n1 <= 0) {
print "Intervals <= 0"
exit
}
The next four lines do a motor limit check before the start of the scan.
_bad_lim = 0
_chk_lim _m1 _s1
_chk_lim _m1 _f1
if (_bad_lim) exit
The _chk_lim macro sets the flag _bad_lim if the position given by the second argument is outside the limits of the motor given by the first argument.
def _chk_lim ’{
local
_u _t
if ((_u = dial($1, $2)) < (_t = get_lim($1, -1))) {
printf("%s will hit low limit at %g.\n",motor_name($1),_t)
_bad_lim++
} else if (_u > (_t = get_lim($1, 1))) {
printf("%s will hit high limit at %g.\n",motor_name($1),_t)
_bad_lim++
}
}’
The prescan limit check is straightforward for simple motor scans. For reciprocal
156
STANDARD MACRO GUIDE