Using the MAR345 Image Plate Scanner

New Network Configuration for Mar345 Computer (after April 2004)

The network configuration for the Mar345 computer has been modified so that it uses the same ethernet connection to control the image plate scanner and to connect to the laboratory network. This removes the need to have a separate ethernet cable running to the scanner. The setup instructions below have been modified to reflect the changed configuration.

Important Note

Be extremely careful when setting up and using the image plate scanner that you do NOT under ANY circumstances allow the direct X-ray beam to strike the image plate. If you do so, the image plate will be seriously damaged. It is essential that you use a beamstop in front of the scanner to block the direct beam. There are lead sheets that you must place in front of the image plate while you are aligning the beamstop. If you are in the slightest doubt about any of this, seek help from the beamline staff.

Setting up the image plate scanner & control computer.

Setup:
  1. Position the cart with the control computer somewhere outside the hutch where you will be working, and connect it to a power outlet.
  2. Position the image plate scanner inside the hutch, and connect it to a power outlet.
  3. Connect the image plate scanner ethernet port and the control computer ethernet port to the laboratory network. The 'lower' ethernet card in the control computer is no longer used.
  4. Turn on the power to the image plate scanner. There should be a considerable amount of spinning noises, culminating in quite a loud 'thunk' as the image plate scanner powers up.
  5. Turn on the power to control computer. There should be a considerable number of messages scrolling by on the screen before they are replaced by a graphical login screen. The computer is set up to get its IP address from a DHCP server. If you are running on sector 11, the computer will be known as 's11mar345', and if you are running on sector 12, it will be known as 's12mar345' - you'll need to know which of these it is for some later steps in the operating procedure.

Verifying the correct operation of the image plate scanner.

You can control the operation of the image plate scanner using software installed on the control computer. This software is provided by the scanner manufacturer. This software is not, however, able to control the beamline shutters and motors, for which the control software on the beamline computer must be used.

Since the scanner readout does not need to be precisely synchronised with the X ray beam exposure, it is possible that, for many experiments, it will be sufficient to use the manufacturer-provided software to perform readouts, and separately to use the beamline control software to control the beamline shutters.

Setup:
  1. Log in to the scanner control computer using the bessrc account. Find a terminal window, either one may be opened already when you log in, or you can open a new one by clicking the terminal icon on the bottom toolbar of the screen. You should see a prompt something like:

    bessrc@s11mar345:/home/bessrc %

  2. Change to the directory where you will be saving your data:

    cd /home/bessrc/data/myData/

    Note that the beamline scientist should have created a new directory for you, which would replace the 'myData' above.
  3. Now type the command to open the scanner control software:

    mar345 &

    Note that it is important to type the final ampersand character (&)
  4. A small acknowledgement window should open up, shortly replaced by a pair of windows containing camera controls and a display of the detector image. (see below)
  5. The "Collect" and "Open Shutter" buttons will not work properly, but the "Scan", "Erase" and "Initialize" buttons should work.
  6. You can scan the image plate by clicking on the "Scan" button. The scanned image should be saved in the data directory you set up earlier

Remote control of the image plate scanner from Spec.

For more sophisticated control of the image plate scanner it is necessary to synchronise the readout with control of the rest of the beamline equipment. This implies communication between software running on the beamline control computer and software running on the image plate control computer. There is software installed on the two computers to allow this, but it requires for it's operation that both of the software programs display on the same screen. This is easy to arrange by means of a remote login to the 'other' computer using 'ssh'. It is probably most convenient to log in initially to the beamline control computer and then connect remotely to the image plate scanner computer.

NOTE: Unfortunately it is not possible to use the mar345 software and the remote control software at the same time. Be sure that you quit from the mar345 software before attempting to use the remote control software. You can, however, use the similar 'marView' program to look at the scanned image files. This program is generally very similar to 'mar345' but is intended just to display the scanned image files and cannot control the image plate scanner.

