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  2016  2017  2018  2019  2020  <20212022  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  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: subArray behavior reading just 1 element
From: "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov>
To: Lucas Russo <lerwys at gmail.com>
Cc: EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Wed, 1 Sep 2021 20:15:33 +0000
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



On Sep 1, 2021, at 2:57 PM, Lucas Russo via Tech-talk <tech-talk at aps.anl.gov> wrote:

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

On Wed, Sep 1, 2021, 16:53 Tagger, Jueri <jtagger at bnl.gov> wrote:

Your MALM of subarray must be equal to NELM of waveform

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Lucas Russo via Tech-talk
Sent: Wednesday, September 1, 2021 3:43 PM
To: EPICS Tech Talk <tech-talk at aps.anl.gov>
Subject: subArray behavior reading just 1 element

 

Hello everyone,

 

I have a quick question,

 

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

 

softIoc -d test.db

 

But it doesn't work as subarr INDX >= MALM (https://github.com/epics-base/epics-base/blob/R7.0.4/modules/database/src/std/rec/subArrayRecord.c#L308), and it always return the first element of the waveform. Is that the expected behavior? This seems odd to me as INDX refers to an index of the waveform record and MALM refers to the maximum number of elements of the subarray record. But I might be missing something.

 

Using EPICS 7.0.4.1

 

Thanks!

 

Lucas


-- 
Complexity comes for free, simplicity you have to work for.


Replies:
Re: subArray behavior reading just 1 element Lucas Russo 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

Navigate by Date:
Prev: Re: subArray behavior reading just 1 element Lucas Russo via Tech-talk
Next: Re: subArray behavior reading just 1 element Lucas Russo 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  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: subArray behavior reading just 1 element Lucas Russo via Tech-talk
Next: Re: subArray behavior reading just 1 element Lucas Russo 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  <20212022  2023  2024 
ANJ, 01 Sep 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·