|
|
Experimental Physics and
| ||||||||||||||
|
|
> Jeff, > > Where is the address assigned to the monitor subscription data structures? > I saw what you are disscussing in db_post_events() but I couldn't determine > where the address is stored when the monitor is registered. > > Geoff > J. Frederick Bartlett ([email protected]) wrote: >... To my considerable surprise, I found that the CA client received monitor events for the STATUS field but not for the VAL field. ... So, how should I handle the monitoring of a VAL (or any other) field that has the SPC_DBADDR property?
A brief summary is. When a CA client connects to a field of a record. 1) A DBADDR structure is allocated. 2) dbNameToAddr is called. It assigns values to the members of DBADDR. 3) If the fields has been declared SPC_DBADDR then the record support routine cvt_dbaddr is called. It is allowed to change any of the following members of DBADDR: no_elements, field_type, field_size, special, pfield, and dbr_type. For example the waveformRecord cvt_dbaddr is static long cvt_dbaddr(paddr)
struct dbAddr *paddr;
{
struct waveformRecord *pwf=(struct waveformRecord *)paddr->precord; paddr->pfield = (void *)(pwf->bptr);
paddr->no_elements = pwf->nelm;
paddr->field_type = pwf->ftvl;
if(pwf->ftvl==0) paddr->field_size = MAX_STRING_SIZE;
else paddr->field_size = sizeofTypes[pwf->ftvl];
paddr->dbr_field_type = pwf->ftvl;
return(0);
}Since it set pfield = bptr it calls db_post_events(pwf,pwf->bptr,monitor_mask); rather than db_post_events(pwf,pwf->val,monitor_mask); Note that section 11.5.8 says that the record support routine "get_array_info" is also allowed to change pfield. This allows record support to implement double buffering. I hope this helps. Marty Kraimer
| ||||||||||||||
| ANJ, 10 Aug 2010 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
· Distributions · Download · Documents · Links · Licensing · |