The undulator control unit (GEL7510) is connected to a terminal server via a serial line. The port is specified by the environment variable name WIGGLER_PORT. The current gap size can be read by the following function call:
ONLINE = gap()
The gap size is returned in units of mm. The gap can be changed by
ONLINE gap() = new_value
Before ONLINE changes the gap, it checks whether the user is allowed to do it. That means the user name has to appear in the file /gra_library/wiggler_experts.lis. Next the program makes sure that the requested value is within three sets of limits. The hard software limits (30 mm, 250 mm) are part of the program code. The file /gra_library/gra_limits.lis contains the limits that are set by the beamline expert. In addition the user may use the functions
ONLINE gap_min() = minimum_gap_size
ONLINE gap_max() = maximum_gap_size
to declare a third set of limits. These functions can also be used to inspect the user limits:
ONLINE = gap_min()
ONLINE = gap_max()
The current position is displayed during the movement of the undulator. The user can interrupt the movement by pressing a key. The undulator is not moved, if the requested value is less than min_gap_step away from the current gap size. After a change of 1 mm the program waits for 1 second, unless the symbol gap_fast has been defined.
The user may choose to have the undulator automatically moved, if the energy is changed:
ONLINE auto_gap = 1This has no effect for energy changes in the MOVE/MC menu.