spec

Software for Diffraction

changes

highlights of modifications for spec release 5.01

April 20, 2002 - RELEASE 5.01.03

Updated Help Viewer

The spec help viewer has been updated. The viewer can now jump to keyword locations given by line numbers in the SPECD/help/.links file. Also, new commands to move forward and back by single lines and by half a screen are available when the viewer is used directly (rather than sending output through a pager).

Addition To Standard Scan Header

The default _head macro now also writes the contents of the UB[] and Q[] arrays in the scan headers prefixed by #G3 and #G4 respectively. The obsolete M[] array, previously written prefixed by #G2, has been eliminated. Also, the output format for all #G parameters has been changed in the _head_par from %g to %.10g macro, which increases the number of significant figures from six to ten.

Small Fix For kappa Code

A bug in the kappa geometry code where the cut points for the chi and phi angles were not applied to the calculations of the angles has been fixed.

Support For Alternate zaxis Configuration

The geo_zaxis.c code has been modified to support an alternate configuration that includes a refraction correction on ALPHA and BETA. The correction only occurs if the new geometry parameter ALPHA_C (defined as Q[21]) is nonzero.

Alternative EPICS Motor Naming Convention

An alternative to the motor naming convention used at APS for the EPICS motor record process variables is now available. See the epics help file for details.

Support For Socket-based Serial Interface

spec now supports Ethernet-to-serial devices such as the ATOP Technologies TigerLink. Only the device-independent sending and receiving of serial data over sockets is implemented. Configuration of baud rate, parity and other parameters must be taken care of outside of spec. To configure such a device, select SOCKET in the ADDR (for controllers) or TYPE (for a generic user-level serial interface) fields and enter the host name and port number separated by a colon in the DEVICE field.

Support For VME DAC Motors

The DAC motor support now includes VME DAC modules that use A16 addressing to set a single DAC 12- or 16-bit output register.

Support For ACS MCB-4B Motor Controller

The new Advanced Control Systems MCB-4B motor controller with RS-232C interface is now supported.

Support For Ortec Trump-PCI MCA

spec now supports the Ortec Trump-PCI MCA on Linux platforms.

Upgrade For Orsim MCA-7700 and Ortec Trump MCA

The support for the Orsim MCA-7700 and Ortec Trump MCA now implements counting to a peak preset. Use the new "peak_mode" mca_par() option to select. Also, some problems with setting and clearing the region-of-interest (ROI) have been fixed. In addition, a new "auto_clear" mca_par() option is available. When set, the MCA will be cleared before starting. The auto-clear mode is on by default.

Preliminary Support For Roentec MCA

The Roentec XFlash MAX MCA is now supported. This MCA uses a serial interface.

Upgrade For IMS Motor Controllers

spec now supports the Intelligent Motion Systems (IMS) motor controllers in non-party-line mode. Previously, only the daisy-chained party-line mode was implemented.

Fix For Riso ECB Motor Controllers

A buffer overflow bug that resulted in segmentation faults with the RISO ECB motor controllers on some platforms has been fixed.

Fix For GPIB Devices

A buffer overflow bug that could causes segmentation faults with spec's built-in support for a few GPIB devices on some platforms has been fixed.

March 22, 2002 - RELEASE 5.01.02-9

Kappa Geometry Installation Bug Fixed

A bug, where the kappa geometry wouldn't be installed correctly if the fourc geometry wasn't also installed, has been fixed.

setplot Revised

The setplot macro has been revised to eliminate confusing prompts.

esrf_io() Associative Array Bug Fixed

A bug, where esrf_io() would fail to correctly pass the elements of an associative array returned by a macro function, has been fixed.

February 26, 2002 - RELEASE 5.01.02-8

New Serial Configuration Options

All serial devices can now be configured for the additional baud rates 57600, 115200, 230400 and 460800. Generic serial devices can now be configured for hardware flow control.

Multiple EPICS Scaler Modules Supported

