spec

Software for Diffraction

changes

Highlights for spec release 6.08

January 23, 2020 - RELEASE 6.08.08

IMPROVEMENTS

Updated "sort" and New "merge" Options For array_op()

For a 2D array, the array_op() "sort" option will sort the array by rows. Previously, the option would sort a 2D array as if it were a 1D array and distribute the sorted elements in consecutive rows. Now the array will be sorted by rows, either by the value in the first column, or in the column specified by an optional argument.

A new "merge" option combines rows of an array where values in the same column in adjacent rows are the same or within a specified threshold. This feature can be used in combining overlapping scans.

See the arrays help file for more information.

Allow Up To Nine x11filt Windows

The number of allowed x11filt windows has been increased from five to nine.

New "text" Item For spec_menu() and ^G Command

A new "text" item is available to insert a block of text within the menu. A new ^G command will jump to the first item of the menu. See the spec_menu help file for details.

Improved Handling Of Write Errors To Sockets and Pipes

spec now does a better job in handling errors when writing to a socket or a pipe (to x11filt or data_pipe() processes) that has been closed at the other end.

Automatic Removal Of Unnecessary Quotes In prop_watch()

The prop_watch() property string for associative array elements should not contain quotes around the array index. spec will now automatically remove such quotes when registering the property with a spec server if the user has inadvertently included them.

splot Updates

The Python splot utility is now release 3.3.01. Changes include refreshed icons and stability improvements, and partial support for Python 3.

MACROS

New umoveE Macro

The standard energy macros now include a umoveE macro that has the same syntax as moveE but will display the monochromator motor positions and energy during the move. A new internal _updateE macro, an updated _update() macro and new _numE and mE[] global variables are part of the implementation.

Configurable Units For Energy Macros

The units for the standard energy macros, getE, setE, calcM, moveE, umoveE and Escan, can now be configured as either eV or keV. Previously, the units were fixed as keV. The value is stored in a new global variable, E_mult (for energy multiplier). A value of 1 corresponds to keV. A value of 1000 corresponds to eV. The units can be configured in the mstartup macro or by setting the appropriate value to E_mult.

New MCA Scan Macros

This spec distribution includes macros to perform detector-arm scans that take MCA data at a range of positions that provide full scan coverage at the resolution of the MCA pixels. Currently, the macros are not installed by default. See the file macros/mca_scans.mac in the spec distribution. Use mca_scan_setup to configure the macros mca_ascan and mca_dscan.

Fix For Internal sdata_plot() Macro For Column-Wise Arrays

The sdata_plot() internal macro that is called by splot and the other plotting macros will now work correctly with column-wise arrays. In declaring two-dimensional arrays, the first dimension is rows, the second is columns. By default, the "wise-ness" is set based on which dimension is bigger. For example, if there are more rows than columns, the array will be row wise. However, array_op() options can be used to force the "wise-ness". The standard macros set the data array, SCAN_D, to be row wise. The macros that use SCAN_D are written accordingly. With this update, the splot macro will now also work with column-wise arrays.

FIXES

Old sscanf() Bug Fixed

The oldest bug on record, dating to the introduction of the sscanf() function in spec release 3.00.06 in December 1993, has been fixed. The issue was that a minus sign immediately following integer digits would make the scanned value negative. For example, the following statement:

{ sscanf("123-xyz", "%d-%s", num, str); p num, str }

would previously show this incorrect output:

-123 xyz

With the fix the correct result:

123 xyz

is produced.

Fix For sixc Fresh Start Pseudo Motor Calculation

A missed divide-by-zero check in the recently added pseudo motor code for the sixc geometry that resulted in motor discrepancy messages on a fresh start before the geometry parameters used in the calculation had been set has been fixed.

HARDWARE

Support For Modbus

spec now includes preliminary support for Modbus TCP, RTU and ASCII protocols via the fbus_put() and fbus_get() functions. See the new fbus help file for details.

Fix For Struck SIS3820 Monitor Preset Channel

A bug dating from the original support for the Struck SIS3820 32-channel counter/timer where none of the upper 16 channels would work as a monitor preset channel has been fixed.

Preliminary Support For Dectris Eiger

Preliminary support for the Dectris Eiger detector is included via the server hardware feature. See the eiger help file for more information.

October 25, 2019 - RELEASE 6.08.07

