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  <20142015  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  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Calculate time for which the b1 record remains 1 or 0
From: "Mooney, Tim M." <[email protected]>
To: Azra Jabeen <[email protected]>, "[email protected]" <[email protected]>
Date: Mon, 9 Jun 2014 19:49:05 +0000
Try this:

record(seq, "$(P)arm") {
    field(DO1, "1")
    field(LNK1, "$(P)state.D PP NMS")
    field(DO2, "0")
    field(LNK2, "$(P)state.D PP NMS")
    field(DO3, "0")
    field(LNK3, "$(P)state.A NPP NMS")
    field(DESC, "process to arm timer")
}

record(bi, "$(P)bi") {
    field(FLNK, "$(P)state.PROC")
    field(DESC, "record whose values are timed")
}

record(calcout, "$(P)state") {
    field(INPB, "$(P)bi NPP")
    field(CALC, "c:=(a==0)?b:c;a:=(b==c?a+1:a);a==1?1:a==2?0:-1")
    field(OUT, "$(P)counter.A NPP")
    field(DESC, "counter state")
}

record(calcout, "$(P)counter") {
    field(INPB, "$(P)counter.VAL NPP")
    field(INPC, "$(P)counter.D NPP")
    field(CALC, "a==-1?0:(a?b+1:b)")
    field(SCAN, ".1 second")
    field(DESC, "counter")
}

To arm the counter, process $(P)arm.  Once armed, the next time $(P)bi is processed, the counter will start, and the value that started it will be recorded.  The next time $(P)bi processes and has the recorded value, the counter will stop.

Tim Mooney

From: [email protected] [[email protected]] on behalf of Azra Jabeen [[email protected]]
Sent: Monday, June 09, 2014 1:47 AM
To: [email protected]
Subject: Calculate time for which the b1 record remains 1 or 0

Hi
Any body can help me

I receive bi input either 1 or 0 . I want to calculate the time interval between two 1s or two 0s.

Thanks

azra


References:
Calculate time for which the b1 record remains 1 or 0 Azra Jabeen

Navigate by Date:
Prev: calc out record to verify pv not connected Goff, Steven J
Next: Re: calc out record to verify pv not connected Paul Sichta
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Calculate time for which the b1 record remains 1 or 0 Azra Jabeen
Next: calc out record to verify pv not connected Goff, Steven J
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·