asynDriver: Asynchronous Driver Support - Release Notes

June 13, 2006


Release 4-6

drvAsynIPPort/drvAsynSerialPort

Fixed NULL pointer dereference.

drvAsynIPPort

Previous versions of drvAsynIPPort.c (1.29 and earlier, asyn R4-5 and earlier) attempted to allow 2 things:
  1. Use an EPICS timer to time-out an I/O operation, such as send(), recv() and connect().
  2. Periodically check (every 5 seconds) during a long I/O operation to see if the operation should be cancelled.

Item 1) above was not really implemented because there is no portable robust way to abort a pending I/O operation. So the timer set a flag which was checked after the poll() was complete to see if the timeout had occured. This was not robust, because there were competing timers (timeout timer and poll) which could fire in the wrong order.

Item 2) was not implemented, because asyn has no mechanism to issue a cancel request to a driver which is blocked on an I/O operation.

Since neither of these mechanisms was working as designed, the driver has been re-written to simplify it. If one or both of these are to be implemented in the future the code as of version 1.29 should be used as the starting point.

If pasynUser->timeout < 0 an infinite timeout is now used.

Fixed bug so that ports connected with a file descriptor in pasynUser->reason execute code to set timeouts.

Fixed bug to return error if pasynCommon->connect is called when port already connected.

asynTrace

Added two new functions which are related to pasynTrace->print and pasynTrace->printIO the way vprintf is related to printf.

asynManager

Changed pasynManager->connectDevice for ports which have the properties autoConnect=1 and isConnected=0. In this case a request is queued to call asynCommon->connect for that port. This ensures that ports that have a pasynUser connected to them will report being connected even if no I/O has yet been done. Previously such ports reported a disconnected state until the first I/O or operation such as setTraceMask. This was confusing.

Clarify documentation on meaning of pasynUser->timeout. Previously there was no documented method of specifying an "infinite" timeout to a driver, and the meaning of timeout=0.0 was not defined. The new definitions are:

> 0.0 Wait for up to timeout seconds for the I/O to complete

= 0.0 Peform any I/O that can be done without blocking. Return timeout error if no I/O can be done without blocking.

< 0.0 Infinite timeout. Wait forever for I/O to complete.

devEpics

Fixed bugs with asynFloat64Average device support. The wrong interrupt function was being called, and UDF was not being cleared.

Release 4-5

memMalloc/memFree

memMalloc was allocating the amount of memory the caller requested rather than the amount required for the freeList. If memFree was called and the memory reallocated to a user requesting a larger size, memory corruption occured. This is fixed.

SyncIO routines

If the connect call fails the asynUser is no longer freed. Instead a message is put into asynUser.errorMessage. The caller must call disconnect in order to free the storage for the asynUser.

The SyncIO routines no longer call asynPrint if there is an error and there is a valid asynUser available. Rather they return an error message in pasynUser->errorMessage. The SyncIO*Once functions still call asynPrint for errors, because they do not have a way of returning an error message.

Serial, TCP/UDP/IP

Handle 0-length write requests.

TCP/UDP/IP

Added drvAsynIPServerPort to support TCP and UDP socket servers.

Added iocBoot/testIPServer to test TCP server support.

drvAsynIPPort now closes TCP sockets when remote system closes connection.

drvAsynIPPort connect function now uses pasynUser->reason as a file descriptor if it is > 0. This allows drvAsynIPServerPort to re-use asyn ports it creates.

Made drvAsynIPPort add null byte at end of input if there is room.

Made drvAsynIPPort:readRaw set eomReason to 0. It was not setting eomReason at all previously.

Serial

Made drvAsynSerialPort add null byte at end of input if there is room.

Made drvAsynSerialPort:readRaw set eomReason to 0. It was not setting eomReason at all previously.

Interfaces

Added asynCommonSyncIO for synchronous support of the asynCommon interface.

VME GPIB

Add delay loops to get these boards to work with faster VME CPU modules.

Release 4-4

VXI11

Better support was provided for VXI-11.3 controllers, i.e. talking directly to an ethernet port on an instrument. In particular a TDS3054B was tested.

WARNING: The VXI-11.1 ansd VXI-11.3 standards do NOT allow access to GPIB lines, i.e. conmmands like Untalk/Unlisten are not possible. The previous support issued these commands after each read or write. Some really old GPIB devices may fail. If so the device specific code must be modified to sent these commands separately.

win32

Changes were made to allow asyn to build on native Windows (win32-x86) architecture.

There are two asyn components that do not yet work on win32-x86.

  1. Local serial ports. The asyn uses the "termios" API for serial ports, and termios is not available for native Windows.
  2. VXI-11. The asyn VXI-11 support uses the Sun XDR API, which is not available for native Windows.

Users who want to use local serial ports or VXI-11 on Windows can use the Cygwin EPICS build (cygwin-x86).

