Go to the first, previous, next, last section, table of contents.

Accepting Messages From a Serial Line

Synopsis

radioshell 3|5|6 command tty

Description

This program does nothing else than to read one peace of output from the computer interface of the Radiometer ABL 300, 500, or 600 series of acid base laboratories into a buffer. Since the ABL 300 has no soft flow control capabilities but is connected through a two wires fiber optical line there is no handshake. The HL7 interfaces can not process the incoming data at the required rate which results in lost characters. The ABL 500 and 600 series, though capable of doing soft flow control, require the radioshell as well since the ASTM to HL7 translation might be too slow, especially when multiple subsequent ASTM messages arrive at a fast rate.

The radioshell is a small program that can read from the serial line very quickly. It buffers the data and invokes the HL7 interface in the background, piping to it the data read into the buffer. The main process of radioshell immediately resumes listening to the serial line. Moreover, radioshell takes over serial line related configuration headache.

The radioshell program makes use of the simple "message" formats of the ABL:

ABL 300
Each line is exactly 21 bytes long: 20 data bytes and 2 end of line chars (CR LF) which are mapped to a single LF by the tty device (igncr flag set). When such a data block is not ended by LF, we know that something went wrong before and made us get out of sync. Thus we issue a warning and discard the message that is currently being sent. A message ends when the last two lines read have been blank. A message is expected to never exceed 50 lines, thus the buffer is 50 * 21 bytes + 1 = 1051 in length including a terminating NUL byte.
ABL 500 and 600
The message format uses ASCII control characters as delimiters: STX BLK ..... ETX. While STX and ETX are standard ASCII control characters, the BLK resembles the "link block number" of the ANSI X3.28 protocol: It is the current message number taken modulo 8 and converted to an ASCII digit in the range of '0' to '7'. The buffer size is fixed to 8192 bytes for the ASTM message.

Options

Arguments to this program are: the selection flag for the type of ABL. This selects the message format to be used.

A subsequent arbitrary number of arguments set the command to be invoked for each message read. If this is specified to `-', a default command is used (`/usr/hl7/bin/abl300' or `/usr/hl7/bin/abl500')

The last argument is the path to the device node of the serial line (tty). If the tty argument is `-', the standard input is used instead.

The TTY parameter are hard coded into the radioshell program as follows:

ABL 300
300 bps, 7 bits, even parity, local mode, no flow control, ignore CR (igncr)
ABL 500 and 600 series
9600 bps, 8 bits, no parity, local mode, soft flow control (ixon/ixoff)

Examples

Typically, the radioshell is used as a `getty(8)' program specified in `/etc/ttys' or `/etc/inittab'.

`/etc/ttys':

ttyd0   "radioshell 625 -"      unknown on
ttyd1   "radioshell 300 -"      unknown on

Files

`/usr/hl7/var/log/ABL/060_IOP/ABL####'
The radioshell program writes a copy of each message as a file to a directory whose name is composed of the application and facility names. The filename is composed of the string `ABL' and the process id (pid) of the radioshell child process attached to it.

Bugs

The application name (`ABL') and the facility name (`060_IOP') are chosen at compile time. This is certainly wrong because the radioshell might well be used for different facilities.

The process id is certainly a bad choice for numbering files, because process ids will repeat and thus do not reflect the order in time of the messages.

Diagnostics

Messages are logged with syslog(3) and are most probably be found in the system directory `/var/log/messages'.

See Also

ttys(5), termios(4), getty(8), ascii(7), syslog(3), section Converting Printer Output to HL7, section An ASTM to HL7 Gateway for the ABL 500.


Go to the first, previous, next, last section, table of contents.