IMPROVEMENTS

New Option For split()

If the optional third argument to the built-in split() function is the null string, "", the first argument will be split at each character. See the split() entry in the funcs help file.

New Features and Fixes For spec_menu()

The "@" key can now be used with "bit" items, but only for retrieving a value. Initial values are still set through the modes argument. In addition, the choices key for the "toggle" item can now take more than two choices. Also, an issue where the "@" key might not be effective when used for the same item that had "value" or "svalue" keys, depending on the order in which the items appeared in the menu array, has been fixed. See the spec_menu help file.

Updated Defaults For x11filt

The default settings for x11filt have been switched to use a retained pixmap rather than backing store. These options are for two different methods of having the window redrawn when exposed. The backing store setting was the original default as it required less memory and CPU cycles, which was a valid consideration in the early days of spec. However, the retained pixmap method is more reliable. Not all of the many window managers that now exist implement backing store support in a way that always works with the code in x11filt. See the x11 help file.

Install Creates a SPECD/macros Directory

The standard installation will now create a directory called macros in SPECD (usually /usr/local/lib/spec.d). If a file or directory by that name already exists, it is not an error. Existing files will not be removed. In addition, the global variable DO_DIR, which can be a colon-separated list of directories in which to look for command files, will be initialized with that path when starting fresh. The hardware servers that include command files containing macro definitions will have those files installed in the new macros directory when a make install is run in the spec distribution servers directory.

FIXES

Fix For Start-Up -T Flag

A bug, introduced in spec release 6.06.01 (May 2017), where the state file associated with the "fake" tty argument to the -T start-up option was not used when writing the state file, has been fixed. The designated "fake" tty state file will now be used to both initialize the state and save the state on exit (or with the savstate command).

Fix For sixc setlen Macro

A recently introduced bug for the sixc geometry macros, where the setlen macro didn't work for the "pseudo-gamma" configuration that has gamR and gamT motors, has been fixed.

Fix For Server Hardware Instability

An issue with memory allocation for server hardware arguments has been fixed. The symptoms could include the server failing to start and/or memory corruption.

Fix For Updated MCAS and CCDS Meaning

spec release 6.08.05 revised the meaning for the MCAS and CCDS global variables to facilitate looping through all configured devices. With that release, the values are set to one greater than the highest numbered device, rather than to the number of devices. That accommodates non-consecutive device numbering. In that recent release, the value was still 1 if there were no devices configured. With this release, if there are no associated devices, the value of the respective variable will be zero.

HARDWARE

New Server Hardware Support For greateyes Cameras

This spec release includes initial code, macros and a help file for the greateyes cameras, which can be used over USB or ethernet. The files are in the servers subdirectory of the spec distribution. See the greateyes help file for details.

New "goodbye" Message For Server Hardware

The server hardware protocol now includes spec sending a "goodbye" message before disconnecting the socket to the server. See the server_hdw help file for details.

Subaddress Allowed For Image Devices

The same subaddress syntax available with the mca_spar(), mca_sget() and mca_sput() functions can now be used with image_par(), image_get() and image_put(). The only built-in hardware support that current makes use of the subaddress for image devices is the server hardware pseudo device. The subaddresses, when used, will be passed to the associated server. For the listed functions, the address argument may be given as 0.0, 0.1, 0.2, ..., where the first digit is the unit number from the config file, and the digit right of the decimal point is the subaddress. The argument can be entered as number or a string. The syntax "0:0", "0:1", "0:2", ..., is also recognized, where the arguments for each module are strings.

Updates For Delta Tau Motor Controller Support

The built-in support for the Delta Tau motor controllers has been updated. spec no longer programs values for motor parameters Ix15, Ix19 and Ix21. Values for these I variables can be set as nonstandard optional motor parameters in the config file. Otherwise, values in controller memory will be used. spec now allows a zero acceleration time to be programmed as motor controller parameter Ix20 for this controller, in which case it is important to insure the Ix21 S-curve time parameter has a non-zero value. In addition, if the standard optional motor parameter "home_method" is set, spec will send that string when doing a home search.

spec now recognizes a nonstandard optional controller parameter named "init_sequence". Its value can be one or more commands separated by semicolons. Each command will be sent to the controller during hardware configuration.

