spec

Software for Diffraction

changes

Highlights for spec release 6.07

October 4, 2018 - RELEASE 6.07.07

IMPROVEMENTS

New get_history() Command

A new get_history(num) command returns entries from the command-line history as a string. If num is positive, returns the specified history item. If num is negative, returns the item relative to the current history number. If no item exists at the specified number, returns an empty string. See the history help file for details.

The show_state Utility Now Includes config and settings Info

The spec show_state utility displays the saved state of a spec session in human-readable form. The output will now also display the contents of the hardware config and motor settings files. Type show_state - at the shell prompt to see usage.

New sixc Geometry Configurations Supported

Support has been added to the six-circle geometry code and associated macros to recognize two additional configurations, where the standard gamma, delta and mu angles become pseudomotors. See the updated sixc help file for details.

Linearized Motor Limit Messages Possible

Previously, motor limit messages referred to "clockwise" and "counter-clockwise" hard limits. Now, if the standard optional motor parameter "rotary" is set and has a value of zero, the hard limits will be called "positive" and "negative" in the limit messages. In the hardware configuration editor, the parameter is labeled "Linear/Rotary". This motor parameter is presently only otherwise used in the built-in C code for the MicroMo MVP-2001, Attocube ANC350 and SmarAct MCS motor controllers.

FIXES

Fix For Assigning From Unset Associative Array

Previously, a runtime error would occur when assigning one associative array to another if no element of the right-hand side associative array had yet been assigned a value. That issue is now fixed.

Application Icons For splot and x11filt Installation Tuned

The installation process for desktop files introduced with spec release 6.07.05 has been refined. The desktop files allow certain modern Linux window managers to find and display icons for the splot and x11filt processes. Previously, the installation attempted to install the files in /usr/share/applications and would display an error message if the installation failed. Now the installation will attempt to install the files in one of these directories: /usr/local/share/applications, /usr/share/applications and ~/.local/share/applications, in that order. For the files to be copied, a directory must exist and the user running the Install script must have permission to create the file. If successful, a message indicating the install location will be displayed. No message will be displayed if the files are not installed due to insufficient permissions.

HARDWARE

Support For isel iMC-M/iMC-MP 4-Axis Motor Controllers

This spec release contains preliminary support for the isel iMC-M/iMC-MP 4-Axis Motor Controllers. See the isel help file for details.

Support For Kohzu KOSMOS Series Models ARIES/LYNX

Support for the Kohzu Kosmos series Aries/Lynx controllers are included in this spec release. See the kosmos help file for details.

New counter_par() "timestamp" Parameter For Event-Driven Counters

For counters with values updated by events sent from a spec server or via EPICS scalers or PV counters, the rate at which the values are updated is generally much slower than the rate at which user-level code can retrieve values with the getcounts command. These hardware types have a new read-only counter_par() "timestamp" argument implemented that returns the time at which the value was last updated by an event. The timestamp can be used to check whether an updated value is available. The timestamps are based on the system clock.

MACROS

Enhanced cscan Macros

The cscan continuous scans macros, introduced in spec 6.02, have two new features. Previously, the cscan macros treated all the enabled counters as cumulative counters, subtracting successive readings to get net counts at each data point. Now, if the optional counter_par() "cscan_instant" parameter exists for a particular counter and is nonzero, each reading for that counter will be used as is.

Count values associated with event-driven counters for EPICS scalers and process variables and spec server hardware are updated at a rate slower than the frequency with which the cscan macro can read the values via the get_counts call. That results in successive readings returning identical values. For these particular controller types (EPICS_SC, EPICS_PV and SPEC_SC), the cscan inner loop will now save a timestamp associated with the value and continue to read values until all the timestamps are updated. That timestamp checking can be disabled for a particular counter if the optional counter_par() "cscan_poll" parameter exists for that counter and has a value of zero.

See the cscan help file details.

August 16, 2018 - RELEASE 6.07.06

FIXES

Fix For Entering Negative Values In edconf

A bug that was introduced with the edconf updates in spec release 6.06.03 that broke initiating certain number entries with a minus sign has been fixed. In most cases, negative numbers could still be entered prior to this fix by editing an existing entry.

Fix For "short_swap" Option With ser_get(), sock_get(), gpib_get() and vxi11_get()

A very old bug where the "short_swap" option for the ser_get(), sock_get(), gpib_get() and vxi11_get() functions would read but not swap two bytes has been fixed. Note, the older version of the command "int2_swap" did work correctly.

July 23, 2018 - RELEASE 6.07.05

FIXES

Application Icons Now Work For splot and x11filt

