EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: streamdevice problem with 1 byte reply
From: "Mark Rivers" <[email protected]>
To: "Zhang, Dehong" <[email protected]>, <[email protected]>
Date: Mon, 21 Nov 2011 21:24:48 -0600
Hi Dehong,

> I cannot use ACK or NAK as the terminator because for some commands, the
> real replies come after the ACK byte, again no EOS.  For the same reason, I
> cannot manuplate the maxInput variable.

I don't think that is true.  As I understand the StreamDevice documentation you can specify a different terminator for each protocol.

getFrequency {

    InTerminator="\r"

    out "FREQ?"; in "%f";
}

getSwitch {

    InTerminator="\n"
    out "SW?"; in "SW %{OFF|ON}";
}

Similarly you can specify a different timeout, maxInput, etc. for each protocol.

It looks to me like StreamDevice is doing the pasynOctet->read() with an infinite timeout.  I'm not sure why that is, but in your case you want it to time out.

Mark

 


________________________________

From: Zhang, Dehong [mailto:[email protected]]
Sent: Mon 11/21/2011 5:49 PM
To: Mark Rivers; [email protected]
Subject: RE: streamdevice problem with 1 byte reply



Hi Mark,

Thank you very much!  Sorry to bother you again!

I cannot use ACK or NAK as the terminator because for some commands, the
real replies come after the ACK byte, again no EOS.  For the same reason, I
cannot manuplate the maxInput variable.

When I changed asynSetTraceMask from 9 to 255 like you suggested, I got
one more line of debugging message:
2011/11/21 15:31:30.373 TST:EXP:OPL:1K read.

A successful read would print the number of bytes in place of the last ".", like
2011/11/21 10:46:07.554 TST:EXP:OPL:1K read 5
2011/11/21 10:49:19.328 TST:EXP:OPL:1K read 1

In streamdevice AsynDriverInterface.cc, there is a call
pasynOctet->read
inside AsynDriverInterface::readHandler.  Guess it is the one printing these
messages.  It does not return when there is nothing to read.

Thank you again, best regards,
Dehong





________________________________________
From: Mark Rivers [[email protected]]
Sent: Monday, November 21, 2011 2:47 PM
To: Zhang, Dehong; [email protected]
Subject: RE: streamdevice problem with 1 byte reply

It seems like the right way to fix this is to have your protocol file change the input EOS to ACK or NAK for those commands.

Of course I agree that asyn should be timing out.  What happens when you do asynSetTraceTraceMask=255 on the underlying port driver?  Do you see the read request, and not see it timeout?

Mark


________________________________

From: [email protected] on behalf of Zhang, Dehong
Sent: Mon 11/21/2011 4:41 PM
To: [email protected]
Subject: streamdevice problem with 1 byte reply



Hi,

For some commands, my device replies with only an "ACK" or "NAK",
no EOS.  Streamdevice gets the byte ok, then gets stuck waiting for
more input, but there is no more.

We are "still" using base 3.14.9, asyn 4.10 and streamdevice 2.4.
The replytimeout is set to 900, readtimeout is 100, maxinput is 0.

The problem seems to be asyn not timing out.  Could you guys advise
on what I may have missed?  Is there a quick fix, instead of upgrading
the whole complex to new versions?

Thanks much and best regards,
Dehong







References:
streamdevice problem with 1 byte reply Zhang, Dehong
RE: streamdevice problem with 1 byte reply Mark Rivers
RE: streamdevice problem with 1 byte reply Zhang, Dehong

Navigate by Date:
Prev: RE: TEMPE_VEAT Exception Mark Rivers
Next: RE: TEMPE_VEAT Exception Szalata, Zenon M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: streamdevice problem with 1 byte reply Zhang, Dehong
Next: Re: streamdevice problem with 1 byte reply Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·