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  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  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  <20182019  2020 
<== Date ==> <== Thread ==>

Subject: Parsing problem with stream
From: "Lucock, Richard M" <Richard.Lucock@ukaea.uk>
To: tech-talk@aps.anl.gov
Date: Mon, 04 Jun 2018 15:30:39 +0100
Hi,

	I am having problems parsing data from a serial device (ie
obtained using asyn & stream). The normal protocol is to send a
message (with checksum), wait for an ACK character, then read the
reply (which has a checksum).

If I read the ACK and the reply on one line, using the protocol below:

   read_version {
      out STX, "001?f" ETX, "%<xor8ff>";
      in ACK, STX, "001 f%[^\003]", ETX, "%<xor8ff>";
   }


then I get the correct data into my 'stringin' record, but the shell
reports that the checksum is wrong (presumably because the ACK has
been included in the calculation). If I separate out the ACK and the
reply inputs:

   read_version {
      out STX, "001?f" ETX, "%<xor8ff>";
      in ACK;
      in STX, "001 f%[^\003]", ETX, "%<xor8ff>";
   }

then the shell reports no errors, but nothing is placed in my
'stringin' record.

The messages have no terminators, which I guess is part of the
problem. I have tried playing about with 'extrainput', 'maxinput' and
'wait', with no luck. Does anyone have any suggestions for dealing
with this ?

Thanks,
	Richard

Replies:
Re: Parsing problem with stream Dirk Zimoch
Re: Parsing problem with stream Florian Feldbauer

Navigate by Date:
Prev: Re: Linkam T96 System Controller John . Holt
Next: Re: Parsing problem with stream Dirk Zimoch
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  <20182019  2020 
Navigate by Thread:
Prev: Re: Linkam T96 System Controller Kevin Peterson
Next: Re: Parsing problem with stream Dirk Zimoch
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  <20182019  2020 
ANJ, 04 Jun 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·