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  <20102011  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  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Getting value of a PV from a subRecord function
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Fri, 9 Jul 2010 15:13:33 -0500
Hi Pawel,

On Friday 09 July 2010 13:53:04 [email protected] wrote:
>
> record(sub,"$(user):stopsub") {
>   field(DESC,"SimpleTest")
>   field(INAM,"SubInit")
>   field(SNAM,"TestPrint")
>   field(INPA,"$(user):goSub0.VAL")
>   field(INPB,"$(user):goSub1.VAL")
> }
>
> The question is, having the TestPrint function:
>
> long TestPrint(struct subRecord *psu) {
>
> 	return 0;
> }
>
> how can I determine which button was pressed? I wanted to check both
> inputs and see which goSubx.VAL == 1 but I don't know how to get to the
> biRecord pointer using the subRecord pointer. Is there any way to do this?

You're not supposed to access the bi records directly, but the two input links 
INPA and INPB of the sub record will have already read in the VAL fields of 
those records before TestPrint() gets called.  Your function can access the 
values read at prec->a and prec->b respectively, and can also set prec->val or 
any of the other prec->c through prec->l variables (the ones that don't have 
their links set) to export any results.

HTH,

- Andrew
-- 
The best FOSS code is written to be read by other humans -- Harald Welte


References:
Getting value of a PV from a subRecord function ppredki

Navigate by Date:
Prev: Getting value of a PV from a subRecord function ppredki
Next: Re: Getting value of a PV from a subRecord function Ned Arnold
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Getting value of a PV from a subRecord function ppredki
Next: Re: Getting value of a PV from a subRecord function Ned Arnold
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  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 ·