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: Manipulating time in records
From: Dirk Zimoch <[email protected]>
To: Di Maio Franck <[email protected]>
Cc: Mahajan Kirti <[email protected]>, Makijarvi Petri <[email protected]>, "[email protected]" <[email protected]>
Date: Mon, 18 Oct 2010 16:41:26 +0200
Hi Franck,

If you want to use only one value, you can reach 1e-6 second precision with a double (e.g. seconds since 1970 or since 1990 as long as you count less than 142 years). Is that enough?

If you really need 1e-9 second precision, there is no way around 64 bit precision, e.g. 2 longout records. Don't worry about signed or unsigned long. You only need to count to 0x3b9ac9ff nanoseconds and 31 bits for the seconds is enough for 68 years. (Well, fusion energy should last for longer than 68 years, but that's an issue for later.)

Dirk

Di Maio Franck wrote:
Dear EPICS advanced

An issue that I guess has been encountered in other labs already.

A typical ITER use case:

"Do A at time T", - T: a setting controllable by PV(s),
- A: an action implemented by a record triggered by an event occurring at time T.


We are implementing this use case with a module that receives time over PTP, so the time shall be expressed with nano-second resolution.

So we need:
- one unsigned int32 for seconds
- one (unsigned or not) int32 for fraction of second expressed as nano-seconds.
Same as time-stamp (TS), right?

Maybe 2 longout but I am not sure if UINT32 is OK with longout.
In addition, we'll have "pulse time", with a specific time origin, so maybe also sub or calc records to convert between relative and absolute time.

We'll appreciate advices on the records to be used... Good or bad ideas/experiences welcome.

Thanks in advance!

Franck




References:
Manipulating time in records Di Maio Franck

Navigate by Date:
Prev: Re: Eurotherm Temperature Controller Support Stephen Lewis
Next: Epics C# Library - questions Jose Patricio Gonzalez
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: Manipulating time in records Di Maio Franck
Next: Re: Manipulating time in records Andrew Johnson
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, 18 Oct 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·