EPICS Home

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  <20172018  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  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Reset integral pv and store it
From: Maren Purves <[email protected]>
To: [email protected]
Date: Fri, 31 Mar 2017 14:09:48 -1000
On 03/31/17 08:21, Ralph Lange wrote:
On March 31, 2017 4:47:43 PM GMT+02:00, Miguel
<[email protected]> wrote:

    Hi all,

    I have a PV that is an integral over the day. I would like at the
    end of the day(certain timestamp) to store it to the DB (maybe in
    another PV) and after that reset the integral.

    I would also like that if epics restarts the intergal will initiate
    with the most recent value in the DB.

    My DB is with mysql with the CSS archive engine.

    my current integral PV:

    record(calc, "$(user):DLI"){
        field(DESC, " Daily light Integral (mol.m-2.day-1)")

        field(INPA, "$(user):Lum1")
        field(INPB, "$(user):DLI")
        field(CALC, "A*1e-6+B")

        field(SCAN, "1 second")
        field(EGU, "DLI")
        #field(PREC, "6")
        #field(ADEL, "10")

        field(LOPR, "0")
        field(HOPR, "1000")    #High Operating Range
    }

    Thanks a lot,
    MiguelB


Yet another idea:
The stringin record has support for strftime formats. If you use that to
create a six digit hhmmss number, you can use a calcout record to e.g.
check for <10 and process a seq record on the 1->0 edge to do the
integral reset sequence.

We have records that keep minima and maxima (so, it is slightly
different) for the time since the beginning of the (previous, when
you get to the next day) which I reset with a cron job at 18:00
using cau with an input file. Something like that may work here too.

Maren


References:
Reset integral pv and store it Miguel
Re: Reset integral pv and store it Ralph Lange

Navigate by Date:
Prev: Re: Reset integral pv and store it Kasemir, Kay
Next: Re: Reset integral pv and store it Miguel
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Reset integral pv and store it Kasemir, Kay
Next: Re: Reset integral pv and store it Miguel
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024