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  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: genSub and capture monitor event
From: Eric Norum <[email protected]>
To: Emmanuel Mayssat <[email protected]>
Cc: epics <[email protected]>
Date: Thu, 3 Apr 2008 19:31:28 -0500
I should probably let a real expert reply, but will the following work for you?

FLNK the genSub record from both PV1 and PV2.
The genSub always updates PV1 and PV2.

Sound like an infinite loop?  It's not, and here's why:
1) PV1 starts to process
2) PV1 sets PACT=1
3) PV1 finishes its own processing and invokes its forward link
4) The genSub record starts to process
5) genSub sets PACT=1
6) genSub  writes to PV1.
7)PV1 does not process because PACT=1.
8) The genSub record writes to PV2.
9) PV2 processes and FLNKs to the genSub.
10) genSub does not process because PACT=1
11) genSub sets PACT=0 and returns
12) PV1 sets PACT=0 and returns

The genSub INP links from PV1 and PV2 should be NPP.
The genSub OUT links to PV1 and PV2 should be PP (so the update from the genSub causes the record to process)


On Apr 3, 2008, at 6:58 PM, Emmanuel Mayssat wrote:
That's not exactly what I want...
I want to execute something like that:


if PV1 is updated, process gensub and compute new PV2 if PV2 is updated, process gensub and compute new PV1 PV1 and PV2 and both inputs and outputs of gensub It is the classic loop problem, but with gensub. ;-)

The computed new PV are such that there is a equilibrium (and monitor
are disabled if new value is same as old one (field(mdel,"1"))).

In other words, gensub needs to detect if it is PV1 or PV2 that updated
first, then it update the other.


--
E



On Thu, 2008-04-03 at 17:56 -0500, Eric Norum wrote:
You should be able to do this by making the genSub input link a
channel access link (assuming that the genSub SCAN field is Passive):
	field(INPA, "foobar.VAL CP")

On Apr 3, 2008, at 5:31 PM, Emmanuel Mayssat wrote:
Hello,

Is there a way to detect a monitor event in a genSub routine?
I believe it is possible in the sequencer with the evflag entries.
But I am interested in doing that with a genSub record this time.

If gensub cannot do it, is it possible to detect a monitor event with
any other means than through the sequencer ?
--
Emmanuel





-- Eric Norum <[email protected]> Advanced Photon Source Argonne National Laboratory (630) 252-4793



Replies:
Re: genSub and capture monitor event Emmanuel Mayssat
References:
genSub and capture monitor event Emmanuel Mayssat
Re: genSub and capture monitor event Eric Norum
Re: genSub and capture monitor event Emmanuel Mayssat

Navigate by Date:
Prev: Re: genSub and capture monitor event Emmanuel Mayssat
Next: compiling error:expected constructor, destructor, or type conversion before "(" token 黄思婷
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: genSub and capture monitor event Emmanuel Mayssat
Next: Re: genSub and capture monitor event Emmanuel Mayssat
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·