Before you send a command to your serial device, you should clear the
serial buffers.
So a read operation becomes:
1/ Read ( you will read nothing most of the time), this operation
clears /flushs the serial buffers.
2/ send your serial commnad/inquiry
3/ read the serial port a second time to get your PV value
Note that this is also assuming that you are using serial port locking,
and that this feature is working correctly (i.e. only 1 write-read
request at a time )
--
Emmanuel
On Thu, 2007-01-18 at 14:45 -0500, Phillip Sorensen wrote:
> Hi All,
>
> I am trying to get an RS-232 ion pump controller (Terranova 751) using
> the asyn devGpib device support. I have the code working for each
> command, but after time running I will get what appears to be a
> communication timeout to the pump controller and after the timeout I
> notice that the PV values are wrong. They have the value of another
> command not their own value. For example before the timeout error the
> voltage is 3500 and the current is 4e-6, after the timeout error the
> voltage read 1 and the current is 3.5e-3 (3500).
>
> The device is connected through a Comtrol Devicemaster
> ethernet-to-serial device, and by resetting this device or restarting
> the IOC, I can get the right values. I have found that starting the IOC
> inside of gdb seems to always cause a timeout with the first message and
> trigger this problem.
>
> By using a packet capture program, it looks like the packets are correct
> from the Devicemaster. The replies are to the command sent and appear
> to be complete.
>
> Has anyone else had issues like this? Is there an easy way to close the
> connection or flush the input buffer on an error?
>
> Thanks,
>
> Phil Sorensen
> CHESS
>
- Replies:
- Re: Out of order replies from a serial device Phillip Sorensen
- References:
- Out of order replies from a serial device Phillip Sorensen
- Navigate by Date:
- Prev:
Out of order replies from a serial device Phillip Sorensen
- Next:
EDM Message Box issue.... Dave Reid
- 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
- Navigate by Thread:
- Prev:
Out of order replies from a serial device Phillip Sorensen
- Next:
Re: Out of order replies from a serial device Phillip Sorensen
- 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
|