Measurement program for Electron Spin Echo Scan. Electron Spin Echo Scan application.
Introduction

Ese is a program to make magnetic field scan and time scan measurements with
the ESE (Electron Spin Echo) setup. Ese uses the Ezview graphic user interface.
It contains applications for magnetic field scan measurements (Field Scan),
time scan measurements (Time Scan), a simple plot application (Rulplot) and
an application to readout a LeCroy 9300/9310/9410 series oscilloscope (LeCroy).

The Ezview graphic user interface and the Rulplot application are described
in the 'Ezview Graphic User Interface User's Guide' as of December 23, 1993.

The other applications are shorlty described in the module containing the
user interface related code for that application (see below).

The ESE setup uses Rulbus modules for various purposes. Drivers for these
modules or devices are included in the Ese program. The Field Scan and Time
Scan applications contain dialogs to control these Rulbus devices directly.

To facilitate the generation of data filenames, a nameserver object has
been included in the program: theNameServer. It automatically generates
filenames of the form yymmddxy.ddd and yymmddtx.ddd for xy and textual
data files with a sequence number that is incremented for each new name
requested (yy: year, mm: month, dd: day, ddd: sequence number).

Error handling for memory, floating point and critical errors is taken
care of by error handlers provided in this module.

The next sections describe program initialization, a list of devices,
the programs menu and the modules that Ese.exe consists of.


Initialization

The Ese program has several initialization files, that are all located in
the same directory as ese.exe.

When the Ese program is started, it intializes it's Ezview settings from the
file ese.ini.

The Rulbus devices are initialized from the file ese.dev. When the Ese
program is exited, the device settings are saved again to ese.dev.

Each application has it's own initialization file (APPL.ini) and icon file
(APPL.ico) that are also located in the directory with ese.exe.
The initialization file is read when an application is started and saved again
when an application is closed, or when the Ese program is exited.

Note: if an application is iconized when the Ese program is exited, the
      initialization file is not updated. This is an Ezview error.


Programs Menu

The Ese WorkSpace programs submenu has the following entries:

Rulplot                 simple plot application
Field Scan              Ese field scan measurement
Time Scan               generic Ese time scan measurement
2-p ESEEM               two pulse ESEEM measurement
2-p ESEEM/laser         two pulse ESEEM measurement with laser
2-p DAF                 two pulse delay after flash
3-p ESEEM               three pulse ESEEM measurement
3-p ESEEM/laser         three pulse ESEEM measurement with laser
T1 measurement          T1 measurement
LeCroy                  LeCroy readout application; uses spcroydg/croy2ic/icconv.

All time scan measurement applications are really the same application, but
they use their own initialization file, so different parameter settings can
be used and saved.


List of devices

Here is a list of the Rulbus devices that are present in the Ese program.

pulse1	   - RB9303 : High Speed Pulse Generator
pulse2	   - RB9303 : High Speed Pulse Generator
pulse3	   - RB9303 : High Speed Pulse Generator
pulse4	   - RB9303 : High Speed Pulse Generator

adc	   - RB8905 : High Speed 12-bit ADC
amplifier  - RB9005 : Programmable Differential Amplifier

clock1	   - RB8515 : 100 MHz clock for delay
timer1	   - RB9102 : Interval timer
timer2	   - RB9102 : Interval timer

delay_lr1  - RB8514 : Low  Resolution Delay
delay_lr2  - RB8514 : Low  Resolution Delay
delay_lr3  - RB8514 : Low  Resolution Delay
delay_hr1  - RB9006 : High Resolution Delay
delay_hr2  - RB9006 : High Resolution Delay
delay_hr3  - RB9006 : High Resolution Delay

pport	   - RB8506P: Parallel Port (PIA)
phase	   - RB9205 : Phase Shifter
clockDelay - RB9401 : Phase Shifter Clock Delay


Source modules

Ese.exe is build from the following modules:

ese.prj        - Borland C++ version 2.0 project file,
ese.[ch]pp     - program's main function and global objects, this file,
esedlg.[ch]pp  - dialog related code,
esedas.[ch]pp  - base class for Data Acquisistion Systems applications, like LeCroy,
eselcr.[ch]pp  - LeCroy readout application, user interface related code,
esescn.[ch]pp  - base class for Ese Scan applications (Field/Time Scan),
fldscn.[ch]pp  - Field Scan application, user interface related code,
fldscn1.[ch]pp - Field Scan application, measurement related code
timscn.[ch]pp  - Time Scan application, user interface related code,
timscn1.[ch]pp - Time Scan application, measurement related code,
timscnt.[ch]pp - Time Scan application, code to test measurement loop execution time,