The magic behind icon display with modern Linux window managers has been decoded, and the icons associated with spec's Python splot utility and standard x11filt plotting now display correctly in the window manager task bars. The standard spec installation will now install required desktop files in the /usr/share/applications directory, if such a directory exists.

Unexpected splot Restarts Fixed

Previously, for some commands, the Python splot utility did not return an expected value to spec, which would lead spec to restart the splot program. The issue has been corrected.

July 3, 2018 - RELEASE 6.07.04

MACROS

Fix For get_angles In Newer Scan Macros

A bug associated with the delta versions of the ascan, mesh and xascan scans defined in newscans.mac (which became the source of the standard scan macros in spec release 6.04.01), along with the delta versions of the cscan, cmesh, vscan, and flyscan macros, defined in cscan.mac, vscan.mac and flyscan.mac, has been fixed. The code that saved the initial positions at the start of the delta scans used the obsolete getangles macro instead of the current get_angles macro. The difference is that the latter includes a call of user_getangles, a hook macro used to set positions when using an old-style implementation of pseudo motors. Pseudo motor implementations that use the macro-hardware feature were not affected by this bug.

The getangles keyword was originally a built-in command in spec. It was replaced with the get_angles macro to accommodate the user_getangles hook 25 years ago. Twenty years ago, getangles itself was replaced by the built-in function read_motors(). For backwards compatibility, getangles still exists as a macro.

June 19, 2018 - RELEASE 6.07.03

FIXES

Recursive Macro Functions With Different Number Of Arguments Fix

A bug dating from spec release 6.06.11, where a nested call of a macro function using a different number of arguments could result in a segmentation fault, has been fixed.

May 2, 2018 - RELEASE 6.07.02

IMPROVEMENTS

New Laue Mode For psic Geometry

The psic geometry now supports a new mode that uses the two detector circles and the X-ray wavelength as the three degrees of freedom, keeping the four sample circles frozen. This mode can be useful if the sample rotations are limited or the X-ray focus is smaller than the diffractometer circle of confusion. See the psic help file for details.

MACROS

Fly Scan Updates

The new fly scan macros contain a number of fixes and additions. Among the fixes, an issue with the value of the prescale counter setting as shown in the fly_setup macro has been addressed. Among the additions, a new loopscan mode is available that doesn't use motors, but simply accumulates counts to the specified number of intervals using the MCS internal timebase to advance the channel counter. See the flyscan help file for details.

Counter Column Width Set Dynamically

The standard scan macros now adjust the width of the columns for counter values as displayed on the terminal window from between 8 and 11 characters, based on the space available. Previously, 8 characters were used. The change affects the standard _head, _loop and _upd_count macros.

HARDWARE

Support for Newport DL Controller

This spec release includes support for the Newport DL Controller Series single-axis motion controller. See the DL help file for details.

Update For Multix ME100 Server Hardware Implementation

Several issues with spec's server hardware module for the Multix ME100 have been fixed.

March 29, 2018 - RELEASE 6.07.01

IMPROVEMENTS

New -A Option For Server White Listing

A new start-up option can be used to limit the hosts allowed to connect to a spec server as clients or to spec via socket ports opened with sock_par("listen"). The -A option is followed by an IP address with an optional bit mask argument, using the standard CIDR (Classless Inter-Domain Routing) notation. Multiple -A options are allowed. For example, the options -A 127.0.0.1 -A 192.168.1.0/24 would allow the localhost (127.0.0.1) and hosts in the 192.168.1.0 through 192.168.1.255 subnetwork to connect. If not given as a start-up option, all hosts are allowed to connect as before.

Expanded Globbing

Commands that support the metacharacters * (which matches any string) and ? (which matches any single character) now also support the [...] metacharacter pattern. Any string that contains the characters within the square brackets is matched. Two characters separated by a hyphen specify a range of characters that will match. An initial ^ negates the enclosed character set. The commands affected are lsdef, prdef, lscmd and syms, along with the optional search-string file positioning argument of dofile() and qdofile().

Omega-For-Theta Four-Circle Kappa Configuration

The geo_fourc.c code now allows the motor traditionally called th (for theta) to be given the mnemonic om (for omega). Previously, using the om mnemonic would activate a special configuration named omega-type, where the tth and om motors are mechanically coupled. Now, if there is an om motor, no th motor, and if the om motor has a non-standard optional parameter named "omega_for_theta" with a positive value, the standard four-circle configuration will be used. This new naming option is available for normal and kappa variations of the four circle. Note, though, the four-circle macros will still also use OMEGA in the traditional sense, that is, the value of om - tth / 2.

MACROS

New Fly Scans