spec now allows configuration of EPICS generic scalers as either counter/timer units or as a counter-only units. Only one module can be counter/timer, as spec only allow one master timer. Additional modules must be configured as counters only.

New Doc String Syntax

As a prelude to new documentation tools for macros and command files, spec now recognizes a special character sequence to delimit extended comment text. Now, everything between pairs of triple double quotes """ is a comment. The comment block can span lines, but not files. Unlike comments that begin with a pound sign #, the doc string comments will not be saved with a macro if input as part of the macro definition.

Bug With Shared Arrays and Unglobal Fixed

A bug, where using the shared array, global and unglobal declarations in a statement block could lead to a segmentation fault, as in

{ shared array data[100];  unglobal data;  global data }

has been fixed.

February 5, 2002 - RELEASE 5.01.02-7

x11filt Enhancements

A number of enhancements have been made to the X11 plotting. The x11filt window will now respond to a close operation from the window manager, as might be initiated by a title-bar button or window-ops menu item. A static detached copy of the window can be created by simultaneously pressing the control key and any mouse button while the mouse cursor is over an active plot window. Also, a new plot_cntl("cmd=numb") command provides access to a number of special operations, including creating a detached window. See the x11 help file for more information.

February 3, 2002 - RELEASE 5.01.02-6

Fixes For psic Geometry

A bug in the psic geometry code, where the azimuthal reference vector was calculated incorrectly when specified by angles (sigma and tau) rather than components, has been fixed. Another bug, which disallowed user-entered azimuthal references vectors where the sum of the squares of the components was less than one, has been fixed. Also, the sectors calculations now check that the allowed sectors don't violate naz-fixed or qaz-fixed conditions. Also, for kappa-mode psic, the sectors code will display the motor positions for the real motors (keta, kap and kphi) rather than the pseudo motors (eta, chi and phi) by default. Both and real pseudo motors will be displayed for each sector in verbose format (ShowSect 2 along with the corresponding values for omega, qaz and naz.

January 28, 2002 - RELEASE 5.01.02-5

Clarification Of Array Behavior

The recent enhancements that included implementation of the relational (<, <=, ==, !=, >, >=) and Boolean (!, &&, ||) operators for data arrays gave ambiguous results in several cases, particularly when comparing an array with a scaler. Such a comparison now unambiguously produces a scaler value. The result is true if and only if the relation is true for each element of the array and the scaler. Otherwise, the result is false. In the case of Boolean operations, an array is considered true if any element is nonzero. If all elements are zero, the Boolean value of an array is false. In the case of string arrays, only single rows are allowed as Boolean operands, and an empty string or a string representation of zero evaluates as false, while anything else is considered true.

Improved Version of x11filt

The code in the x11filt program that draws the X graphics plot window for spec has been reorganized to better exclude unsuitable fonts - only fonts with registry iso8859-1 are now allowed. In addition, the event handling has been reorganized such that only one process per window will ever be created. Previously, for displays with no backing store, a second process was created for reasons not to be explained here.

January 24, 2002 - RELEASE 5.01.02-4

Expansion of PC DAC Motor Support

Support for selected PCI cards for use as DAC motors is now included. Currently, the Measurement Computing PCI-DDA08/16 and the CyberResearch CYDDA02/04/08HRP boards are supported in this manner.

January 20, 2002 - RELEASE 5.01.02-3

Refinement Of String Array Behavior

Various aspects of the treatment of string arrays have been modified due to popular demand. The print command no longer indicates trailing null bytes for each row of a string array, but does continue to display embedded null bytes. When assigning to a complete row of a string array, bytes in the row unfilled by the assignment will be set to zero. Also, when assigning to a complete row, numbers are assigned as strings.

Addendum to Serial/Socket Timeout Behavior

A fast poll for ser_get() and sock_get() has been implemented and is recognized by setting the timeout value to the minimum of 0.001 second, for example, as ser_par(0, "timeout", .001).

January 15, 2002 - RELEASE 5.01.02-2

Wizard Mode Fix

A problem with wizard mode on Solaris platforms has been fixed.

January 10, 2002 - RELEASE 5.01.02-1

New Server Macros

A new set of macros provides a simple interface to enable one instance of spec to send commands to another via the user-level socket functions. The macros are distributed in the file server.mac in the macros subdirectory of the spec distribution. See comments in that file for details.

Fix For Socket Timeout and Close

The behavior for sockets waiting for a connection in "listen" mode with the timeout parameter set to zero has been fixed to block indefinitely rather than return immediately. The "close" option to sock_par() will now close both of the sockets associated with a "listen"-mode socket. Previously, sock_par() with "close" would need to be issued twice.

January 7, 2002 - RELEASE 5.01.02

New fourc Parameter

The four-circle C code module geo_fourc.c distributed with spec has long contained a couple of optionally compiled lines of code that affected the sector where the chi motor would be located in the omega-zero and omega-fixed modes. A new geometry parameter g_omsect along with a new macro setomsect have been added to the distribution that allow this sector option to be selected without recompiling the code. The default value of zero for g_omsect maintains the prior default behavior. If g_omsect is nonzero, the value for chi will be reflected about the x-y plane if Q[x] is negative, i.e., the transformation becomes chi = 180 - chi.

Improvements To the Serial and Socket Interface

The code for the socket and and serial (RS-232C) interfaces has been reorganized and features have been added. The ser_get()/sock_get(), ser_put()/sock_put() and ser_par()/sock_par() functions now have the same consistent syntax and behavior. The buffer size for reads without a byte count is increased from 511 to 8191 bytes. New commands to ser_par()/sock_par() are available to check if there are left-over characters in the input queue and to flush the queue. See the serial and sockets help files for more information.

edconf Box Outline Change

A new -b flag for the edconf configuration editor forces the use of standard ASCII characters (+, - and |) to draw a box around menus and subwindows. Otherwise, special line-drawing characters available with some fonts will be used. Previously, the ASCII characters were always used with xterm windows. The default is to use the line-drawing characters, but as not all X fonts provide them and as there is no way to detect whether the chosen font has them, this new option is available. A new EDCONF_BOX_FLAG global variable is also included in the standard macros. If nonzero, the config macro will invoke edconf with the -b flag.

edconf Backup File Permissions Fixed

A bug, where the read/write permissions of the backup config and settings files were not always maintained by the configuration editor, edconf, has been fixed.

December 15, 2001 - RELEASE 5.01.01-10

Associative Array Looping Bug Fixed

A bug, where the usage

for (var in arr)
    delete arr[var]

resulted in occasional segmentation faults, has been fixed.

December 6, 2001 - RELEASE 5.01.01-9

Kappa Diffractometer calcP_fromR C Code Fixed

A bug in the new feature that calculated pseudomotor positions from real motors for the kappa versions of the fourc, fivec and psic geometries has been fixed. The feature was accessed with the calcP_fromR macro.

SCIPE Code Fixed

The recent overhaul of the internal socket code in spec broke the SCIPE support. The SCIPE support has now been repaired.

December 5, 2001 - RELEASE 5.01.01-8

Preliminary Support For Newport ESP-300

Preliminary support for the Newport ESP-300 motor controller is included in this spec release. The controller is supported over both GPIB and RS-232C interfaces.

November 22, 2001 - RELEASE 5.01.01-7

clone() Bug Fix

An unfortunate programming lapse, which resulted in a segmentation fault on some platforms when using the new clone() function to make a copy of a macro, has been corrected.

November 17, 2001 - RELEASE 5.01.01-6

fourc Bug Fixed

A bug in the fourc geometry code for locating the cut point for the tth motor has been fixed. On Linux and HP platforms, the bug resulted in the cut point always being treated as zero. On Solaris platforms, the bug resulted in impossibly large values for the tth motor. The bug was in all previous spec release 5 versions.

Technoland C-KP 402 Counter Bugs Fixed

Two bugs found in the new code for the CAMAC Technoland C-KP 402 Counter have been fixed. The first bug limited the 48-bit counters to 32 bits. The second bug prevented the last two channels of the eight available channels from being accessed.

Preliminary Support For the MBraun PSD-50m MCA

spec now supports the old MBraun PSD-50m MCA. This MCA uses an RS-232C interface.

Support For Keithley KPCI 3140 As Counters Only

spec now supports the Keithley KPCI-3140 PCI counter card, but only as four 32-bit counters. The card cannot be used with spec as a timer or preset counter.

November 6, 2001 - RELEASE 5.01.01-5

Plotting Bug Fixed

A bug introduced in release 5.01.01-1 that would often make it impossible to get plots of the data has been fixed.

New Time Scan Macros

Macros to scan detectors over time are now included with the standard spec macros. The new macros are called timescan, which scans continuously and loopscan, which scans for a finite number of points. See the macro definitions for details. These macros are from the ESRF BLISS collection.

Bug Fix in home Macro

A bug in the home macro introduced in release 4.05.10-3, which would produce syntax errors when the macro was used with the optional "+" or "-" arguments, has been fixed.

PCI Timer/Counter Found and Supported

An Am9513 type PCI counter has been found that does not suffer from the flaw contained in the Measurement Computing PCI-CTR05. This release of spec supports the ICS Advent PCIDCC5/10/20-P timer/counter cards. See the vendor's pages at www.icsadvent.com for more information.

Driver For PCA-II Updated For Linux 2.4 Kernels

The CSS pca.c driver for the obsolete Nucleus PCA-II MCA card has been updated to work with Linux 2.4 series kernels.

October 29, 2001 - RELEASE 5.01.01-4

Overhaul Of User-Level Socket Access

New sock_get() and sock_put() built-in functions have been added to replace the "read" and "send" options to sock_io(). A new sock_par() function replaces the other uses of sock_io(). (Use of sock_io() is still supported, but is now deprecated.) See the sockets help file for details.

New Names For ser_get() and gpib_get() Options

The options "short", "short_swap", "long" and "long_swap" are now recognized as synonyms for "int2", "int2_swap", "int4" and "int4_swap" in the ser_get() and gpib_get() functions.

October 29, 2001 - RELEASE 5.01.01-3

VME A24 Address Space Supported

spec now supports the A24 addressing mode through the vme_get(), vme_put() and vme_move() functions. The optional modifier argument must include the string "A24".

Bug Fix For Serial Devices With Hardware Handshake

A old bug, where spec would hang when closing unresponsive serial devices configured for hardware handshake, has been fixed.

Bug Fix For Crash On Macro Function Syntax Error

A bug, where spec could crash when executing a macro function that had a syntax error involving the macro function argument, has been fixed.

October 16, 2001 - RELEASE 5.01.01-2

Fix For Indirection Operator @

The code for handling array elements as arguments to the indirection operator @, as in { a = "x[10]"; @a = 1 } has been fixed. Previously, the operator only worked correctly with existing elements of existing associative arrays. Other cases produced segmentation faults. Elements of associative arrays are now handled correctly, whether existing or not. Elements of data arrays are not yet supported, but use produces an error message, not a core dump.

October 3, 2001 - RELEASE 5.01.01-1

Fix For MCA soft_preset Mode

Previously, when counting to a monitor preset with an MCA in "soft_preset" mode, the MCA would not stop at the end of the count period. Now, when counting to monitor, the MCA is started and stopped via software commands just as if "soft_preset" mode was disabled.

Fix For Several Timers

A missing bit of C code that would halt all counters and acquisition devices when an EPICS, SCIPE, ESRF CAEN 560 or MURR timer stopped has been added. Previously, although the counters associated with the particular timer would be stopped, unrelated counters were not.

New mca_par() Options

New "chans" and "max_chans" options to mca_par() return the current number of channels and the maximum number of channels available, respectively.

October 2, 2001 - RELEASE 5.01.01

Modifications and Fixes For User-Level Serial Access

The user-level generic access to RS-232C devices through the functions ser_get(), ser_put() and ser_par() has been modified and enhanced. The ser_get() function can now take a data-array argument, which allows reading binary data, including null bytes. All forms of ser_get() now use the current "timeout" value, which defaults to two seconds, but can be modified with ser_par(). Previously, ser_get() with just the device address argument would not timeout. Also, leftover characters (up to 512) from a ser_get() that has been satisfied with a byte count or an end-of-string match are now retained for the next ser_get(). There is a new "flush" option to ser_par() to flush any buffered characters. See the serial help file for details.

Enhancements For User-Level GPIB Access

The gpib_get() function can now take a data-array argument, which allows reading binary data, including null bytes. See the gpib help file for details.

Preliminary Support For Physik Instrumente C-860

Preliminary support for the Physik Instrumente C-860 "Mercury" single axis DC-motor controller is included. Several of these controllers can be daisy-chained over an RS-232C interface.

Data Array Enhancements

Previous restrictions on the usage of the string-array data type have been removed. In most situations, a string array is handled the same as a byte array. Exceptions to that rule include the treatment of string arrays by the print command, where the arrays are written as strings rather than a list of numbers, and the sscanf() function, where a scanned number can be stored as a string in a string array. Most functions that accept strings as arguments will now also accept a single row of a string array.

Also, the "row_wise" and "col_wise" arguments to array_op() now return the correct values for arrays where the mode hasn't been set explicitly.

Hardware Locking Fixed On Solaris and HP Platforms

Hardware locking now works again on Solaris and HP platforms. It had been ineffective on those platforms since release 4.04.01 about three years ago.

input(-1) Bug On Solaris Platforms Fixed

An old bug, where the input(-1) function didn't work correctly on Solaris platforms (the function returned the EOF character, rather than 0 if no input was available), has been fixed.

rdef Of Macro Function Bug Fixed

A bug, where using rdef to define a macro function that has no arguments resulted in an ordinary macro being created, has been fixed.

cplot_plot Macro Update For Release 5

An oversight, where the cplot_plot macro didn't work correctly with the new data-array based plotting macros in spec release 5, has been corrected.

PCI Detection Bug Fixed

A bug, where spec would not find the last PCI card in a Linux system, has been fixed.

Debugging Bug Fixed

A bug in the run-time context debugging display (level 0x40000), which could sometimes produce a segmentation fault, has been fixed.

Overhaul Of Alternate SBS (Bit3) VME Support

The release of the SBS (Bit3) Linux driver model 1003 v1.0 for the 616/617/618 PCI-VME adapters has made the CSS kernel-level driver bit3.c obsolete. However, at this time the SBS model 1003 driver is not ported to Linux 2.4 kernels, such as are installed with Red Hat 7.1 Linux. Rather than update the old CSS bit3.c driver, spec now offers support for the SBS PCI cards using user-level code only, independent of kernel version. The new code allows access to any part of the A32 address space, unlike the old CSS driver-based code, which had to be configured to use a particular 4 Mbyte window. The CSS user-level code is adequate for register-based VME devices such as the OMS motor controllers and the Joerger scalers, but does not support DMA transfers. The old CSS bit3 driver and the /dev/bit3 device node can be eliminated from the system when this new release of spec is installed.

Z-Axis Code Updated

The z-axis geometry code has been updated to use the current conventions. Among other changes, singularities in the calculations and other errors no longer cause the code to reset to command level. Instead, the calc() functions (included in the definitions of calcA and calcHKL) return nonzero when there is an error. In addition, there are now cut-point parameters for each geometry motor.