Using EPICS 3.13

1. Prerequisites

StreamDevice version 2.2 and higher can run on EPICS 3.13. However, this requires some preparation, because EPICS 3.13 is missing some libraries and header files. Also asynDriver needs to be modified to compile with EPICS 3.13. Due to the limitations of EPICS 3.13, you can build streamDevice only for vxWorks systems.

Of course, you need an installation of EPICS 3.13. I guess you already have that, otherwhise you would want to install StreamDevice on EPICS 3.14. I have tested StreamDevice with EPICS versions 3.13.7 up to 3.13.10 with vxWorks 5.3.1 and 5.5 on a ppc604 processor.

Download my compatibility package, asynDriver version 4-3 or higher, and my configure patches.

2. Build the Compatibility Package

Unpack compat-1-0.tgz in the <top> directory of your application build area. (Please refer to the EPICS IOC Software Configuration Management document.)

Change to the compat directory and run make. This installs many EPICS 3.14-style header files and a small library (compatLib).

3. Build the asynDriver Library

Unpack the asynDriver package and change to its top directory.

Unpack configure.tgz here. This will modify files in the configure directory. Change to the configure directory and edit CONFIG_APP. Set COMPAT=... to the <top> directory where you have installed the compatibility package before. (This patch might also allow you to compile other 3.14-style drivers for 3.13. It has absolutely no effect if you use EPICS 3.14.)

Edit RELEASE and comment out IPAC=... (unless you have the ipac package and somehow made it compatible to EPICS 3.13). Set EPICS_BASE to your EPICS 3.13 installation.

Run make in the configure directory.

Change to ../asyn/devGpib and edit devGpib.h and devSupportGpib.c. Change all occurrences of static gDset to gDset.

Go one directory up (to asyn) and run make twice! (The first run will just create Makefile.Vx.) Ignore all compiler warnings.

Do not try to build the test applications. It will not work.

4. Build the StreamDevice Library

Go to the <top> directory of your application build area.

Edit config/RELEASE and add the variable ASYN. Set it to the location of the asynDriver installation. Also set the COMPAT variable to the location of the compatibility package. Run make in the config directory.

Unpack the StreamDevice package in your <top> directory. Change to the newly created StreamDevice directory and run make.

5. Build an Application

To use StreamDevice, your application must be built with the asyn, stream, and compat libraries and must load asyn.dbd and stream.dbd. Also, as the stream library contains C++ code, the application must be munched. Therefore, include $(TOP)/config/RULES.munch. (Put your application in the same <top> as the StreamDevice installation.)

Include the following lines in your Makefile.Vx:

LDLIBS += $(COMPAT_BIN)/compatLib
LDLIBS += $(ASYN_BIN)/asynLib
LDLIBS += $(INSTALL_BIN)/streamLib

include $(TOP)/config/RULES.munch

Include the following lines in your xxxAppInclude.dbd file to use stream and asyn (you also need a base.dbd):

include "base.dbd"
include "stream.dbd"
include "asyn.dbd"

You can find an example application in the streamApp subdirectory.

6. The Startup Script

StreamDevice is based on protocol files. To tell StreamDevice where to search for protocol files, set the environment variable STREAM_PROTOCOL_PATH to a list of directories to search. Directories are separated by :. The default value is STREAM_PROTOCOL_PATH=., i.e. the current directory.

Also configure the buses (in asynDriver terms: ports) you want to use with StreamDevice. You can give the buses any name you want, like COM1 or socket, but I recommend to use names related to the connected device.

Example:

A power supply with serial communication (9600 baud, 8N1) is connected to /dev/ttyS1. The name of the power supply is PS1. Protocol files are either in the current working directory or in the ../protocols directory.

Then the startup script must contain lines like this:

ld < iocCore
ld < streamApp.munch
dbLoadDatabase ("streamApp.dbd")

putenv ("STREAM_PROTOCOL_PATH=.:../protocols")

drvAsynSerialPortConfigure ("PS1","/dev/ttyS1")
asynSetOption ("PS1", 0, "baud", "9600")
asynSetOption ("PS1", 0, "bits", "8")
asynSetOption ("PS1", 0, "parity", "none")
asynSetOption ("PS1", 0, "stop", "1")

An alternative approach is to skip step 5 (do not build an application) and load all components explicitely in the startup script. The STREAM_PROTOCOL_PATH variable can also be a vxWorks shell variable.

ld < iocCore
ld < compatLib
ld < asynLib
ld < streamLib.munch
dbLoadDatabase ("asyn.dbd")
dbLoadDatabase ("stream.dbd")

STREAM_PROTOCOL_PATH=".:../protocols"

drvAsynSerialPortConfigure ("PS1","/dev/ttyS1")
asynSetOption ("PS1", 0, "baud", "9600")
asynSetOption ("PS1", 0, "bits", "8")
asynSetOption ("PS1", 0, "parity", "none")
asynSetOption ("PS1", 0, "stop", "1")

7. Continue as with EPICS 3.14.