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: | "D. Peter Siddons via Tech-talk" <tech-talk at aps.anl.gov> |
To: | Michael Davidsaver <mdavidsaver at gmail.com> |
Cc: | EPICS Tech-Talk <tech-talk at aps.anl.gov> |
Date: | Tue, 24 Mar 2020 08:15:17 -0400 |
Hi Michael,
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!
In cvt_dbaddr, do I need the
paddr->pfield = (void *)(pzDDM->pspct); statement? Pete.
On 3/23/20 10:32 AM, Siddons, David wrote:Hi Mark, Michael, Adding Michaels post-all command at the end of process() and special() made things update properly.Excellent, so it is only a question of sorting out the arguments passed to db_post_events().Also, replacing that command at the end of special() with scanOnce() had the same effect. I'm afraid I don't understand things deeply enough to know why the individual posts didn't work. I would offer to send the code, but it is long and complicated and I don't want to bother you with it. At least I can move forward with other implementation details still to be done. If you have any further suggestions for things to try I'd be grateful.From the number of alternatives commented out, I take it that this is where your having problems.// db_post_events(pscal,&(pscal->runno),DBE_VALUE); // db_post_events(pscal,&(pscal->mca),DBE_VALUE); // db_post_events(pscal,&(pscal->tdc),DBE_VALUE); // db_post_events(pscal,&(pscal->spct),DBE_VALUE); db_post_events(pscal,NULL,0xf);https://github.com/dpsiddons/Hera-384/blob/889be28db1ae736f3a14b44988544e55fd765fb0/Mars_DDM/zDDMApp/src/zDDMRecord.c#L769-L773 Since you used it in your mails, I'll take SPCT as an example. I think what you have here would be correct, including the `&`, except for the code in cvt_dbaddr()case zDDMRecordSPCT:{ paddr->pfield = (void *)(pzDDM->pspct);https://github.com/dpsiddons/Hera-384/blob/889be28db1ae736f3a14b44988544e55fd765fb0/Mars_DDM/zDDMApp/src/zDDMRecord.c#L255-L256 Because `DBADDR::pfield` is being overwritten, it is necessary to post using the address being stored in pfield.db_post_events(pscal, pscal->pspct, DBE_VALUE);Note the absence of `&` as the address being assigned to `pfield` is the address of the allocation, not the address of the zDDMRecord::pspct field. Also, as a note. To be archiver friendly, the usual mask is 'DBE_VALUE|DBE_ARCHIVE'.