A Simple Fast Scan

The simplest scans involve counters and timers only. In the following example three counters are read at each stop during an energy scan.

The scan is called by:

ONLINE$>$ scan/energy

The menu is displayed in table 15.4.


Table 15.1: Example: Fast Scan Menu
 
                             --- ENERGY Scan ---
   SPECTRA>  |                                                            |

   ENERGY:          8001.019      [eV]          A-Move:                    [eV]


-------------------------------------------------------------------------------
   Scan_Name:         ak_0016
   Generic Scan Name: ak
   Comment:
   Start:           0             [eV]     Stop:         0            [eV]
   Delta:           0             [eV]     Sample_time:  1            [Seconds]
   Range:                                  NP:
   Scan_par:        1                      Wait_time     0.1
   Maximum x        0             [eV]     SSA:          NO
   Auto-return:     (1) YES                Repeats:      1
-------------------------------------------------------------------------------
   Edit com-files
    <~.prog>before_fast_scan.gra                                      NO
    <~.prog>during_fast_scan.gra                                      NO
    <~.prog>after_fast_scan.gra                                       NO
-------------------------------------------------------------------------------
 PF1 - Start Scan, PF2 - Continue Scan, PF4 - Exit, <Space bar> - Stop Scan
 KP7 - Cursor scan_name, Z - Toggle Zoom, D - Display, ^W - Refresh Screen


Figure 15.1 shows the graphical output which is generated during the scan.

Figure 15.1: The Online Display of Fast Scans
Image fast_scan

The details are in the .gra files (scan macros). Let's look at before_fast_scan.gra. It is displayed in table 15.4.


Table 15.2: Example: Before_fast_scan.gra
 
!
! before_fast_scan.gra
!

!
! these symbols are keywords. they select the 
! counters that are to be used during the scan
!
  scan_c1 = c1 
  scan_descr_c1 = "Ioni0"
  scan_c2 = c2 
  scan_c3 = c3 
  scan_c4 = c4 

!
! display scan_c1 and scan_c2 during the scan
!
  scan_display_set = (1, 2, 3)
!
! counter c1 has to have a minimum of 1000 counts per second 
! otherwise the scan is interrupted 
!
  scan_min_c1 = 1000

  scan_timer = t1 

!
! get_offsets() uses scan_timer and scan_ci to 
! measure the offsets 
!
  if !search_symbol( scan_offset_c1) 
    s1 = get_offsets(10) 
  endif

  deactivate scan_name

  end


Explanations to the file before_fast_scan.gra:

 scan_c1 = c1
The symbols scan_c1, ~_c2, etc. are keywords. They direct ONLINE to repeatedly read-out the counters c1, c2, c3 and c4. The allocation of space for the data, the online display, etc. is done automatically.

 scan_display_set = (1, 2, 3)
Scan_c1, scan_c2 and scan_c3 are displayed during the scan. The other counter is also measured and written to disk.

 scan_timer = t1
Fast scans need a timer.

 scan_min_c1 = 1000
If the count rate of scan_c1 falls below 1000, ONLINE interrupts the measurement (injection). This symbol is also used with the /auto_beam option which directs ONLINE to pause the measurement during the injection and continue the scan after waiting for the setup to heat-up. See section 8.1.1 for more information about this feature.

 s1 = get_offsets(10)
This function measures the counter offsets. It uses the symbols scan_c1, scan_c2, ... and scan_timer. The sample time is 10 seconds. Get_offsets() stores the measured offsets in symbols: scan_offset_c1, .... Note the scan_offset_c1 refers to c1 and not necessarily to scan_c1.

 deactivate scan_name
Scan_name is the master copy of all data sets. Other scans use it to store some data. In case of simple fast scans it is not needed.

The during-file is empty, the after-file is shown in table 15.4.


Table 15.3: Example: After_fast_scan.gra

 

!
! after_fast_scan.gra
!

  if noyes( "Write to disk") 
    write/fio/scan/motor scan_name 
  endif
!
! hardcopy
!
  if yesno( "Postscript") 
    post/nocon/print/dina4
  endif 
!
! Cleanup deletes all GQEs that are deactivated and saved to disk
!
  Cleanup


The explanations to the file after_fast_scan.gra:

 noyes()
This function prompts for input and returns yes by default.

 write/fio/scan/motor scan_name
Writes the data to a disk file. The qualifier /scan selects SCANs that begin with scan_name, /motor directs ONLINE to dump the current motor positions into the output file.

 post/nocon/print/dina4
Produces a hardcopy of the online display. The qualifier /nocon suppresses the question whether the default output file, laser.ps, may bo overwritten, /print sends the output file to the default printer, /dina4 re-formats the graphical output to fit onto a DINA4 page. The default printer is determined from the symbol printer and the environement variables PRINTER and LPDEST. The symbol has the highest precedence.