Although the spectrometer usually operated from the Manager window, it is also possible to control the spectrometer directly from the command line. Pulse programs are executables that can be started from the command line in the usual Unix fashion, and there is a suite of command line utilities available for functions such as halting an experiment, checking status, etc. In fact many of the Manager functions are implemented by invoking these same utilities.
The command line allows operation from a non-graphical environment, although this is of limited utility because there is no way to view the evolving data, and thus no way to judge the performance of an experiment. However, the command line environment does allow the user to produce scripts which will perform a sequence of experiment without operator intervention. This is sometimes quite useful.
Sometimes a series of experiments needs to be run on the same sample, either using several different pulse programs or, more commonly, using the same pulse program with different symbol table values. This process can be automated using a shell script. Although shell scripts can be quite complicated, a simple script is just a text file containing a series of commands. Here is an example:
gain_ownership cp flaws1a.sym symbols.sym flaws cp flaws1b.sym symbols.sym flaws cp flaws1c.sym symbols.sym flaws
This example runs the pulse program "flaws" three different times, each time using a different symbol table. The first line in the script:
gain_ownership
executes the "gain_ownership" utility which established ownership of the spectrometer on behalf of the script. This is not strictly necessary, it is simply insurance against the remote possibility that another user might seize ownership in the short interval between experiments when a pulse program is not running.
The next line:
cp flaws1a.sym symbols.sym
copies a previously prepared symbol file to default symbols file "symbols.sym". An executing pulse program always accesses the default symbol file.
The following line:
flaws
executes the pulse program named "flaws". The pulse program will execute using the symbol table that was established by the previous line in the script. The remainder of the script simply repeats the process, establishing a new symbol table each time the pulse program is run again.
The script file can be prepared with any text editor. However, before a newly created script file can be executed, the user must first modify the permissions of the file by adding execution permission. This is done with the "chmod" command as in this example:
chmod +x my_script
It is simplest if the script is created in, and executed from, the users default pulse program directory. That way the executed pulse program will already be in the path. This is also the required location for "symbols.sym".
The symbol files must be prepared in advance, a task most easily performed using the symbol editor program. Note that each symbol table should define a unique data file name so that each invocation of the pulse program creates a uniquely named data file. Otherwise, data files will be overwritten as the script advances.
The following is a list of the available command line utilities accompanied by descriptions of their functions.
This command stops the executing pulse program and discards the associated data file. The Manager program invokes this utility when the "Abort" button is clicked.
This command modifies the default symbol table by redefining symbol_name to have the value specified by value.
This command reads the spectrometer data file specified by file_name, formats each section, and outputs the formatted data to standard output. This is intended as a diagnostic tool.
This command establishes spectrometer ownership on behalf of the process that invoked the command. See "Ownership" and "Using Scripts" for more information.
This utility creates a data file named file_name in the format required by the felix data reduction program. The file is created using the same shared memory data that is used by the FID display program. This utility is intended for use by felix macros that automatically display spectrometer data as it is acquired. A display reference number is recorded in the felix data file "reference shift" field (kludge, but it works) so that the macro can determine if the file contains data that has not been previously displayed.
This utility outputs a formatted list of the cards (controller and output) installed in the pulse programmer and of the memory fields that exist on each card. This is intended as a diagnostic tool; the output can be piped to the memtest utility to perform a state memory diagnostic.
This command lists all the symbols, and there values respective values, found in the default symbol table.
This utility reads a list of card and memory field address (as output by getmemcnfg) and performs a memory diagnostic on each of the specified fields. Both an address test and a data test is performed.
This utility is used to implement the pulse program "-o" option. The utility attempts to open the file specified by fule_name. If the file exists, the utility opens a dialog box asking permission to overwite the file. If permission is granted the existing file is deleted.
The utility outputs the name of the current spectrometer owner and lists the PID (in the form of the /proc file system path) of each process on behalf of which ownership is currently being maintained.
This utility outputs the current values of all the semaphores used by the spectrometer software. This utility is intended for diagnositc purposes.
This command cause the PP to resume running if it is currently in a paused state. The Manager program invokes this utility when the "Continue" button is clicked.
This utility analyses the data currently held in shared memory and calculates the RMS value of the real and imaginary parts as well as the average DC value. The arguments first_point and last_point are optional and are used to force the utility to ignore points and the beginning and/or the end of the buffer. The first point is addressed as point zero. This utility is useful for performing receiver noise tests.
This utility reads the spectrometer data file specified by file_name and calculates the RMS value of the real and imaginary parts as well as the average DC value. This utility is useful for performing receiver noise tests.
A simple script that pipes the output of getmemcnfg to the input of memtest in order to perform a state memory diagnostic.
This command output the current pulse programmer status. The same output is produced as is displayed in the status box of the Manager display.
This command stops the executing pulse program. If data has been written to the data file, the data file is preserved. The Manager program invokes this utility when the "Stop" button is clicked.
This utility performs a SCSI "test unit ready" command on unit zero of both the DAP and the PP. This is a basic diagnostic test to determine of both the DAP and PP are alive and responding to SCSI commands.