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  2014  2015  <20162017  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  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: PyEpics -- full-resolution timestamps?
From: Matt Newville <[email protected]>
To: Eric Norum <[email protected]>
Cc: tech-talk <[email protected]>
Date: Wed, 26 Oct 2016 11:14:16 -0500
Hi Eric,

On Wed, Oct 26, 2016 at 10:14 AM, Eric Norum <[email protected]> wrote:
The pv.timestamp attribute returns the record time stamp as a floating point value.  This provides 53 bits of significand.  The ’seconds' now take about 31 bits leaving around 22 bits for fractional seconds so the resolution is only around 250 ns or so.

How about adding a couple of more atrtributes, say pv.seconds (POSIX) and pv.nanoseconds, to provide access to the full resolution time stamp?


Ah, yes, you are right.   Currently, the pv.timestamp is calculated as
    EPICS2UNIX_EPOCH + stamp.secs + 1.e-6*int(1.e-9*stamp.nsec)
where "EPICS2UNIX_EPICS" is the 1990 to 1970 translation, and "stamp" is the struct of two unsigned integers.   Like you say, that will not retain full  precision. Your idea of separately storing these two integer fields as "seconds" and "nanoseconds" as attributes is a great idea.   Will do.

Thanks,

--Matt


References:
PyEpics -- full-resolution timestamps? Eric Norum

Navigate by Date:
Prev: PyEpics -- full-resolution timestamps? Eric Norum
Next: Re: streamdevice exceptions Jeong Han Lee
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: PyEpics -- full-resolution timestamps? Eric Norum
Next: Error with RTEMS on MVME5500 "भावना नितिन मेढ़"
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 28 Oct 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·