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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: monitors on array variables |
From: | "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "D. Peter Siddons" <siddons at bnl.gov> |
Cc: | EPICS tech-talk <tech-talk at aps.anl.gov> |
Date: | Tue, 24 Mar 2020 16:58:46 +0000 |
Hi Pete, On Mar 24, 2020, at 7:15 AM, D. Peter Siddons via Tech-talk <tech-talk at aps.anl.gov> wrote:
I never did understand how arrays are handled in EPICS. Do I really need two fields in the database, a value and a buffer? How does it work? If there were only one field it would make life much simpler! It is possible to use just one field, not sure when that because possible – I think it was quite a long time ago, but we couldn’t modify the waveform record to do that because of all of the out-of-tree device support code that was written to use two fields.
The newer lsi and lso (long string in/out) records that were added in 3.15 use one field for their VAL (and OVAL) fields like this:
In the Record.dbd file (I have removed some lines that aren’t relevant to this topic):
The init_record() routine sets the VAL field like this:
In cvt_dbaddr() I do this:
And in the monitor() subroutine the event is posted like this:
The cvt_dbaddr() routine does have to point paddr->field to the actual array data as that’s where the server copies the array values from. The only time when you could skip doing that is if your DBD file defines the field in extra() as a fixed-size array.
HTH,
- Andrew
--
Complexity comes for free, simplicity you have to work for.
|