Setup:
  1. Log in to the beamline linux computer using the bessrc account.
  2. Open two terminal windows on the beamline computer, opening them if necessary by clicking on the icon of a terminal in the tool bar at the bottom of the screen. You should see a prompt like:

    [bessrc@cacofonix bessrc]$

  3. Open a remote connection to the image plate computer by typing:

    ssh s11mar345

    in one of the terminal windows. You should see a prompt something like:

    bessrc@s11mar345:/home/bessrc %

  4. The remote control program will save the scanned data files in the directory from which it is run, so change to your data directory before launching the remote control program. Type:

    cd /home/bessrc/data/myData/

    (substitute your actual data directory instead of 'myData')
  5. Start up the remote control software by typing

    mar345remote &

    in this terminal window. (Again, the ampersand (&) is important.) You should see a relatively plain window. When you read out the image plate, you should see additional messages appearing in this window.

  6. Now move to the second of the two terminal windows that you opened at the start. You will run spec in this window.
  7. Start spec by running the BESSRC front-end program 'specfe'. Type:

    specfe

    in the terminal window. You should see a new window open up with the spec front end program. You should also see a number of messages from Spec in the terminal window, followed by a prompt something like:

    1243.FOURC>

    You will be typing Spec commands into the terminal window.



  8. The image plate scanner macros should already be loaded into spec. You can get a list of their names by typing

    lsdef *345*

    They may also be found in the file 'mar345.mac'
  9. The most important macro is 'mar345expose' which is used to perform a timed exposure and readout of the image plate. This macro requires two arguments - a filename base, and an exposure time in seconds. The filename base is combined with a numerical index (or scan number) to form a unique filename. The scan number is stored in the Spec global variable 'fileindex', and is incremented before each scan. You can manually reset it if you want to start a new series of scans. So, for example, if 'scanindex' was set to 127, and you typed:

    mar345expose("junk", 10)

    then spec would open the beamline shutters for 10 seconds, close them again, and then read out the image plate into the file 'junk_00128.mar3450'

Descriptions of the Spec macros

mar345openshutter, mar345closeshutter

A pair of macros used to open and close the beamline shutters. These should be locally defined appropriately for the beamline on which they are running. For example, on station 11ID-B, the front-end shutters are used to control the exposure, and are controlled by writing to a pair of epics PVs.
    def mar345openshutter '
       epics_put("id11eps:OpenShutterB",1)
    '
      
    def mar345closeshutter '
       epics_put("id11eps:CloseShutterB",1)
    '
    

mar345readout(filebase)

A macro used to perform a readout after the exposure has completed. The scan is saved in a file named as described above. The global variable 'fileindex' contains a scan number which is included in the saved file name. The actual readout is triggered by calling an auxiliary tcl/tk script called mar345send.tcl which handles the remote communication with the image plate control computer.
    def mar345readout(filename) '{
       fileindex++
       unix(sprintf("/home/bessrc/mar345send.tcl %s_%-0.5d", filename, fileindex));
    }'
    

mar345expose(filebase,exposure)

A macro used to perform a combined exposure and readout operation. It opens the shutters, performs a spec counting operation for the requested exposure time, closes the shutters and then reads out the scanned image. It also makes an entry in the spec data file consisting of the saved image file name, the date and time, and the values of some counters. You may find it desirable to modify this macro locally if you want to write different information into the spec data file.
    def mar345expose(filename, exposure) '{
       mar345openshutter
       uctn (exposure)
       mar345closeshutter
       mar345readout(filename)
       ond
       printf ("#U %d  %d  %g  %g  %s  %s\n", time(), S[sec], S[mon], S[c4], filename, date());
       offd
       printf ("#U %d  %d  %g  %g  %s  %s\n", time(), S[sec], S[mon], S[c4], filename, date());
    }'
    

mar345sequence filebase startindex endindex exposure delay

A macro mainly provided as an example of how you might use the other macros in an experiment sequence.
    def mar345sequence '{
       local filename filebase startindex endindex exposure delay frame
       if ($# != 5) {
          printf("usage: mar345sequence filename startindex endindex exposure delay\n");
       } else {
          filebase="$1"
          startindex=$2
          endindex=$3
          exposure=$4
          delay=$5

          for (frame=startindex; frame <= endindex; frame++) {
             filename=sprintf("%s_%-0.5d", filebase, frame)
             printf ("Exposing %s\n", filename)
             mar345expose(sprintf("\"%s\"",filename), $4)
             sleep(delay)
          }
       }
    }'
    

Guy Jennings
Last modified: Tue Sep 9 16:25:56 CDT 2008