spec now includes fly scan macros that take advantage of the enhanced hardware support for the Measurement Computing USB-CTR4/8 counter/timer. Fly scans use the counter/timer in multi-channel scaler (MCS) mode with the channel advance controlled by motor pulses from a continuously scanned motor, allowing each MCS counter bin to be associated with an accurate motor position. See the new flyscan help file for details. (The current version is considered a beta release of the macros.)

Updates To Standard Macros To Accommodate Fly Scans

A number of standard macros, including resume, _head, _scan_time and _loop, have been updated to accommodate the new fly scans.

Updates To disable/enable Macros

The disable_save() macro now returns the current state of disabled devices as an associative array. A new disable_restore() can use that array to restore the state. See the disable help file.

Plotting Macros Updated To Take Into Account Disabled Counters

Disabled counters are no longer included in the SCAN_COLS or SCAN_D arrays. The configuration of these arrays is updated at the start of each scan.

Fix For hklmesh Scans

A bug in the _hklmesh macro associated with the new array-based scan engine (see newscans.mac) where the _m[] array used by the _array_scan macro engine wasn't properly initialized has been fixed. (The _m[] array contains the motor numbers of the motors that are part of the current scan.)

Fix For surf abscan and abmesh

The abscan and abmesh macros used in the surf geometries were updated to use the new array-based scan engine that became the default for scan macros in spec release 6.04.01. Several bugs introduced at that time are now fixed. In particular, for several surf variations (namely ames, bl18b, cmc, harv, x19, x22 and x22b), not all motor positions were calculated for each point in the scans. For all surf variations, values written to the data file for HKL with abscan were not associated with the correct scan point. Also, with abmesh, the _m[] array was not properly initialized.

FIXES

Fixes For Server Hardware

The code for the server hardware feature has improved handling of out of sequence commands and of data transfer to and from the server. See the server_hdw help file for information on the server hardware feature.

Server Protects Against Non-null Terminated Strings From Clients

If a client sends a packet to a spec server where string data doesn't include a terminating null byte, the server will silently correct the incoming data.

Fix For Server Not Running Cleanup Macros On Remote Abort Message

An issue where a spec server sometimes did not run cleanup macros when receiving a remote abort message has been fixed. The abort message is sent by a spec client with the remote_par(host, "abort") command. That command sends a packet containing the SV_ABORT command code. To the server, receiving that command code is intended to be equivalent to typing a ^C at the spec server keyboard. Although previous spec releases would handle halting hardware with the SV_ABORT message, the full reset which includes running cleanup macros (if defined) such as cleanup_once and cleanup_always did not always occur.

Fix For decode() Crashes

A bug in the decode() function, where a string argument with unbalanced quotation marks could result in a program crash, has been fixed.

Fix For Small Memory Leak If eval() Action Doesn't Complete

A small memory leak associated with eval() commands that either exited on an error or were interrupted with ^C has been fixed.

Fixes For array_op() and data_anal() "i_<=_value" and i_>=_value" Commands

Very old bugs dating from the original implementations of the rarely used "i_<=_value" and i_>=_value" commands to both the array_op() and the (deprecated) data_anal() functions have been fixed. The return value for "i_<=_value" was one index too large for values falling between two points. The return value for "i_>=_value" was one index too large for values just equal to that of a data point.

Fix For edconf String Editing

A bug in the string editing features introduced in the edconf hardware configuration editor in spec release 6.06.03 has been fixed. With the bug, the commands ^A and ^E to initiate editing existing string values for non-standard optional parameters or the standard optional generic motor parameters would change the field to a random number.

Fix For Installation Of New Help Files Derived From Macro Source Files

An issue, where the help files created from macro files (currently vscan, cscan, disable and flyscan) were not installed, has been fixed.

HARDWARE

MCS Support Added To USB-CTR

spec now supports multi-channel scaling (MCS) functionality with the Measurement Computing USB-CTR4/8 timer/counters. New fly scan macros use the MCS capabilities. See the updated usbctr help file and the flyscan help file for details.

Update To Physik Instrumente E-712 Support

An issue with the support for the Physik Instrumente E-712 piezo controller where positions were limited by an integer overflow to +/- 2174 has been fixed.

Update To Compumotor 6K To Work With Parker Gem6K Models

The existing support for the Compumotor (now Parker Hannifin) 6K motor controller has been updated to work with the Gemini 6K models. In particular, if spec detects a Gem6K model, it will not send the AXSDEF command during the initial presence test, as that command is unsupported on the Gem6K.

Updates To MDrive Support

A couple of issues introduced with the updates to the Schneider Electric (previously IMS) MDrive motor support in spec release 6.04.05 have been fixed. In particular, unexpected messages seen when hitting limits no longer appear, and a bug where the motor_par() "read" and "uread" commands didn't return the appropriate strings has been fixed.