changes

highlights of modifications for spec release 2.13

DESCRIPTION

These notes summarize the modifications made for spec release 2.13, as finalized on March 3, 1990.

USER INTERFACE

The commands lscmd, syms, lsdef and prdef now allow arguments containing the metacharacters ? and *, which have the conventional meanings. Thus, for example, typing lsdef *scan will list all the macros whose names end with the characters scan.

Commands recalled using the history feature can now be modified using a subset of the standard csh history-feature syntax. Appending :s/left/right/ to a history recalled item will modify the first occurrence of the string left in the recalled command to the characters right. The delimiter of the left and right strings may be any character. The final delimiter is optional. If left is empty, the last entered left string is used as the pattern to match. In addition, ^left^right^ is short hand for !-1:s/left/right/. In this case the circumflex (^) must be used as the delimiter.

The debugging messages printed with DEBUG=1024 have been revised to show more clearly the input text after macro expansion.

The help files have been reformatted in the style of the standard UNIX manual pages, and many new help topics have been added.

MACROS

The startup macro has been expanded to ask for values for most of the variables and mode settings a user normally might change. Besides prompting for the title, printer device and data file, as before, the startup macro now also invokes the starttemp, setscans, setplot and startgeo macros. It also prompts for values for the default count time (COUNT), the user's command file directory (DO_DIR) and the frequency of screen updates during updated moving and counting (UPDATE).

The startup and newfile macros now test if the specified printer or data file can be opened, before assigning values to PRINTER and DATAFILE. Also, the startup macro insists the printer name must begin with the characters /dev/. One can still assign an arbitrary file or device to the printer, though, by assigning a value to PRINTER.

The macros have been revised to place the geometry-dependent parts in the specific geometry macro source files. In particular, the standard scan macros no longer have four-circle motor names built in.

Most of the macros now explicitly declare local variables as local to minimize name conflicts when macros are nested or new variable names are used.

Most instances of getangles in the standard macros are now preceded by a waitmove. Previously, macros such as hscan, kscan, etc., would read the current angles, even if a motor was moving, when determining the starting reciprocal space coordinates of the scan.

An updated-count macro uct has been added. It continuously displays scaler contents during the counting interval.

A new setscans macro asks the user to configure scan options. A new scan option allows a user to eliminate the possibly time-consuming prescan limit check performed for reciprocal space scans. Another option causes the motor positioning and counting during scans to use updated moving and counting in the style of the umv and uct macros. (On VENIX 286 systems with CAMAC, these updated moves appear to sometimes hang. VENIX 286 users are advised to not rely on updated moves during unattended operation.)

The setplot macro has been substantially revised to reflect a number of new plotting options available, including updated plots during scans, a logarithmic y axis and pinning the minimum y value at zero. See the plot help file for details.

The information displayed above the screen plots can now be modified by the user by redefining the macros rplot_res and splot_res. The first of these prints out information during the real-time screen plotting, while the second is for the final screen plot.

A mvd macro moves a motor with the position argument specified in dial units.

There has been a difference in opinion among spec users as to whether the ca macro should leave the calculated positions in H, K, L and A[], or whether these variables should be restored to the current diffractometer position after printing the results of the calculation. To accommodate both classes of users, a new macro cal is provided that leaves the calculated positions in the appropriate variables. The ca macro will restore the variables to the current spectrometer position.

A new savcmd macro sends the output of any command to a file. The first argument to savcmd is the command to save, the second argument is the file name. Multiple commands or multi-word commands can be saved by enclosing them in quotes, as in savcmd "wm th tth" motor_file.

The debug macro now examines its argument or the prompted-for value for an initial + or -. A + adds the specified level to the current debugging variable, while a - removes the specified level.

FUNCTIONS

The built-in commands open, close, on and off have been replaced by the functions open(), close(), on() and off(). Functions are more versatile than commands as their return values can be used in expressions. Macros that open files can now look at the return value of the open() function and take appropriate action if the file can't be opened, rather than be reset to command level. See the files help file for details of the new usage. All standard macros have been adapted to the new usage.

