Hi Andrew,
Trying to do what you suggested:
test.db: record(waveform, "wave") { field(INP, "[1, 2, 3, 4, 5]") field(NELM, "5") field(FTVL, "DOUBLE") field(PINI, "YES") field(FLNK, "subarr") }
record(subArray, "subarr") { field(INP, "wave") field(INDX, "1") field(MALM, "5") field(NELM, "1") field(FTVL, "DOUBLE") }
lerwys@lerwysPC:~$ softIoc -d test.db Starting iocInit ############################################################################ ## EPICS R7.0.5.1-DEV ## Rev. 2021-08-22T23:01-0300 ############################################################################ iocRun: All initialization complete epics>
lerwys@lerwysPC:~$ caget wave
wave 5 1 2 3 4 5 lerwys@lerwysPC:~$ caget subarr subarr 5 2 0 0 0 0
subarr always returns an array of 5 elements, but I was trying to achieve a subArray of only 1 element. Something like:
lerwys@lerwysPC:~$ caget subarr subarr 2
Is that possible?
Thanks again!
Lucas
On Wed, Sep 1, 2021 at 5:15 PM Johnson, Andrew N. < anj at anl.gov> wrote:
Hi Lucas,
Please read the “Array Parameters” section of the Record Reference page for the subArray record. Jueri is correct if you need to be able to access any element of
the original waveform; if you only need one of the first 10 elements say, you can set MALM to 10.
- Andrew
Hi Jueri,
Sure. But then caget returns a waveform of MALM elements instead of just 1 element. I wanted to have a subarray of 1 element. Is that possible? Or does it even make sense to do with subarray?
Thanks,
Lucas
Your MALM of subarray must be equal to NELM of waveform
Hello everyone,
I was trying to get subArray to read the second (or any other than the first) element from a waveform record, like this:
cat << EOF > test.db
record(waveform, "wave") {
field(INP, "[1, 2, 3, 4, 5]")
field(NELM, "5")
field(FTVL, "DOUBLE")
field(PINI, "YES")
field(FLNK, "subarr")
}
record(subArray, "subarr") {
field(INP, "wave")
field(INDX, "1")
field(MALM, "1")
field(NELM, "1")
field(FTVL, "DOUBLE")
}
EOF
--
Complexity comes for free, simplicity you have to work for.
- Replies:
- Re: subArray behavior reading just 1 element Johnson, Andrew N. via Tech-talk
- References:
- subArray behavior reading just 1 element Lucas Russo via Tech-talk
- Re: subArray behavior reading just 1 element Lucas Russo via Tech-talk
- Re: subArray behavior reading just 1 element Johnson, Andrew N. via Tech-talk
- Navigate by Date:
- Prev:
Re: subArray behavior reading just 1 element Johnson, Andrew N. via Tech-talk
- Next:
Re: subArray behavior reading just 1 element Johnson, Andrew N. via Tech-talk
- 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:
Re: subArray behavior reading just 1 element Johnson, Andrew N. via Tech-talk
- Next:
Re: subArray behavior reading just 1 element Johnson, Andrew N. via Tech-talk
- 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
|