raslibl.lib    - SUN raster file library, version 1.4, large memory model,
ruldevl.lib    - RULBUS Device library, version 1.00, large memory model,
rulinsl.lib    - RULBUS Instrument library, version 1.00, large memory model,
rulutll.lib    - RULBUS Utility library, version 1.05, large memory model,
ezviewl.lib    - Ezview library, version 2.21, large memory model,
grlibl.lib     - graphics library, version 2.0,large memory model,
tclassl.lib    - Borland class library, version 1.xx (corrected version), large memory model.


Version identification strings

The executable ese.exe contains Revision Control System (RCS) identification
information that can be viewed with the following command:

C:\>ident ese.exe

It shows something like the following:

ese.exe:
     $Id: ese.cpp%v 1.6 1994/05/02 19:19:12 ese Exp ese %
     $Id: esedlg.cpp%v 1.1 1994/05/02 19:28:50 ese Exp ese %
     $Id: esedas.cpp%v 1.1 1994/05/02 19:28:50 ese Exp ese %
     $Id: eselcr.cpp%v 1.1 1994/05/02 19:28:50 ese Exp ese %
     $Revision: 1.1 %
     $Id: esescn.cpp%v 1.8 1994/05/02 19:28:50 ese Exp ese %
     $Id: fldscn.cpp%v 1.12 1994/05/02 19:28:50 ese Exp ese %
     $Revision: 1.12 %
     $Id: fldscn1.cpp%v 1.12 1994/05/02 19:44:54 ese Exp ese %
     $Id: timscn.cpp%v 1.12 1994/05/02 19:44:54 ese Exp ese %
     $Revision: 1.12 %
     $Id: timscn1.cpp%v 1.12 1994/05/02 19:44:54 ese Exp ese %

The trailing $ has been replaced with a % to make this list immune
to RCS updates of this file.


Electron Spin Echo Scan application basis.
Introduction

The ESESCN module provides the basis for the field scan and time scan
measurement applications.

To this end it provides two classes.

- Class EseScan is a base class for the classes FieldScan and TimeScan.
  It contains the menu and plot framework used in these applications.

- Class PropMeas provides a dialog class with which the measurement
  properties like 'beep after measurement' and the data filename format
  and the data directory can be specified. The datafilename format and
  the data directory are passed to theNameServer (see rulutl library).

The next sections describe the application menu and the methods to be defined
in an application.


Menu overview

EseScan has six menu buttons, a plot draw canvas with popup menu (View) and
a frame message field.

An overview of the menu is shown below.

File		Edit		View		Prop		Instrum		Measure
----------	----------	----------	----------	----------	----------
Load...		Cursor		Clear		Load...		Initialize	Parameters
Save as...	Zoom in		Reset		Print...	----------	Phase
Change Dir	Zoom out	----------- 	Plot...		Adc		----------
-----------   	-----------	Cut		-----------	Amplifier	Adjust
Print plot	Axis      >	Delete          Instrum  >	----------	Measure new
Print screen	Color     >	Duplicate	Measure...	Clock		Measure continued
		Grid      >	Move		----------	Timer1
		Date      >	Scale		About		Timer2
		Key       >	Smooth		Info		Delay_lr1
		Ticks     >     -----------			Delay_lr2
				Swap				Delay_lr3
				Rotate				Delay_hr1
								Delay_hr2
								Delay_hr3
								Pulse1
								Pulse2
								Pulse3
								Pulse4
								----------
								Pport
								Phase
								ClockDelay

Apart from the Instrum ad the Measure submenus, a description of the
submenus can be found in the 'Ezview Graphic User Interface User's Guide',
as of December 23, 1993.

The Prop|Instrum submenu let you choose between Normal and Group instrument
dialogs. With a Normal instrument dialog you set the typical instrument
properties, with a Group dialog e.g. for Rulbus devices, you specify the
Rulbus properties like rulbus converter base address, rulbus device rack
number and rulbus device base address.

The Instrum|Initialize command re-initializes all Rulbus devices with their
current settings. This can be useful when a Rulbus rack has been turned off
and on again.

