The differences between beam lines at SSRL can can be easily addressed by writing specific scripts for each unique hardware architecture.
For example, beam line 9-2 and beam line 1-5 at SSRL each have their own energy script: energy_bl92.tcl and energy_bl15.tcl respectively. The database.dat file for each beamline has an energy device entry which points at the energy script for that beam line.
The entry for the energy scripted device may look like this in the database.dat file on beam line 9-2:
energy 2 self energy_bl92 14500.036128 15000.000000 5900.000000 0 0 0 0 0 0
whereas on beam line 1-5 the entry for energy may look like this:
energy 2 self energy_bl15 12999.846769 16000.000000 5900.000000 0 0 0 0 0 0
Beam line 9-2 moves the monochromator in order to change energy for the beam line. The monochromator is equipped with a encoder which allows the software to verify that the position is changing correctly. A mono_theta_corr scripted device (not shown here) was written which is responsible for moving the real mono_theta motor and verifies (using the encoder) that the motor achieved the desired position. The script for energy for beam line 9-2 shown in Figure 5 simply moves the mono_theta_corr device.
Beam line 1-5, on the other hand, requires moving a monochromator (without an encoder this time) as well as changing the voltage on a piezo. A scripted device was written to assist in controlling the voltage of the piezo according to a curve that was experimentally determined. In addition to this, the beam moves with the change in energy, and the table is adjusted slightly to accommodate this change. The resulting energy script is significantly different for beam line 1-5 as shown in Figure 6.
These scripts completely encapsulate the process of changing energy, hiding it as if the software were simply moving a motor. This greatly simplifies higher level software and allows the Blu-Ice Gui to provide a simple drop down menu for energy selection.