>Given: A device, which is sending data records to a UNIX-
> workstation of defined length, structure and protocol
> via the serial line. The records can be sent anytime.
>Problem:How can I persuade the workstation to feed the data
> records into a file for postprocessing.
I have done this with a Progress DBMS application. The situation
was that records were being fed to the serial port expecting some
simple acknowledgement. What I did was write a simple C program
to open the serial port with all the right parameters and negotiate
with the port for the records. These were then reformatted into
a form usable by Progress and printed to the standard output. I
then wrote a Progress function to input through that process. Of
course there are a few things like port ownership and such to handle
but that was the basic idea.
Another way I dealt with this was in a stock trading system. In that
scenario there was a sattelite feed connected to a serial port with
stock prices. The program I wrote opened up the port as above but
in this case it simply stored the input in various files corresponding
to the contract of the tick. The reason for the difference was that
it allowed many processes to read any of the input by effectively
doing a "tail -f" on the files it was concerned with.
I am sure there are many other possibilities depending on your needs
but hopefully this will suggest some to you.
PlanIX, Inc. | There's no government
Toronto, Ontario, Canada | like no government!
+1 416 424 2871 (DoD#0082) (eNTP) |