Subject: |
Re: "Exploding" a waveform into individual values |
From: |
"Noboru Yamamoto" <[email protected]> |
Date: |
3 Jun 99 12:15:08 +0900 |
Hellor Ron,
>Hello All,
>
>I think I've seen the answer to this, I may have even asked the question
before.
>
>I have a 10 element waveform (type float) from which I wish to extract
each
>element into an individual AI.
>
>I could code 10 individual subArray records, each mapped to another
element, but
>a subroutine record seems easier. If my 10 element waveform VAL is linked
to A
>of the subroutine record, is the code simply:
>
>psub->b=psub->a[0]
>psub->c=psub->a[1], etc.?
>
>That seems much too easy, and "a" is not an array, right?
>
>/Ron Chestnut
>
I'm sure that one of GURUs in EPICS collaboration will answer this quesion,
but I will report what I studied anyway.
The psub->inpa field keeps a link to your 10 element waveform VAL field.
You can copy the value of the waveform record into your buffer ,
(you must allocate buffer in your subroutine),
using dbGetLink() function call, I think.
Then you can copy values into the other fields,
psub->b=pbuf[0];
psub->c=pbuf[1];
etc.
Before I wrote this mail, I looked at the code of the subroutine record
(subRecord.c).
The process() function calls the fetch_value() function
to update values in the field A to L(?)
before your subroutine is called .
The fetch_value() function in the subRecord.c get values from link using:
for(i=0, plink=&psub->inpa, pvalue=&psub->a;
i<ARG_MAX;
i++, plink++, pvalue++) {
status=dbGetLink(plink,DBR_DOUBLE, pvalue,0,0);
...
I'm not sure if this call does not break subroutine record strucuture,
when plink , whic is psub->inpa in this case, is a link to array field
longer
than ARG_MAX.
Noboru Yamamoto
KEKB control group
KEK, JAPAN
- Navigate by Date:
- Prev:
"Exploding" a waveform into individual values Ron Chestnut
- Next:
subscribe Mathias
- 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:
"Exploding" a waveform into individual values Ron Chestnut
- Next:
Re: "Exploding" a waveform into individual values Marty Kraimer
- 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
|