Boolean drives_enabled()
Return true if the telescope drive servos are enabled.
# If the drives are currently unavailable, wait for them to become available. if(!$drives_available) { print "Waiting for the telescope drives to become available" until $drives_available } # Enable the drive servos, and wait for the completion of this operation. axes all until $acquired(source) # Keep an eye out for the drives becoming disabled again, while observing. catch(!$drives_enabled) { ...observe sources... }
The return value of the $drives_enabled()
function
indicates whether or not the drives are currently enabled. This
can be used before starting a set of observations, to see whether
the drive servos need to be enabled, and thereafter, once the
drives have been enabled, it can be watched by
a catch
clause, to detect
loss of telescope control during observations.
When loss of telescope control is detected by a catch clause that
checks for $drives_enabled()
becoming false, the
schedule should abandon the current observation, wait for
the $drives_available()
function to indicate that the drive servos can be newly enabled,
then enable the drives using
the axes
command, before
returning to observing.