Also, new nonstandard optional motor parameters "nudge_time" and "nudge_sequence" are available to deal with avoiding fatal following errors when moving a motor that hasn't moved recently. The parameter "nudge_time" can be set to the number of seconds between moves before spec will send nudge commands before moving the motor. The parameter "nudge_sequence" is a string containing a semicolon-delimited list of commands to send before starting the move to the destination.

Fix For Possible epics_get() Retry Anomaly

A possible crash when spec retries epics_get() commands after a timeout when a connection has dropped has been fixed.

September 3, 2019 - RELEASE 6.08.06

IMPROVEMENTS

More Robust State File

When saving the state information either at exit or with the savstate command, spec will now fully write out a new state file with a name ending in ".new" before renaming the new file to replace the the previous. In addition, the previous state file will be maintained with a suffix ".old". If on start up, the standard state file is missing or corrupted, spec will attempt to read from a ".new" file, if it exists. If it doesn't, spec will try to read from the ".old" file. The same procedure is followed for the command-line history file. These changes should greatly reduce the already small chances of a corrupt state file forcing spec to start fresh. A state file could become corrupted if a computer is shutdown or spec is killed while the state file was in the process of being written.

FIXES

Fix For sixc Pseudo Motors With Tracking Off

When tracking is off for calculational pseudo motors, moving the pseudo motor should not change the positions of the associated real motors and vice versa. The sixc geometry code has been fixed to make sure that is the case.

HARDWARE

Fix For Enabling Multiple PCI Boards Of the Same Type

Some Linux systems are configured so that access to PCI board I/O ports and memory registers is disabled by default on boot with the expectation that kernel drivers will enable access if the PCI board is to be used. spec driverless support for PCI boards also enables access. A bug that only enabled access to the first board when multiple boards of the same type were installed has been fixed.

Support For SPring-8 MADOCA Request Server Layer

The SPring-8 "equipment manager" RPC layer support added to spec in 1999 has been updated to also support the "request server" socket layer. In addition, the naming has been changed to MADOCA to reflect the naming conventions used at SPring-8. The built-in em_io() function has been renamed madoca_io(). An em_io is now included in the standard macros (defined simply as madoca_io) to maintain backward compatibility with existing local macros. See the madoca help file (formerly named equipman) for details.

MACROS

New save_state Macro To Aid In Diagnostics

The new standard macro save_state invokes the utility show_state (included with the spec package) to write the current state file contents along with config and settings file information, all in human readable format, to either the file specified by an optional argument or to a file beginning with the name /tmp/state. Such a file can be useful at CSS for diagnosing or debugging user issues.

June 16, 2019 - RELEASE 6.08.05

IMPROVEMENTS

New tolower() and toupper() Functions

New string manipulation functions tolower() and toupper() are available to change the case of strings. Optional arguments provide a character count and starting position. See the funcs help file for details.

New Position Argument To asc()

The asc() function, which returns the ASCII value of the first character of the string argument, now accepts an optional second argument to specify a position within the string rather than the first character. Positions are counted from 1. See the funcs help file for details.

New "every" Option to array_op()

A new array_op() "every" option returns every n-th element of a data array. See the arrays help file for details.

Improvements to spec_menu()

A new "alist" key allows selecting multiple items from a list. The list of items must be passed as an associative array. A new "bracket" key allows specifying the bracket characters that indicate selections made with the "list" and "alist" keys. All the descriptive text can now include special text formatting strings for bold, underline, etc. See the spec_menu help file for details.

The show_state Utility Will Attempt To Find Associated Files

The show_state utility presents information not only from the user state file but also from the associated history, config and settings files. When invoked with an explicit state file argument, the locations of the other files are not necessarily known, so the command output doesn't include those elements. With this release of spec, if the file argument to show_state includes the userfiles/ path component, the command will try to locate the associated files based on that path. That is, if the history file is in the same directory as the state file and if the config and settings files are at the same level as userfiles, show_state will find them.

Interruptible Socket Connect

spec uses a four-second timeout when attempting to connect to a socket. That timeout can now be interrupted with a ^C, both with user-level socket commands and hardware initialization from the config file. While initializing hardware from the config file, processing will continue as if the attempt to open the socket failed. During the user-level socket calls, the ^C will jump back to the command prompt, as usual.

Additional Check For Socket Lost Connection

