This section shows scan macros that execute a rather simple scan. Two counters and the DORIS current are read, displayed and stored.
Here is the before macro:
delete i_doris.* copy/nocon scan_name i_doris set i_doris/at=(2,2,2)/col=4/prim=0 create/text/string="I-DORIS"/y=1.05/x=0.5/prim=2 i_doris.1 delete detector.* copy/nocon scan_name detector set detector/at=(2,2,3)/col=2/prim=5/type=1/par=4 create/text/string="Detector"/y=1.05/x=0.5 detector.1 delete monitor.* copy/nocon scan_name Monitor set monitor/at=(2,2,4)/col=3/prim=1/type=2 create/text/string="Monitor"/y=1.05/x=0.5/prim=1 monitor.1 deact scan_name.* delete 0.2 delete 0.3 delete 0.4 create/text 0.2/string=scan_name" "date()" "time()/y=0.90/x=0 create/text 0.3/string=scan_device" from "start" to "stop" by "delta/y=0.85/x=0 create/text 0.4/string="Sample time "sample_time/y=0.80/x=0 cls/gr set inter off
Explanations:
copy/nocon scan_name i_doris Three scan GQEs are created, i_doris, detector and monitor. They are copied from scan_name, a GQE that is automatically maintained by Online. |
set i_doris/at=(2,2,2)/col=4/prim=0 The scan i_doris is placed into the upper right part of the screen. The colour is blue, the primitive type is line. |
create/text/string="I-DORIS"/y=1.05/x=0.5/prim=2 i_doris.1 A line of text. |
deact scan_name.* The scan GQE scan_name is made invisible. |
cls/gr The graphic screen is cleared. |
set inter off The display mode is set to non-interactive. The result is that
the screen is cleared only, if necessary.
|
The during macro resets the counters, starts and waits for the timer, reads the counters and displays the reading:
dum = resaco() sawft(t1) = sample_time detector( sindex, 2) = gc(c0) monitor( sindex, 2) = gc(c1) i_doris( sindex, 2) = doris() auto/y display
Explanations:
dum = resaco() Reset all counters. |
sawft(t1) = sample_time Start and wait for timer. The symbol sample_time is maintained by Online. |
detector( sindex, 2) = gc( c0) Counter C0 is read. The contents is stored in the scan GQE detector. The symbol sindex is maintained by Online. |
auto/y Autoscale.
|
The after macro produces a postscript output, if requested, stores the data on a disk file and cleans the internal storage:
if yesno( Postscript) post/nocon/print endif write/fio/x(scan_name)/y(detector)/y(monitor)/y(i_doris)/motors scan_name cleanup
Explanations:
write/fio/x(scan_name) ... Writes the results to a disk file. Notice that the x-axis is taken from scan_name because the x-values of scan_name are automatically maintained by Online. |
cleanup Deletes recorded GQEs that are invisible and compresses the
internal storage. Here we use the compress feature only because the
scan GQEs are deleted explicitly in the before macro.
|