devGpib: devGpibConvertExample

An example of how to implement convert routines for devGpib support modules is available in asyn/devGpib/devGpibConvertExample.c

devAsynOctet.c

The UDF field is now set FALSE when the VAL field is updated.

Release 4-3

asynManager

cancelInterruptUser

The cancelInterruptUser methods of all interfaces has been changed from

    asynStatus (*cancelInterruptUser)(void *registrarPvt, asynUser *pasynUser);
to
    asynStatus (*cancelInterruptUser)(void *drvPvt, asynUser *pasynUser,
                                      void *registrarPvt);

asynTrace

The length and size arguments now have type size_t.

devGpib

Several improvements were made to devSupportGpib.c. All changes should be transparent to code that uses devGpib.

asynOctetBase

The maxchars argument to callInterruptUsers has been removed.

asynReport

The filename argument has been removed.

devAsynFloat64

For asynAoFloat64 it now uses oval instead of val.

asynFloat64Array, asynInt32Array, asynOctet, asynOctetSyncIO

All length and size arguments now have type size_t.

asynFloat64SyncIO, asynInt32SyncIO, asynOctetSyncIO, and asynUInt32DigitalSyncIO

These all use lockPort/unlockPort instead of queueRequest.

Release 4-2-1

devAsynFloat64

Device support was not returning 2 (do not convert) for ai records when it should. This meant that the VAL field was being set back to 0 by the record after device support wrote to it. This bug is fixed.

asynRecord

The record sometimes did not read the current input and output EOS values from the driver when it connected. This bug is fixed.

Release 4-2

Acknowledgement

Yevgeny A. Gusev has again reported some hard to recognize bugs. He must have spent many hours looking at the code. His extra set of very good eyes are much appreciated!!. He also thought of the way to handle support that uses one addressing scheme but wants to use support that has a different addressing scheme. For example support for mult-drop serial that wants to use the standard serial support

Release 4-2

asynInterposeEos

If read reads maxchars, it forced the last character to be 0 and returned asynOverflow if it wasn't. This is fixed.

drvAsynSerialPort,drvAsynIPPort - Error reporting

These did not properly set an error message in asynUser.errorMessage when they returned asynError. This is fixed.

drvAsynSerialPort - serial port options

Changes were made to the way serial port options are handled.

asynRecord - Serial Port Options

This has a new option to set Modem Control.

Release 4-1

The only code change was to fix the drvAsynIPPort and drvAsynSerialPort segmentation faults on cygwin-x86.

Release 4-0

Incompatible Changes.

APOLOGY: Many interfaces have changed since release 3-3. This is the reason this release is called 4-0.

New Features

Release 3-3

Incompatible Changes.

Major New Features

asynDriver.h

The following changes have been made

asynRecord

Removed the GOPT field. This is no longer necessary because the port options are automatically read whenever connecting to a port. "special" requests are now queued without changing the state of the record, using the new duplicateAsynUser, memMalloc(), and memFree() methods. This means that there is no longer a possibility of a special request being rejected because the record is busy. It is no longer possible to cancel a special request.

asynGpib

devSupportGpib

drvAsynSerialPortFlush

Flushes input only.

asynInterposeEOS

The EOS read method now calls the low-level read method only once and returns as many characters as the low-level method supplies. This makes the EOS read semantics match those of the low-level serial and IP drivers.

drvVxi11

vxi11SetRpcTimeout - now handles fractions of a second properly

asynRecord

A new field has beem added, AQR (Abort Queue Request)

The semantics have been changed as follows: process is responsible for all and only for I/O operations. Only I/O operations cause the alarm status and severity to change. Special is responsible for all other operations performed by asynRecord.

Release 3-2

Changed and obsolete features

Major New Features

Release 3-1

Major New Features

Changed and obsolete features


Release 2-1

Major New Features

Changed and obsolete features


Release 1-2


Release 1-1

This release includes support for the following:

Modifications include:

  1. Added asynSetPortOption and asynGetPortOption to manipulate port options.
  2. Changed serial support to use asynSetPortOption/asynGetPortOption.
  3. Added devGPIB GPIBCVTIO commmand type to allow custom conversion routine to perform all I/O operations.
  4. Changed rules for return value from devGPIB custom conversion routines.
  5. Added dbior support.
  6. Changed devGPIB to no longer cache EOS.

Release 1-0alpha2

Support Provided in addition to asynDriver and asynGpib

Future Support

Testing

The vxi11 support has been tested on the following platforms: Solaris, Linux (redhat 9), Darwin, Windows XP (Cygwin), and vxWorks. It has been tested with the following vxi11 controllers:

The generic serial support has been tested with the following:

Two Device Support modules have been converted from the 3.13 gpib support: DG535 and TDS3014B Scope.