spec will now take notice when a socket connection has been dropped by a server when doing a read of an associated socket. Some spec hardware support recognizes a lost connection and will attempt to reconnect. This check is an addition to the existing tests for lost connections.

Updated Meaning For MCAS and CCDS Global Variables

Previously, the values of the built-in MCAS and CCDS global variables were set to the number of 1D and 2D devices in the hardware config file. If all device numbers were used, one could loop from zero to the value of the corresponding global variable to access all configured devices. If an intermediate device number was unused, such a loop would not address all the devices. The values of MCAS and CCDS are now set to one greater than the highest device number to facilitate such loops.

Updated Behavior For Certain mca_spar() and image_par() Commands

The options "controller", "responsive" and "device_id" to the mca_spar() and image_par() commands will no longer print an error message if the device is unconfigured. For unconfigured devices, the functions will return the string "Unconfigured" for "controller", the value 0 for "responsive" and the value -1 for "device_id". In each case, HDW_ERR will be set to the value 6, which corresponds to trying to access unconfigured hardware. (See the HDW_ERR help file.) Note, that the "unusable" option to the commands still returns a zero or one to indicate whether a given device is available and usable and also does not print a message.

HARDWARE

Macro Hardware Timer/Counter Improvement

If no channels are active for a particular macro hardware timer/counter controller due to all configured channels being unresponsive or disabled, spec will no longer send the "prestart_all" and "preread_all" commands to the associated _cmd macro.

Fix For Struck SIS3820 Reset

Previously spec issued a reset command before programming the Struck SIS3820 for each counting interval. The reset produced an undesirable short spike on the enable signal. The reset command has been replaced by appropriate commands to prepare the device for a new counting cycle.

New MCS Support For Struck SIS3820

spec now supports the multi-channel scaling (MCS) capabilities of the Struck SIS3820 VME Scaler. See the sis3820 help file. spec flyscan macros have been updated to include support for the SIS3820. See the updated flyscan help file.

Fix For USB-CTR MCS Pass Sums

A bug with the recently added support for multi-channel scaling (MCS) with the Measurement Computing USB-CTR counter/timer, where the sum of channels accumulated over multiple MCS passes was not done correctly, has been fixed. Note that for fly scans, which were the impetus for adding the MCS capability, only one pass is made, so the bug was not an issue.

Fix For Halting Trinamic TMCL Limit Searches

An issue, where a ^C or stop() command wouldn't stop a chg_dial() "lim+" or "lim-" search on a Trinamic TMCL motor controller, has been fixed.

Fix For Possible Crash When Reading From a spec Server

Under some conditions, a timeout while attempting to read a message from a spec server could cause a segmentation fault. That issue is fixed.

MACROS

Improved Display With Updated Counting During Scans

The screen display of updated counting during scans will no longer round significant figures of integer counter readings.

New Options For uct Display

The setshow macro for setting certain parameters for displaying motor and counter information now has two additional options for configuring the updated counting display associated with the uct macro. The counter mnemonics can now be displayed. A blank line can now be inserted between each set of counter rows.

Updated flyscan Macros

The flyscan macros now support the Struck SIS3820 VME Scaler as the MCS device, along with the existing support for the Measurement Computing USB-CTR. In addition, the optional normalization function is more robust with respect to normalization channels that might contain zeroes.

FIXES

No Longer Limit Capabilities If root User

spec release 6.05.01 replaced the set-userid-root method of allowing the spec executable access to privileged I/O (such as PCI card registers for hardware control) with use of the Linux capabilities facility. Privileges are only enabled briefly around the calls that gain access. After gaining access, the code releases the capabilities, even if the real user ID was the all-privileged root user. One of the needed capabilities is "dac override" for discretionary access control, i.e., file permissions. When spec disabled that capability, even the root user would lose access to permission-protected files and directories. With this spec release, if the real user ID is that of root, the executable does not manipulate the Linux capabilities at all. Note, CSS does not recommend running spec or even a shell as the root user as normal operating procedure due to the possibility of doing catastrophic damage to the operating system with a single mistyped command.

Fix For Possible Buffer Overflow In array_dump()

Previously, if the optional element format for the array_dump() command specified a too-large format width (for example "%5000g"), there could be a buffer overflow leading to a subsequent crash. That bug has been fixed in this release. In addition, the field width for a single element is now limited to 4096 characters.

edconf String Editing Fixes

