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

Subject: Re: Reset integral pv and store it
From: "Kasemir, Kay" <kasemirk@ornl.gov>
To: Andrew Johnson <anj@aps.anl.gov>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Fri, 31 Mar 2017 16:06:56 +0000
Hi:

> On Mar 31, 2017, at 11:53 AM, Andrew Johnson <anj@aps.anl.gov> wrote:
> It may be easier to do the time manipulation in C code, but it should be
> possible to do it purely in the database. An ai record with its DTYP
> field set to "Soft Timestamp" returns the number of seconds +
> nanoseconds since the EPICS epoch whenever it gets processed. A calcout
> record would also be a good idea following this, since it can
> conditionally process its output link based on a separate expression.
> 
> Alternatively you could create a scan thread with a 24-hour scan period,
> although you won't them get to to control when in the day it will
> actually process (it will be every 24 hours from the time when the IOC
> was started). To do this just copy the file menuScan.dbd from base/dbd
> into your IOC's *App/src directory and add a new entry at the top of the
> list of periodic scans with the appropriate period in the choice scrint.
> If you're using Base-3.15 that's slightly easier than with 3.14 since
> your string can be just "24 hours"; in 3.14 the number must be expressed
> in seconds.

Periodic processing like every N hours is certainly possible with the database.
But I’m not sure how to use that to process based on the local time, like “06:00” for start of shift, or "23:59:59" for an end-of-day summary.
That’s similar to 24h processing, except it’s 23h resp. 25h for daylight savings time transitions, and you want the period to be in phase with the wall clock.
A subroutine record that returns seconds since midnight, local time, can be used for that, but not one that returns seconds since the EPICS epoch.

-Kay

References:
Reset integral pv and store it Miguel
Re: Reset integral pv and store it Kasemir, Kay
Re: Reset integral pv and store it Andrew Johnson

Navigate by Date:
Prev: Re: Reset integral pv and store it Andrew Johnson
Next: Re: Reset integral pv and store it Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Re: Reset integral pv and store it Andrew Johnson
Next: Re: Reset integral pv and store it Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 31 Mar 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·