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  2014  2015  <20162017  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  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Skip updating an output link in aSub ?
From: Lingyun Yang <[email protected]>
To: Michael Davidsaver <[email protected]>
Cc: [email protected]
Date: Thu, 14 Jan 2016 11:32:30 -0500
Hi Michael,

I tried your ideal, but did not succeed. I may made mistakes, here is the sample code:

record(aSub, "$(p)P") {
   field(INPA, "$(p)WF")
   field(NOA, "6")
   field(FTA, "DOUBLE")

   field(INPB, "$(p)WF:X")
   field(NOB, "6")
   field(FTB, "SHORT")


   field(OUTC, "$(p)TO1 NPP")
   field(FTVC, "DOUBLE")
   field(NOVC, "1")

   field(OUTD, "$(p)TO1.DISV PP")
   field(FTVD, "SHORT")
   field(NOVD, "1")

   field(OUTE, "$(p)TO2 NPP")
   field(FTVE, "DOUBLE")
   field(NOVE, "1")

   field(OUTF, "$(p)TO2.DISV PP")
   field(FTVF, "SHORT")
   field(NOVF, "1")

   field(OUTG, "$(p)TO3 NPP")
   field(FTVG, "DOUBLE")
   field(NOVG, "1")

   field(OUTH, "$(p)TO3.DISV PP")
   field(FTVH, "SHORT")
   field(NOVH, "1")

   field(SNAM, "splitMarkedVals")
}

Here is the Python test code and its output:

# the initial three values
caput(["l:TO1", "l:TO2", "l:TO3"], [10,20,30])
print caget(["l:TO1", "l:TO2", "l:TO3"])
# split this l:WF to TO1,TO2,TO3, using l:WF:X as mask
caput("l:WF:X", [0, 1, 1])
caput("l:WF", [6, 5, 4])
caput("l:TO1.DISA", 0)
caput("l:TO2.DISA", 0)
caput("l:TO3.DISA", 0)
print "initial TO1:", caget(["l:TO1", "l:TO1.DISV", "l:TO1.DISA"])
print "initial TO2:", caget(["l:TO2", "l:TO2.DISV", "l:TO2.DISA"])
print "initial TO3:", caget(["l:TO3", "l:TO3.DISV", "l:TO3.DISA"])

print caget(["l:TO1", "l:TO2", "l:TO3"])

caput("l:P.PROC", 1)
# the result should be [6, 20, 30] or [10, 5, 4]
# depending mask means drop or drop
print "TO1", caget(["l:TO1", "l:TO1.DISV", "l:TO1.DISA"])
print "TO2", caget(["l:TO2", "l:TO2.DISV", "l:TO2.DISA"])
print "TO3", caget(["l:TO3", "l:TO3.DISV", "l:TO3.DISA"])



[10.0, 20.0, 30.0]
initial TO1: [10.0, 0, 0]
initial TO2: [20.0, 1, 0]
initial TO3: [30.0, 1, 0]
[10.0, 20.0, 30.0]
TO1 [6.0, 0, 0]
TO2 [5.0, 1, 0]
TO3 [4.0, 1, 0]




On Wed, Jan 13, 2016 at 10:43 PM, Michael Davidsaver <[email protected]> wrote:
Hi Lingyun,

> Is there anyway skip updating any/some of the output PVs in the aSub
routine ?

Nope sorry.  At least no directly.

One slightly ugly workaround is to do the conditional in a second
record.  Then use another of the aSub outputs to drive the condition.
Something like:

> record(aSub, "...") {
>  ...
>   field(OUTA, "other NPP")
>   field(OUTB, "other.DISV PP")
> }
> record(waveform, "other") {
>   field(DISA, "0")
>   ...
> }

VALB!=0 of the aSub allows 'other' record is processed.  VALB==0
prevents it.  Note that the 'NPP' in OUTA prevents that link from
causing processing.

Michael


On 01/13/2016 05:53 PM, Lingyun Yang wrote:
> Hi,
>
> I am writing a aSub routine to do some multiinput-multioutput data
> analysis.
> In some cases, I do not want to update the output links. e.g. let those
> OUTA-OUTU PVs values untouched.
>
> If I do not do anything to the prec->vala to prec->valu, the
> corresponding PVs still get updated, but with some default values,
> e.g. 0.0 for DOUBLE.
> I also tried to set effective length (e.g. set neva=0), but it did not
> work for an ao record.
>
> Is there anyway skip updating any/some of the output PVs in the aSub
> routine ?
>
> Thanks.
>
> Best regards,
> Lingyun
>




--
------------------
Lingyun YANG
Skype Name: lingyun_zjdt

Replies:
Re: Skip updating an output link in aSub ? Michael Davidsaver
References:
Skip updating an output link in aSub ? Lingyun Yang
Re: Skip updating an output link in aSub ? Michael Davidsaver

Navigate by Date:
Prev: Re: Skip updating an output link in aSub ? Andrew Johnson
Next: Re: Undefined symbol error when load VxWorks .much file Scott Baily
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Skip updating an output link in aSub ? Roehrig, Christian
Next: Re: Skip updating an output link in aSub ? Michael Davidsaver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·