Experimental Physics and
| |||||||||||||||||
|
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/24/20 1:08 AM, Michael Davidsaver
wrote:
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'.
| ||||||||||||||||
ANJ, 24 Mar 2020 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |