110 likes | 124 Views
StreamDevice 2.0 is a versatile character driver for EPICS 3.14, supporting new devices with modular design and user-defined functions for various I/O hardware and data formats. Protocol-controlled, it offers unique I/O formatting and exceptional handling features.
E N D
StreamDevice 2.0 A Multi-Purpose Character Driver for EPICS 3.14 Dirk Zimoch
What´s cool • Protocol controlled character I/O • Support new devices by easy configuration • Modular design allows to support • any record type (with device support) • new I/O hardware • exotic data formats • user defined functions Dirk Zimoch
What´s new • Using R3.14 OSI libraries • can run on a PC • Using C++ • modules with well-defined interfaces • plug in your own modules • New protocol features • exception handlers • pre/post processing Dirk Zimoch
Applications • GPIB devices • Serial line devices • Network devices • Logging to files • Console I/O • Client/Server Applications Dirk Zimoch
Protocol File • Plain text configuration • One file per device type • One protocol per function • Simple commands • in string; • out string; • wait timeout; • event timeout; Dirk Zimoch
I/O Formatting printf/scanf-like format strings • standard formats (%f, %d, %s, …) • additional formats • %b binary (ASCII 0 and 1) • %r raw (two´s complement number) • %D BCD • %{…|…} enumeration • user defined (exotic) formats Dirk Zimoch
Exception Handlers Do something special in a special situation • onError • when input doesn’t match • onReplyTimeout • when device doesn’t answer • onInit (not really an exception :-) • when processed during initialisation Dirk Zimoch
Protocol Examples terminator = CR LF; get_freq {out "FREQ?"; in "FREQ %f HZ";} set_freq {out "FREQ %f HZ"; onInit {out "FREQ?"; in "FREQ %f HZ";} } generic_read {out "%s"; in "%39c";} # parameter \$1: switch number set_switch {out "SW \$1 %{OFF|ON}";} # exotic formats (..!!...!..!) get_status {out "ST"; in "%11B.!";} Dirk Zimoch
I/O Link Record link INP or OUT contains • Name of I/O channel (bus) • Name of protocol file and protocol • Protocol parameters (optional) • I/O-hardware dependent parameters field (DTYP, "stream") field (OUT, "@gpib1 mydevice set_switch(2) 7") channel I/O parameter protocol parameter filename protocol Dirk Zimoch
Pre/Post Processing Apply user defined functions to output/input • checksums out checksum("value %f"); in verify("%20c" 0 skip); • encryption out "password " scramble("%s"); • additional information out date("\%H:\%m:\%s") " X = %f"; Dirk Zimoch
Work in Process • Support of new asynDriver • standardised character driver interface • Implementation of new protocol features • Debugging • Documentation • Release this summer mailto: dirk.zimoch@psi.ch Dirk Zimoch