The sleep() function now takes fractional-valued arguments to specify sleep periods of sub-second resolution. Periods greater than five seconds are rounded to the nearest second. The previous syntax that used negative integer arguments to specify sleeps in units of a sixtieth of a second will continue to be recognized for the time being.

The tcount() function now accepts nonintegral count times.

A new function, motor_par(), returns configuration parameters for a particular motor. Presently, only the step-size parameter is returned. See the motors help file for usage.

A new function, pl_dump(), efficiently prints all or a portion of the built-in plot array to output devices and files. See the plot help file for details.

The pl_anal() function now returns the sum of the squares of the y values when called with an argument of 12. The macro pl_SUMSQ is defined to be this quantity.

The pl_anal() function can now do a simple linear-background subtraction before doing the standard analyses. The linear background is calculated from the scan endpoints. The new built-in variable BGPTS can be set to the number of points from each end of the scan to average together before calculating the linear background. The macros, pl_bgMAX, pl_bgUHMX, pl_bgLHMX, pl_bgSUM, pl_bgFWHM, pl_bgCFWHM and pl_bgxMAX have been defined as appropriate calls of pl_anal(). The setplot macro can be used to select the background subtraction mode. See the plot help file for more information. This is a trial feature, implemented in response to a specific user request and may be modified substantially in future releases.

GEOMETRY CODE

The four-circle phi-zero geometry mode has been changed to a phi-fixed mode. To recover the previous operation, use the freeze macro to freeze the value of phi at zero.

The macros for the four-circle lattice-parameter-refinement feature (or the fitting-the-orientation-matrix feature) have been renamed from beg_reflex, add_reflex and end_reflex to reflex_beg, reflex and reflex_end.

Support for a new geometry configuration, zaxis (see J.M. Bloch, J. Appl. Cryst. (1985) 18, 33-36), is included. The source code is in the file geo_zaxis.c.

The code for the surf geometry configuration has been expanded to accommodate a similar spectrometer used at Saclay.

HARDWARE

Support for the DSP TS-201 counter/timer CAMAC module is included. Count intervals can only be specified to within 1.5 percent when counting to time and to a power of two when counting to monitor. When counting to monitor, gating requires software intervention, causing an unavoidable latency in disabling the counter, resulting in variable count intervals.

Code to support the LeCroy CAMAC Model 2301 interface for the QVT Multichannel Analyzer used with a wire linear detector is now included. The getmca() command is used to read the MCA. See the counting help file for more information. The tcount() and mcount() functions will clear, start and stop the MCA using the configured timing generator. The software gating will not interfere with hardware gating, if hardware gating is present.

The code for the Joerger SMC CAMAC motor controller has been expanded to support Model SMC-LP, which has programmable velocity and acceleration registers. The edconf program now accepts these parameters for all SMC controllers, although the values entered are ignored for the other models.

Timing problems with the Kinetic Systems 3388 GPIB CAMAC module on fast 386 computers have been fixed.

PC counting boards based on the Am9513 counter/timer chip, such as the MetraByte CTM-05 and the Scientific Solutions Lab Master, may now be used with spec. Presently, the board is handled using user-level busy-wait loops. In the future, an interrupt-driven driver will be provided.

The Advanced Control Systems Step Pak RS-232C motor controllers are now supported.

Timeout errors on the National Instrument GPIB interface no longer cause a return to command level. On a timeout error, a gpib_get() will return an empty string, and a gpib_put() will return zero. Other errors, such as no GPIB listener, still reset to command level.

Trailing newlines and carriage returns are now stripped from the strings returned by gpib_get() when using the National Instruments GPIB board. Code for the other supported GPIB hardware has always done this.

The CAMAC driver for VENIX 286 can now be installed to support the modified DSP 6001/2 crate controllers by invoking the install_dsp script with the -M flag.