An issue with the edconf hardware configuration editor introduced in spec release 6.08.02, where the delete character and the delete to the beginning of the line character when entered in the middle of a string would erase to the end of the string, has been fixed.

edconf Default Limits Fix

Traditionally, when motors were added to the config file using the edconf hardware configuration editor, default values for limits were set to -180 and 180. Recent changes to implement 64-bit motor positions inadvertently caused the default limit values to be set to zero for newly added motors. This release restores the traditional behavior.

March 27, 2019 - RELEASE 6.08.04

FIXES

Another Fix For Escan fixQ Mode

When the Escan macro was rewritten to use the new array-based scan engine in spec release 6.03.08, the implicit calculation of H, K and L from current motor positions via the scan_head call was overlooked, with the result that if geometry motors were moved prior to the Escan, the HKL used in fixQ mode would not necessarily be the HKL associated with the motor positions at the start of the scan. This spec release includes an updated Escan macro that restores the traditional and expected behavior by including an explicit calcHKL call.

Fix For eval2() Replacement

The update in spec release 6.08.02 that replaced the now deprecated eval2() function with a call of eval() with the new optional flags "reset_on_error, local_visible" was mishandled. The eval2() call was replaced with a macro function called eval_arg(). However, macro functions always hide local variables defined outside the macro function, thus defeating the purpose of the "local_visible" flag. This spec release replaces the macro function with a direct call of eval() that includes the flags "reset, local" (the alternative short form names).

March 13, 2019 - RELEASE 6.08.03

IMPROVEMENTS

New "prestatus_all" and "preread_all" Commands For Macro Hardware Counters

To accommodate macro hardware counter configurations where hardware reads multiple channels with a single command, the macro hardware facility now implements "prestatus_all" and "preread_all" commands that can be used to create simpler macro hardware implementations. See the mac_hdw help file for details.

Additional Enhancements For edconf

The ^F and ^B keys can now be used to page through the nonstandard optional parameters screens of motor controllers and counter/timers. In addition, a new help screen describes the value-editing special commands.

Updates To New sixc Geometry Configurations

The new six-circle geometry configurations introduced in spec release 6.07.07 have been updated in order to provide more fine-tuned control over the pseudo motor tracking. See the sixc help file for details.

Support For %a, %A and %F Formatting In printf() Functions

The printf(), fprintf() and sprintf() built-in functions now recognize the %a and %A conversion specifiers, which print float and double values using a hexadecimal notation including an exponent. The %F format is identical to %f and is included for compatibility with the standard C library syntax. See a UNIX/Linux manual page for the printf() function for details on the conversions.

HARDWARE

Updates For Trinamic TMCL Controllers

spec will now, by default, automatically check for a power cycle on the Trinamic TMCL controllers and will restore positions and motion parameters if needed. In addition, reading the controller is more robust, with an automatic retry of commands that have a checksum error in the reply. Also, if the "check_interval" optional parameter is set to -1, power-cycle detection will be disabled. See the tmcl help file for details.

New ANC150 and Updated ANC300 Support

