EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  Index 2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023 
<== Date ==> <== Thread ==>

Subject: Re: FW: StreamDevice bug
From: Andrew Johnson <[email protected]>
To: [email protected]
Cc: [email protected], [email protected]
Date: Mon, 15 Feb 2010 12:05:23 -0600
On Monday 15 February 2010 10:53:56 [email protected] wrote:
>
> In a recent exchange between Dirk and us about streamDevice, Dirk
> pointed out one way in which stringout is different to other base output
> records - it won't call device support if UDF is true.
>
> Is this deliberate or a bug? If it is a bug, should we fix it because it
> will result in a behaviour change?

There is a bug there, but the idea that the other record types always call 
device support even with UDF true is not quite right; they don't directly 
check UDF in process, but have checkAlarms() set prec->nsev to INVALID_ALARM 
when UDF is true and make the record's behaviour in the presence of an 
INVALID_ALARM depend on the setting of prec->ivoa.

> I can see a viable argument that the opposite should be true - device
> support shouldn't be called if UDF is true. A third alternative is that
> the  decision should be deferred to device support.

I think the other records have it right, what should happen is controlled by 
the database designer using IVOA.  In the case of stringout though, I think 
the 'goto finish' line needs to be deleted to allow the IVOA mechanism (which 
is already present in the process() routine) to work properly.

> I know stringout is different to other standard output records because
> constant links can't be strings, because strings resolve as db or CA
> links. The workaround is to put the string into VAL and make OMSL
> supervisory. This should actually solve our problem (because UDF won't
> be true anymore), but I was wondering whether there was any reasoning
> behind the current implementation.

Not that I can think of, and looking at the history it got changed to this by 
Marty back in 1996 when an even worse bug in it was fixed.

If there are no objections I propose to apply the following patch:

=== modified file 'src/rec/stringoutRecord.c'
--- src/rec/stringoutRecord.c   2009-07-08 18:14:11 +0000
+++ src/rec/stringoutRecord.c   2010-02-15 17:57:30 +0000
@@ -145,7 +145,6 @@

         if(prec->udf == TRUE ){
                 recGblSetSevr(prec,UDF_ALARM,INVALID_ALARM);
-                goto finish;
         }

         if (prec->nsev < INVALID_ALARM )
@@ -172,7 +171,7 @@

        /* check if device support set pact */
        if ( !pact && prec->pact ) return(0);
-finish:
+
        prec->pact = TRUE;
        recGblGetTimeStamp(prec);
        monitor(prec);


- Andrew
-- 
The best FOSS code is written to be read by other humans -- Harald Welte


References:
FW: StreamDevice bug nick.rees

Navigate by Date:
Prev: FW: StreamDevice bug nick.rees
Next: dbToRecordTypeH Benjamin Franksen
Index: 2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023 
Navigate by Thread:
Prev: FW: StreamDevice bug nick.rees
Next: dbToRecordTypeH Benjamin Franksen
Index: 2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·