UTILITIES

A new utility command to be run from the shell called showscans is included. The showscans utility uses the C-PLOT package and the show.awk script (introduced in release 2.11) to produce summary plots of scans. When you install spec, showscans (and also contents) are now also installed automatically. A new file aux/README describes showscans and the other auxiliary files included with the spec package.

ADMINISTRATION

The distribution no longer comes with a prelinked version of the fourc executable. When you install the software for the first time, several source files will be compiled and all the object modules linked to produce the target executable.

The edconf program has been revised to accommodate the increasing number of hardware devices that spec supports. Most of these changes affect the format of the device screen.

Changes in the way edconf backs up the config and settings files should lesson instances of accidental total loss of motor positions through user inattention. The files are now backed up only once when running edconf, and then only when you try to write out the files, not when starting up.

There is also a new undocumented security feature offered by edconf that implements an additional level of protection to prevent unauthorized users from changing the configuration of selected motors. spec administrators who require this additional security should contact CSS for instructions.

It is now possible to link versions of spec that contain only the hardware modules that will be used by a specific site. You must edit Makefile and u_hdw.c in the the distribution directory and relink the appropriate binaries. See the site_eg target in Makefile for an example.

MISCELLANEOUS

A newly revised and indexed manual is included in this release of spec.

When spec in invoked with the -s flag, it is no longer possible to turn off simulate mode without restarting the program from the shell. This eliminates ambiguities about whether or not the configured hardware devices are opened and properly initialized when simulate mode is turned off.

When simulate mode is in effect, the reconfig command will read the settings file, but will not read the config file or change the hardware configuration.

The names of the state files in the userfiles subdirectories have been changed to use more characters from the user's login and terminal name.

When invoking spec from the shell the tty part of the .BI "-t" " tty" option must now contain the complete name of the device, either as /dev/tty12 or as tty12.

The memory arena routines have been rewritten to accommodate an arena twice as large on the VENIX LMC version of spec. Users can now include entire scans within single statement blocks without running out of memory.

The distributed version of spec is now compiled for 40 motors.

BUG FIXES

A bug that caused unintended motor movement under a particular scenario has been fixed. If you had commanded a move involving several motors (with the br macro, for example) and one of the motors was out of limits the move would be canceled. However, the next time you moved a motor, the motors that were not out of limits in the previous move would move to the previously commanded positions under some conditions. This rather serious bug has been fixed.

A bug where the next command typed in after hitting a hard motor limit was ignored has been fixed. Previously, any type ahead from the keyboard would be flushed after hitting a hard limit. Type ahead is no longer flushed, although command files are still closed after hitting a limit.

In previous versions, there were small intervals of time where keyboard interrupts (^C's) were ignored to prevent critical code from being disturbed. Ignoring interrupts is poor programming, as it makes the program response unpredictable to the user. In addition, on rare occasions, spec would enter a state where ^C's were ignored while motors were moving or counters were counting. In this release, the critical code is protected in ways other than ignoring ^C's. The method now used still has flaws due to fundamental limitations in the system calls being used. In the next release, the code will employ system calls available on systems other than VENIX for the 286 and PDP 11/73 to enable much more robust interrupt handling. Users of VENIX will, unfortunately, not benefit from those changes.

A bug in the grammar where expressions using the Boolean operators !, && and || reported syntax errors in a number of contexts has been fixed.

A bug, whereby number values obtained from strings (returned by input(), for example) were not scanned for octal or hexadecimal prefixes has been fixed.

The implementation of the local command has been totally revised to fix numerous bugs, the most serious of which made a built-in variable disappear if it was declared local.

Error messages are now printed if you use the global, unglobal or constant commands with built-in symbols.

A bug, whereby the code that calculated the values returned by pl_anal() for the FWHM and the center of the FWHM did poorly for certain unusual sets of data points, has been fixed.

A bug, where trying to print a very long string using print, printf or sprintf, would cause a core dump, has been fixed.