Support for the Attocube ANC300 piezo controller has been updated for more robust error handling and to display estimated positions during updated moves, based on the step frequency and elapsed time. When a move is aborted, spec will estimate the current position at the point that the move was halted. In addition, the configured slew rate will be used to program the step frequency (using the controller's setf command). Support for the similar Attocube ANC150 has also been added to spec (although that model controller is out of production). See the new anc help file for more information.

Updated Mythen Support

spec can now load the user-defined flatfield arrays supported by Mythen firmware 4.1.0. The mca_par("flatfield") command now takes options of either a spec data array or a file that contains the array. In addition, a new "flatfield_slot" command can be used to specify which user-defined array to use. See the mythen help file for details.

Fix For phyMOTION Module Numbering

An issue with the Phytron phyMOTION support, where motor controllers installed to the right of any other module types (power supplies, I/O modules) in a phyMOTION crate were not correctly addressed, has been fixed.

Interruptible Firmware Load With USB-CTR

The Measurement Computing USB-CTR counter/timer requires a firmware upload whenever the device is powered up. It takes almost 15 seconds to send the firmware to the device. The loading process can now be interrupted with a ^C. The firmware will still need to be loaded in order to use the device, but one will not be stuck waiting if there is something else that needs to be done first.

MACROS

Fix To Reset Plotting Parameters With Disabled Counters

An issue associated with plotting when counters have been disabled has been fixed. The plotselect (or similar counters) macro assigns a value to the PL_Y1 global variable that points to the column of interest in the SCAN_D data array for plotting and analysis. If counters are disabled or enabled after the value is assigned, the columns in SCAN_D may no longer match the column chosen for PL_Y1. The scan_data_init() macro, called after acquiring (but before saving) the first point of each scan, now recalculates PL_Y1 taking into account the currently enabled counters.

January 17, 2019 - RELEASE 6.08.02

FIXES

Buffer Management Fix

An issue, where under certain conditions a "Can't get a big memory buffer" message would be displayed, sometimes followed by a segmentation fault, has been fixed. The issue was associated with eval() calls of certain functions with particular argument types. The error could also occur when a spec server executed commands from a client, as the same internal code is used.

Fix For Tsuji Model UPM4C Configuration

A bug, where spec mistook the configuration of a Tsuji Model UPM4C as a PM4C, has been fixed.

Fix For edconf Anomalies

A few minor display and data entry glitches in the edconf configuration editor have been fixed.

December 31, 2018 - RELEASE 6.08.01

IMPROVEMENTS

Internal Type of Motor Positions Now 64 Bits

The spec code base has been updated to switch the storage type of motor positions from 32-bit integers to 64-bit integers. Such a change requires an update to the settings file binary format, which has been accomplished in a completely backward compatible manner. Saved position magnitudes greater than 32 bits will be truncated to 32 bits if the settings file is read by an earlier spec release.

Updated settings File Format

For over thirty years, the settings file stored motor positions as 32-bit integers, reflecting the storage type within spec. This spec release introduces an extended format for the settings file to accommodate 64-bit positions while preserving backward compatibility.

The settings files saves motor parameters that are changed during a spec session and is updated whenever any of the parameters are changed, for example, at the end of a move or if the limits or offsets are adjusted.

The long-time settings file data structure saves values for motors in consecutive chunks that are 24 bytes long laid out as follows (where s32_t is a 32-bit signed integer):

struct  sav_mot {
  s32_t   sm_pos;         /* Current position */
  float   sm_off;         /* Current user/dial offset */
  double  sm_low;         /* Software low limit */
  double  sm_high;        /* Software high limit */
};

spec has a compiled-in limit of 320 motors for the settings file. The first 320 times 24 bytes of the new format settings file has the same information and format as before. That occupies exactly 512 bytes less than 8192 bytes. spec now uses that last 512 bytes of the 8K page for a header. Starting on the second 8K page, all four motor values are saved in consecutive 32-byte long data structures formatted as follows:

struct  sav_mot_d {
  s64_t   sm_pos;         /* Current position */
  double  sm_off;         /* Current user/dial offset */
  double  sm_low;         /* Software low limit */
  double  sm_high;        /* Software high limit */
};

Both spec and the edconf configuration editor now write and read motor settings in both locations. When reading a settings file, the code sorts out whether the data was written using the version 1 or version 2 format and uses the appropriate positions. See the spec distribution files settings_file.h for details on the format, including the header definition. See the config/set2asc.c source code for an example of how to test which settings file version was used.

A settings file saved with the new format will not cause issues with older versions of spec or edconf, other than having 64-bit motor positions (if there are any) truncated to 32 bits. An old format settings file will be perfectly understood by new versions of spec and edconf.

New Options To eval()

The eval() function now recognizes optional arguments "quiet", "reset_on_error" (or "reset") and "local_visible" (or "local"). The "quiet" argument suppresses the display of error messages associated with the eval() command on the screen. The "reset_on_error" option causes syntax errors and the like to reset to the command prompt. The "local_visible" argument causes eval() to have the same property as the now deprecated eval2() function, in that local variables defined outside the eval() call are visible to the command being executed within the argument string. Type h eval at the spec prompt for details.

Page Through MCA/Image Optional Parameters With edconf

The edconf hardware configuration editor (usually invoked via the config macro) now allows paging through MCA and image device optional parameter screens (reached via the p command) using the page forward (^F) and page backward (^B) commands. In addition the ^G command jumps to the parameter screen for the first device.

More Consistent Setting Of HDW_ERR With mca_par() and image_par()

Previously, some hardware errors that occurred in the device dependent code reached through the mca_par() and image_par() calls didn't set HDW_ERR. That issue is addressed in this release.

Updates To counter_par() Error Handling

The counter_par() function will now consistently return a -1 value if there is an error in the device dependent code. In addition, HDW_ERR is set for such errors. Note, since -1 may be an allowed value for some parameters, it is more robust to check for errors by looking at the value of HDW_ERR after a call to counter_par().

HARDWARE

Select Motor Controller Support Now Uses 64-Bit Resolution

Support for macro hardware motors, spec server motors, and the EPICS motor record has been updated to use the 64-bit resolution for motor positions available in this spec release.

Updates For CLS EPICS Motor Record

In addition to using 64-bit resolution for motor positions, the support for the CLS EPICS motor record contains a fix for a scaling issue. In addition, process variable names generated from motor numbers are now always at least two digits with a leading zero for motor numbers 0 through 9.

Initial Support For SmarAct MCS2 Controllers

This spec release supports the SmarAct MCS2 motor controllers. These controllers use a completely new protocol and syntax compared to the previously supported SmarAct models. The support for these controllers uses the new 64-bit resolution for motor positions. Currently, only the ethernet interface with closed-loop mode is supported. See the mcs2 help file for details.

Fix For EPICS Motor Soft Limits

An issue where the spec soft motor limits didn't properly account for backlash set within the EPICS motor record has been fixed.

Fix For New EPICS Scaler "timestamp" Option

A bug that prevented the counter_par() "timestamp" option introduced in the previous release from working for EPICS scaler counters has been fixed.

MACROS

Replace eval2() With eval_arg()

All 100+ calls of eval2() in the standard macros have been replaced with eval_arg() calls. The eval_arg() macro is a new standard macro defined as:

def eval_arg(s) '{ return(eval(s, "reset_on_error, local_visible")) }'

The "local_visible" option invokes the functionality of the now deprecated eval2(). The option allows the eval() call to see local variables defined outside the function call. The "reset_on_error" option addresses an issue associated with the relatively recent introduction of eval() in the standard macros. Using eval() allows expressions and variables as macro arguments. Until this release, the eval() function did not reset to command level if there were syntax errors in the arguments (for example, typing ,01 instead of .01). The "reset_on_error" option causes such errors to reset to command level, restoring the traditional behavior.

FIXES

Fix For Possible Crash With ser_get(), sock_get(), gpib_get() and vxi11_get()

A very old bug that became an issue with unrelated changes made in release 6.06.01, where spec could crash on some platforms when the ser_get(), sock_get(), gpib_get() or vxi11_get() functions were called with an optional argument ("byte", "short", "long_swap", etc.) to read a single binary number, has been fixed.

Fix For HDW_ERR With Successful motor_par()

A bug where the global HDW_ERR symbol was set to "generic error" on successful calls of motor_par() has been fixed. See the HDW_ERR help file for details on the HDW_ERR feature.

Fix For ^C Interrupt While Waiting For Unresponsive DP5/PX5/MCA8000D

The spec support for the Amptek DP5/PX5/MCA8000D accommodates the fifteen second reconnect timeout in the device firmware, but allows the user to ^C out of the wait during hardware configuration. A bug, where a ^C typed during the reconnect timeout on a reconfig call made while spec was running would subsequently disable ^C altogether, has been fixed.

Fix For Process Accounting With splot

A bug, where if the Python splot utility exited for any reason spec did not clean up spec's process accounting table, has been fixed. Previously, one might have seen a "Too many processes for spec" message after that happened sixty or so times.

Fix For Internal Process Creation Error

A bug, where if spec's internal code failed to create a new process (particularly when using the unix() command), pathological behavior occurred, such as run away CPU usage or spec killing all of the user's processes, has been fixed.

Fix For readline Key Binding

An old bug in a key-binding call in spec (but only when linked with the readline command line editing library -- not the default libedit library included with the spec distribution) bound the circumflex key (^) to the reverse incremental search command. That bug is fixed in this release. The behavior can be fixed when running older releases of spec by putting the line:

"^": self-insert

in a file named ~/.spec_keys. See spec's readline help file and the official readline documentation for further details.

Assorted splot Fixes And Enhancements

The Python splot utility included with spec is updated to the current release. See the splot update notes in the distribution for details.