3.9.7. - Customizing Scan Output
To allow you to customize the scan headers and the information saved with each data point, several macros are available for redefinition. Their default definitions are:
def Pheader '' # Printer header def Fheader '' # File header def Plabel '"' # Printer/Video column labels def Pout '"' # Printer/Video output at each point def Flabel '"' # File column labels def Fout '"' # File output at each pointFour of these must be defined as strings -- in the default case, null strings. Here are examples of how these macros might save temperature set point and measurement information on the output devices.
def Pheader 'printf("\n Setpoint = %g (%g C)\n", TEMP_SP,DEGC_SP)' def Fheader '_cols++;printf("#X %gKohm (%gC)\n",TEMP_SP,DEGC_SP)' def Plabel 'sprintf("%7.7s %7.7s ","T-set","T-degC")' def Pout 'sprintf("%7.5g %7.5g ",TEMP_SP,DEGC)' def Flabel '"DegC "' def Fout 'sprintf("%g ",DEGC)'The
Pheader
and
Fheader
macros must print newline-terminated lines.
More than one line is permitted, however.
Besides adding scan header
information to the data file,
Fheader
also adjusts the value of
the global variable
_cols
, which is used to indicate the number of data columns in the data file.
In the example shown,
the
Flabel
and
Fout
definitions add one column to the data file, so
_cols
is incremented by one.
The
Plabel
and
Pout
macros add columns to the printer (and screen) output.
The columns in
Flabel
should be separated by double spaces
(the data file convention).
The columns in the other headers should be separated by single spaces.
In each case, the spaces come after the label.
The
Ftail
macro is available for adding scan results to the data file at the
conclusion of a scan.
By default
Ftail
is defined as nothing,
def Ftail '' # File tailYou might define it to be
def Ftail 'printf("#R %d %g %g %g %g %g %g\n", \ SCAN_N, pl_xMAX, pl_MAX, pl_FWHM, pl_CWHM, pl_COM, pl_SUM);'where the values being printed are from the
pl_anal()
function described on page ##.
The
#R
characters
begin the data file control line for scan results.