EPICS StreamDevice Documentation

What is StreamDevice?

StreamDevice is a generic EPICS device support for devices with a "byte stream" based communication interface. That means devices that can be controlled by sending and receiving strings (in the broadest sense, including non-printable characters and even null-bytes). Examples for this type of communication interface are serial line (RS-232, RS-485, ...), IEEE-488 (also known as GPIB or HP-IB), and TCP/IP. StreamDevice comes with an interface to asynDriver but can be extended to support other bus drivers.

If the device can be controlled with strings like "RF:FREQ 499.655 MHZ", StreamDevice can be used. How the strings exactly look like is defined in protocols. Formatting and interpretation of values is done with format converters similar to those known from the C functions printf() and scanf(). To support other formats, it is possible to write your own converters.

Each record with StreamDevice support runs one protocol to read or write its value. All protocols are defined in protocol files in plain ASCII text. No compiling is necessary to change a protocol or to support new devices. Protocols can be as simple as just one output string or can consist of many strings sent to and read from the device. However, a protocol is linear. That means it runs from start to end each time the record is processed. It does not provide loops or branches.

StreamDevice supports all standard records of EPICS base which can have device support. It is also possible to write support for new record types.

What is StreamDevice not?

It is not a programming language for a high-level application. It is, for example, not possible to write a complete scanning program in a protocol. Use other tools for that and use StreamDevice only for the primitive commands.

It is not a block oriented device support. It is not possible to send or receive huge blocks of data that contain many process variables distributed over many records.

Recommended Readings

IOC Application Developer's Guide (PDF)

EPICS Record Reference Manual


Next: Setup

Dirk Zimoch, 2006