With the Prop|Measure dialog measurement properties like 'beep after
measurement', the data filename format and the data directory can be
specified. The datafilename format and the data directory are passed
to theNameServer (see rulutl library).


Methods to be specified

Here is a list of methods that must be defined in a derived application class
to be able to make an instance of it.

Type information
- isA		 - type number
- nameOf	 - type name

Menu actions
- editText	 - edit the textual file of a data set
- propAbout	 - application version information
- measParm	 - measurement parameters dialog
- measNew	 - make a new measurement
- measCon	 - make a continued measurement

Button/dialog events
- _editTextEvent - textual file edit dialog
- _editTxt1Event - textual file edit update
- _measParmEvent - measurement parameters update

Other
- preProcess	 - preparation for measurement
- postProcess	 - processing after measurement
- saveText	 - save textual data
- saveXY	 - save xy data
- renew_plot	 - update plot window

To implement the application initialization file, the following methods
must also be defined.

Save/restore setup
- _print	 - write application parameters to stream
- _scan		 - scan application parameters from stream


Electron Spin Echo Field Scan application.
Introduction

The FLDSCN module is an Ezview application to make a magnetic field scan
measurement with the ESE (Electron Spin Echo) setup.

A field scan measurement consists of one or more scans in which a fixed
microwave pulse sequence is used and the magnetic field is scanned over
a certain range. The traces measured are averaged to obtain the end result.

Among other things (see ESESCN), the FieldScan application class provides
a dialog to specify the measurement parameters (Measure|Parameters) and
commands to start a new measurement(Measure|Measure new), or to continue
with a measurement (Measure|Measure continued).

The next section describes the Measure|Parameters dialog.


Measure|Parameters dialog

The Measure|Parameter dialog looks like the figure below.

