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
<2010>
2011
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
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|