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  <20122013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: streamdevice: error handling for multiple lines of input from one command
From: Dirk Zimoch <dirk.zimoch@psi.ch>
To: "Rock, Judith E." <jrock@slac.stanford.edu>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 14 Jun 2012 13:46:32 +0200
Hi Judy,

Rock, Judith E. wrote:
Hi -
We have a device that returns multiple lines of input from one command.  We're successfully using streamdevice to capture the inputs, which are of mixed type.  The issue at hand is error handling for the float inputs.  Upon error, any of the float fields can return an error string.  I tried setting up an @mismatch for the prototype, and this works...the problem is that the prototype stops processing inputs at the error: subsequent inputs in the list are all invalid which could mask some important conditions.  I also tried a separate prototype for each input with its own @mismatch; however I observed the same behavior: inputs following the error condition were all invalid.


This is indeed a problem yet unsolved with redirection. The protocol stops upon error and only the active record becomes invalid.

Our solution at the moment is to read everything in as strings and use scalcouts to translate to numbers - that way each input is converted independently.  However, if streamdevice itself has a more elegant way of handling the situation we would be very happy to adopt it!

I can offer you two other solutions:

1) Use "I/O Intr". Like before, you have one active record. But you don't redirect other values, you simply ignore them. The other records are "I/O Intr". Their protocol consists only of an 'in' command and they parse their input and ignore everything else. So if you have a format like "%*s %*s %f %*s %*s" i.e. read the 3rd of 5 words as a float and you get an error message as word 3 then this record will simply ignore the input. If the error strings are enums (i.e. limited set of strings), you can have the error record for this value trying to read the message in parallel to the "normal" float input: "%*s %*s %{error1|error2|error3} %*s %*s".

2) Use a new feature: optional input. With a format like "%?f" you can read a float or get 0.0 if there is no float.

Something like this:
in "%?f%(e1)?{error1|error2|error3} "
   "%(v2)?f%(e2)?{error1|error2|error3}";

If you can give me some example input, I may give you a more detailed answer.

Drik



References:
streamdevice: error handling for multiple lines of input from one command Rock, Judith E.

Navigate by Date:
Prev: RE: thermocouple solutions PELLE Sébastien
Next: RE: Problems with areaDetector Prosilica driver on Windows? Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: streamdevice: error handling for multiple lines of input from one command Rock, Judith E.
Next: Problem with EPICS c# Library Version 1.2.0.0 张玉亮
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
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 ·