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  <20102011  2012  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  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: streamDevice trick for in with or without value
From: Dirk Zimoch <[email protected]>
To: EPICS tech-talk <[email protected]>
Date: Fri, 04 Jun 2010 13:34:24 +0200
Hello Emmanuel,

I am sorry but at the moment I do not have any "number or nothing" matching.

But there is still hope: Write your own format converter!
Start with a copy of StdLongConverter from StreamFormatConverter.cc, modify it to set value to 0 on failure and return 0. Then register it with any unused conversion character. In parse() don't use info.append(fmt.conv), use info.append('d') instead.


You are not the first one with such a problem.
Maybe I should extend the syntax to something like %?d to return 0 (and succeed) if nothing can be read. Let me see if I can do that quickly.


Dirk



[email protected] wrote:
I am using stream.
I have a serial device whose query/reply follow thisi pattern:

out "get value"
in  "F: W: IK:"
If values are 0

If values are not 0, I have
out "get value"
in  "F: 12 W: IK:" <- value is 12

Is there a way to make this value conditional in stream?
With the current protocol, I have a mismatch and my record becomes invalid
(and stop processing).

1/ How can I make the protocol work?
2/ Assuming that there is a mismatch, how can I restore my record to "valid" status?

thanks,



References:
streamDevice trick for in with or without value emmanuel_mayssat

Navigate by Date:
Prev: EPICS support for Mass Spectrometers nick.rees
Next: bspExt.h nick.rees
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: streamDevice trick for in with or without value emmanuel_mayssat
Next: Medipix2 detector matthew.pearson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·