1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 <2004> 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 <2004> 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Babbling serial device |
From: | Marty Kraimer <[email protected]> |
To: | Eric Williams <[email protected]> |
Cc: | [email protected] |
Date: | Fri, 27 Aug 2004 06:54:37 -0500 |
I just thought I'd throw this solution out so it would be in the archives if someone else needed it.
We have a RS-232 device we wanted to control with EPICS (a Thales Optem zoom lens control stepping motor drive) that reported its status on a continuous basis. The IOC was a Linux box running 3.14 with the GpibCore driver used to talk to the serial port.
Because the device didn't wait for a command but instead sent its status periodically, the serial port's input buffer would fill up and cause GpibCore to get an error and dump EPICS as soon as you tried to process any of the records going to the device's port. I thought about digging into the driver and making it more tolerant of babbling devices, but abandoned that idea in favor of an easier solution.
I built a filter daemon which would open the serial port to the device and pick up the input stream, decode the status, and store it locally. The other side of the filter was through a pseudo-tty which emulated the device's command set, passing on commands to the device, but with the addition of a new command to read the local copy of the current status. This daemon ran in the background, and the GpibCore driver would talk to the pseudo-tty port instead of the serial port. The daemon was auto-started through the standard Linux init mechanisms.
--
Eric Williams
Advance Light Source
Lawrence Berkeley Lab