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  2017  2018  <20192020  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  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Count record that resets by date
From: Diego Omitto via Tech-talk <[email protected]>
To: Daniel Cuneo <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Wed, 13 Mar 2019 19:34:56 -0400
This is sort of what I was thinking:

record(bo,"$(P)click"){
    field(DESC,"button being clicked")
    field(DTYP,"Soft Channel")
    field(FLNK,"$(P)click_cnt")}

record(calc,"$(P)click_cnt"){
    field(DESC,"count clicks")
    field(INPA,"$(P)rst_cnt")
    field(CALC,"A?0:VAL+1")
    field(PINI,"YES")}

record(stringout,"$(P)reset_time"){
    field(DESC,"hour:min to rst cnter")
    field(DTYP,"Soft Channel")
    field(VAL,"23:59")
    field(PINI,"YES")}

record(stringin,"$(P)curr_time"){
    field(DESC,"Current time")
    field(DTYP,"Soft Timestamp")
    field(INP,"@%H:%M")
    field(SCAN,"10 second")
    field(PINI,"YES")}

record(scalcout,"$(P)rst_cnt"){
    field(DESC,"Reset the counter")
    field(INAA,"$(P)curr_time CP")
    field(INBB,"$(P)reset_time CP")
    field(CALC,"AA=BB?1:0")}


On Wed, Mar 13, 2019 at 5:39 PM Daniel Cuneo <[email protected]> wrote:
Diego, would your idea allow me to aggregate the counter per day (or other period)?


On Wed, Mar 13, 2019 at 2:34 PM Diego Omitto <[email protected]> wrote:
Hi Daniel,
you could forward link to a scalcout record that increments a counter and gets the time from a stringout record with DTYP "Soft Timestamp".

On Wed, Mar 13, 2019 at 5:08 PM Maren Purves via Tech-talk <[email protected]> wrote:
I have something that needs to be reset on a daily basis and use a
cron job that runs cau with an input file.
Not the most elegant solution, but it works.

HTH,
Maren Purves, EAO

On Wed, Mar 13, 2019 at 11:02 AM Daniel Cuneo via Tech-talk
<[email protected]> wrote:
>
> Hi all,
> I'd like to create a database record that counts based on a forward link. This record would need to reset back to zero
> at 12AM every day.
>
> Use case, is where a beam line user hits a reset button repeatably (tied to a bo record) as a work around for something that is broken.
> I'd like to track these resets.
>
> Is there a way to do this with base?
> I'm considering writing a C subroutine for this is it doesn't already exist.
>
> Cheers!
> dpc

References:
Count record that resets by date Daniel Cuneo via Tech-talk
Re: Count record that resets by date Maren Purves via Tech-talk
Re: Count record that resets by date Diego Omitto via Tech-talk
Re: Count record that resets by date Daniel Cuneo via Tech-talk

Navigate by Date:
Prev: Re: Count record that resets by date Daniel Cuneo via Tech-talk
Next: RE: generalTime/epicsTimeGetCurrent and casr questions Mark Rivers via Tech-talk
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  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Count record that resets by date Daniel Cuneo via Tech-talk
Next: Fw: Count record that resets by date Mooney, Tim M. via Tech-talk
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  2018  <20192020  2021  2022  2023  2024