Running an experiment
Kirrily Rule
2013-04-09 16:47
Creating and running batch files
Batch files are stored in /usr/local/nbi/sics/taipan/batch and are just text files
with the extension .tcl. You can edit these in a text editor, or the editing panel
of the left window. Your file, filename.tcl can be run by dragging and dropping into
the Buffer Queue and then run by pressing the “Play” button.
You can also queue additional files to run by dragging and dropping them into
Batch Queue window. These will then be run sequentially. Files can be removed and
edited or replaced as desired from the Batch Queue window. Once the file has been
read into the buffer, it can no longer be edited. For this reason it is recommended
that multiple short files are created. These can be run multiple times if necessary.
Synchronising validation server with control server
There are actual 2 version of the SICS control server running, the one that does the
control, and one that you use to validate scripts, known as the validation server. The
validation server doesn't control real hardware. The hardware is virtual. Motors move
instantaneously. It is used to check that a batch file that you have written doesn't
violate the limits of motion, and to check that you haven't made syntactic errors.
With Taipan, the UB matrix has to be shared between the 2 versions of the server. To
do this, in the SICS validation terminal type:
> sync
Note that this is not the SICS control terminal. You'll need to open a connection to
SICS on port 60013 via a putty session.
Later versions of Gumtree for Taipan will include a button that synchronises the
servers.
Sync'ing may take some time. To ensure that you know when the sync has finished, you
can type
> getlog command
> getlog value
> sync
You will see something like the following feedback on the validator connection as the
sync command is running:
Executing -> sync <- from socket 16
Executing -> restore ../script_validator//log/status.tcl <- from dummy socket
pa_top = -102.499977
pa_bottom = -104.000000
pa_top = -102.499977
pa_bottom = -104.000000
pa_top = -102.499977
pa_bottom = -104.000000
pa_left = -24.699976
….
New en position: 46.434
New qm position: 6.048
Simulation Server has SYNCHRONIZED!
Fixed motors may not have correct positions
Then
when the synchronisation is complete issue
> getlog kill
to kill the feedback, otherwise
you will see log messages for the commands that run when you validate the script, but
maybe that’s desirable.
Validation of scans
To check your script, you can validate it using the Validation tab in the Buffer
Queue. Drag your file into the Validate window and click on Validate. Information
about your file will scroll through the log screen. Use this to see if any errors or
motor limits have been reached.
Example experiment script
# This is a comment and will not be executed
drive qh 2.5 qk 0 ql 3.5 en 32
bmonscan clear
bmonscan add qh 2.5 0.1
bmonscan run 31 monitor 1000000
# This is another comment with important information
drive qh -2.5 qk 0 ql 3.5 en 32
bmonscan clear
bmonscan add s2 -55 -0.1
bmonscan run 31 monitor 1000000
clientput [m2 absenc] # (prints out the m2 absolute encoder value)
Motor errors
If you ever see the following error message:
> ERROR: THREAD ZERO NOT RUNNING ON CONTROLLER on m1
Type the following (this is case sensitive)
> m1 send RS
If you ever see the following error message:
> ERROR: MOTOR CONTROLLER RUN ERROR: -102 on m2
Type the following (this is case sensitive)
> m2 send MG RUNF and if this is a number not 0 or 1,
then:
> m2 send RUNF=0
Creating and accessing log files
There are new log files written for each experiment. These are located in:
J:\data\current\reports\exp#\LogFile.txt on the
Microsoft Windows DAV computer. These will be updated as the experiment progresses
and should include both commands from the command line window and the batch file.
Use a program such as WinSCP to transfer files to your computer. The files will be
in
/experiments/taipan/data/current/reports/exp#/LogFile.txt.
These files are archived to a proposal directory at the end of each cycle e.g.
/experiments/taipan/data/proposal/proposal#/reports/exp#/LogFile.txt