.--------------------------------------------------------------------------.
|			Measure: Parameters                                |
|--------------------------------------------------------------------------|
| Parameters:			Comments:                                  |
| Tau          [s]: ______	1 ________________________________________ |
| Center field [G]: ______	2 ________________________________________ |
| Adjust field [G]: ______	3 ________________________________________ |
| Scan field   [G]: ______	4 ________________________________________ |
| Scan time  [min]: ______	5 ________________________________________ |
| Scans total  [#]: ______	6 ________________________________________ |
| Scans actual [#]: ______						   |
| Points       [#]: ______	           ( Apply )  ( Cancel )	   |
|--------------------------------------------------------------------------|
| Text file: 940504tx.000						   |
`--------------------------------------------------------------------------'

It contains a push-pin in the unpinned state, a block for scan related
issues, six lines for comments, an Apply and Cancel button and a frame
message indicating the name of the file in which this textual information
will be saved.

The entries fields of the dialog have the following meaning.

- Tau          [s]:  pulse sequence information
- Center field [G]:  magnetic field value in center of scan
- Adjust field [G]:  small magnetic field correction value
- Scan field   [G]:  range of magnetic field to scan
- Scan time  [min]:  duration of one scan
- Scans total  [#]:  number of scans to avarage
- Scans actual [#]:  (displayed only)
- Points       [#]:  number of points in a scan

Further it contains six lines for comments.

It is possible to increase the value of 'Scans total' between measurements
and then continue the measurement (Measure|Measure continued) to obtain a
further averaged result.


Electron Spin Echo Time Scan application.
Introduction

The TIMSCN module is an Ezview application to make a time scan measurement
with the ESE (Electron Spin Echo) setup.

A time scan measurement consists of one or more scans in which a fixed
magnetic field is used and the microwave pulse sequence is scanned over
a certain range. The traces measured are averaged to obtain the end result.

Another type of measurement is to repeat a scan with a couple of
different phase settings for the microwave pulses, combining these
scans into one resulting scan.

Among other things (see ESESCN), the TimeScan application class provides
a dialog to specify the measurement parameters (Measure|Parameters),
a dialog to specify the phase sequence parameters (Measure|Phase) and
commands to help adjustment of the setup (Measure|Adjust), start a new
measurement (Measure|Measure new), or to continue with a measurement
(Measure|Measure continued).

The next section describes the Measure|Parameters, Measure|Phase and
Measure|Adjust dialogs.


Measure|Parameters dialog

The Measure|Parameter dialog looks like the figure below.

.--------------------------------------------------------------------------.
| .-|=)    		Measure: Parameters 				   |
|--------------------------------------------------------------------------|
| Parameters:                 Comments:                                    |
| Field         [G]: ______   1: ________________________________________  |
| Rep. rate    [Hz]: ______   2: ________________________________________  |
| Scans total   [#]: ______   3: ________________________________________  |
| Samples/point [#]: ______   4: ________________________________________  |
| Samples/wait  [#]: ______   5: ________________________________________  |
| Plot update   [s]: ______   6: ________________________________________  |
|                                                                          |
| Principal delay:                                                         |
| P _______________     From: ________    To: ________    Step: ________   |
|                                                                          |
| Intermediate definitions:                                                |
| I _____________________________________________________________________  |
|                                                                          |
| Derived delays:                                                          |
| 1 _______________   Expr: _____________________________________________  |
| 2 _______________   Expr: _____________________________________________  |
| 3 _______________   Expr: _____________________________________________  |
| 4 _______________   Expr: _____________________________________________  |
| 5 _______________   Expr: _____________________________________________  |
| 6 _______________   Expr: _____________________________________________  |
|                                                                          |
| Phase sequence ( on > )		( Apply )   ( Cancel )             |
|--------------------------------------------------------------------------|
| Text file: 940504tx.000                                                  |
`--------------------------------------------------------------------------'

It contains a push-pin in the unpinned state, a block for scan related
issues, six lines for comments, the name and timing range of the principal
delay device, a field for intermediate variables, six fields to specify
the other delay devices used and an expression how to calculate their delay
setting, a button to turn on or off the use of the phase sequence, an Apply
and Cancel button and a frame message indicating the name of the file in
which this textual information will be saved.

The dialog entry fields have the following meaning.

Parameters:
- Field         [G]:  magnetic field value in center of scan
- Rep. rate    [Hz]:  experiment sample repetition rate
- Scans total   [#]:  number of scans to avarage
- Samples/point [#]:  number of samples in Boxcar for one point of scan
- Samples/wait  [#]:  number of samples to wait between successive scans
- Plot update   [s]:  number of seconds to wait between screen updates

Principal delay:
- P		      name of delay device that is the principal delay
- From:		      pulse sequence start delay time
- To:		      pulse sequence end delay time
- Step:		      pulse sequence increment delay time

Intermediate definitions:
On this line intermediate variable definitions can be specified.

Derived delays:
Six lines specifying the name of a delay device and an expression to
calculate the delay setting.

Phase sequence Menu button:
With this button the use of a phase sequence (see Measure|Phase dialog)
can be turned on and off.

Comments:
At last the dialog contains six lines for comments.

It is possible to increase the value of 'Scans total' between measurements
and then continue the measurement (Measure|Measure continued) to obtain a
further averaged result.


Measure|Phase dialog

The Measure|Phase dialog looks like the figure below.

.------------------------------------------------------------------.
| .-|=)    		Measure: Phase	 			   |
|------------------------------------------------------------------|
| Polarity:  Phase Angles:                                         |
| +/- ____   1 __________________________________________________  |
| +/- ____   2 __________________________________________________  |
| +/- ____   3 __________________________________________________  |
| +/- ____   4 __________________________________________________  |
| +/- ____   5 __________________________________________________  |
| +/- ____   6 __________________________________________________  |
| +/- ____   7 __________________________________________________  |
| +/- ____   8 __________________________________________________  |
|	 			    ( Apply )   ( Cancel )         |
|------------------------------------------------------------------|
| Text file: 940504tx.000                                          |
`------------------------------------------------------------------'

It contains a push-pin in the unpinned state, eight lines specifying the
polarity and phase angles for each phase scan, an Apply and Cancel button
and a frame message indicating the name of the file in which this textual
information will be saved.

The polarity of a phase scan indicates if the points measured for that scan
must be inverted (-) or not (+) before they are put in the 'actual' buffer.

The phase angle entries specify a list of angles in degrees, one for each
microwave pulse, separated by spaces.


Measure|Adjust dialog

The Measure|Adjust dialog looks like the figure below.

.---------------------------.
| (O)	Measure: Adjust     |
|---------------------------|
| Principal delay: ________ |
|---------------------------|
| Ready			    |
`---------------------------'

The dialog has a push-pin in the pinned state, an entry field to fill in
the principal delay and a frame message field to indicate errors that occur
while setting the requested delay.

When a delay is specified and the Return-key is pressed, the delay devices
are set according to the specifications in the Measure|Parameters dialog box.