Hi Enum,
Which record is the "button" you are pressing?
Please explain the intended logic in your database, i.e. please describe each record is intended to do. You are scanning all of the records at 0.1 second which does not seem correct.
If you just want to turn an LED on for 2 seconds and then turn it off I don't see why you need a counter that is updating an integer count at all. For example the "seq" record in EPICS base can set an output record to 1 (turning on the LED), wait for 2 seconds, and then turn it off. Each time you process that record it will do that.
Mark
________________________________
From: Tech-talk <[email protected]> on behalf of enum riz via Tech-talk <[email protected]>
Sent: Tuesday, November 12, 2019 12:07 AM
To: Tech-talk
Subject: Reset counter
Hi Mark
i made a counter which works fine when i press button it starts and after a fixed value it stop.but whenever i press again button it didnot work.(Independently it works but when i merge this in my file with other code it didnot start with next press button)
i am sending code please tell me how it will reset and starts again when button press. I want a duration of 2 seconds. Led On for 2 second and then off.
record(bi, "b"){
field(SCAN, ".1 second")
field(ZNAM, "0")
field(ZNAM, "1")
}
record(calcout, "t"){
field(SCAN, ".1 second")
field(INPA, "b")
field(CALC, "A==1?1:0")
}
record(calcout, "counter"){
field(SCAN, ".1 second")
field(VAL, "0")
field(INPA, "counter")
field(INPB, "1")
field(INPC, "t")
field(CALC, "C==1&&(A<=9)?(A+B):A")
}
record(calcout, "reset"){
field(SCAN, ".1 second")
field(INPA, "counter")
field(CALC, "A<=9?A:0")
}
record(calcout, "rst"){
field(SCAN, ".1 second")
field(INPA, "reset")
field(CALC, "A==1?1:0")
}
record(b0, "out"){
field(SCAN, ".1 second")
field(OMSL, "closed_loop")
field(DOL, "rst")
field(ZNAM, "0")
field(ZNAM, "1")
}
- Replies:
- Re: [EXTERNAL] Re: Reset counter Steven M. Hartman via Tech-talk
- References:
- Reset counter enum riz via Tech-talk
- Navigate by Date:
- Prev:
Re: Reset counter William Layne via Tech-talk
- Next:
Re: [EXTERNAL] Re: Reset counter Steven M. Hartman 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
<2019>
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Reset counter William Layne via Tech-talk
- Next:
Re: [EXTERNAL] Re: Reset counter Steven M. Hartman 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
<2019>
2020
2021
2022
2023
2024
|