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

Subject: Incorrect Timestamp in aSubRecord
From: Bruce Hill <[email protected]>
To: "[email protected]" <[email protected]>
Date: Thu, 20 Nov 2014 15:46:35 -0800
I recently traced a timestamp issue on an older ioc using genSub
to when genSubRecord.c calls recGblGetTimeStamp(), and I think
the same problem exists in aSubRecord.c in 3.14.12.

In our environment, epics timestamps from our EVR's have an embedded
pulseId in the nsec field, which we use to identify which beam pulse
values are derived from.     When we use a genSub or aSub record to
do computations related to a beam pulse, that record will either get
it's timestamp via TSE -2 in the records process function or via a TSEL
link to a waveform timestamped w/ the currect pulse ID.

I found that it worked correctly for TSE -2, as the user process function
sets the timestamp.   However, when using TSEL to get the genSub or aSub
timestamp, I'd get stale timestamps on any output links which used
a TSEL back to the genSub or aSub record.

The reason this happens is that recGblGetTimeStamp() is getting called
after the output links are processed, and the TSEL based output records
thus grab the aSub timestamp before recGblGetTimeStamp is called.

Has anyone else seen this problem, or know of some reason why we
shouldn't be calling recGblGetTimeStamp before processing the output records?

Thanks!
- Bruce

P.S.  Here's my patch for this:
--- src/rec/aSubRecord.c        (revision 19727)
+++ src/rec/aSubRecord.c        (revision 19728)
@@ -266,6 +266,7 @@
         return 0;

     prec->pact = TRUE;
+    recGblGetTimeStamp(prec);

     /* Push the output link values */
     if (!status) {
@@ -276,7 +277,6 @@
                 (&prec->neva)[i]);
     }

-    recGblGetTimeStamp(prec);
     monitor(prec);
     recGblFwdLink(prec);
     prec->pact = FALSE;

Index: src/rec/aSubRecord.c
===================================================================
--- src/rec/aSubRecord.c	(revision 19727)
+++ src/rec/aSubRecord.c	(revision 19728)
@@ -266,6 +266,7 @@
         return 0;
 
     prec->pact = TRUE;
+    recGblGetTimeStamp(prec);
 
     /* Push the output link values */
     if (!status) {
@@ -276,7 +277,6 @@
                 (&prec->neva)[i]);
     }
 
-    recGblGetTimeStamp(prec);
     monitor(prec);
     recGblFwdLink(prec);
     prec->pact = FALSE;

Replies:
RE: Incorrect Timestamp in aSubRecord Mark Rivers
Re: Incorrect Timestamp in aSubRecord Hovanes Egiyan

Navigate by Date:
Prev: RE: Defining enums to express state? Mark Rivers
Next: RE: Beckhoff EtherCAT Motion Control [SEC=UNCLASSIFIED] LYNCH, Damien
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Defining enums to express state? Torsten Bögershausen
Next: RE: Incorrect Timestamp in aSubRecord Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·