An important aspect of writing scripts that interact with hardware is being
able to guarantee that a hardware related function has completed before
issuing the next command. The wait_for_devices
command
allows the script writer to halt the script at the appropriate time and
wait for a hardware component to complete its current task. This command
does not freeze the BLU-ICE GUI or the scripting engine while the script
is waiting for the event that will trigger the wait_for_devices
command
to return.
The DCS command in its general form is:
wait_for_devices deviceName1 [deviceName2 [deviceName3 [...]]]
Each deviceName argument may be the name of a motor or ion chamber. The list of devices may be in any order.
An additional command is provided to wait for shutters/filters to be inserted and removed:
wait_for_shutters shutterName1 [shutterName2 [shutterName3 [...]]]
It should be understood that the wait_for_shutters
command waits
for the DHS responsible for the shutter to say that the shutter is open
or closed. However, because there is often no shutter state feedback to
a motion controller, the shutter may still be in the
mechanical process of opening or closing.
At some point the functionality of wait_for_shutters
should be added
to the wait_for_devices
command, and the
wait_for_shutters
command should be phased out.
Examples:
move gonio_phi by 30 deg wait_for_devices gonio_phi
#start two motors moving move energy to 11000.00 eV move table_vert to 22.3 mm #wait for both motors to stop moving wait_for_devices energy table_vert #Both motors have stopped moving now.
open_shutter shutter open_shutter Al_1 wait_for_shutters shutter Al_1