Experimental Physics and
| |||||||||||||||
|
Hi all,
When using devGpib inconjuction with ASYN, I sometimes want to store port
specific user status data (as opposed to record specific state data).
Suppose the gpibCmds table may look like:
static struct gpibCmd gpibCmds[] = {
/* 0 - Frequency Monitor */
{&DSET_AI, GPIBCVTIO, IB_Q_LOW, NULL, NULL, 20, 20,
performIo, 12, 0, NULL, NULL, 0},
/* 1 - Frequency Set Point */
{&DSET_AO, GPIBCVTIO, IB_Q_LOW, NULL, NULL, 0, 20,
performIo, 12, 0, NULL, NULL, "\033"},
.... etc
};
In the performIo function is it possible to do something like the following:
typedef struct portState {
int Count;
....;
} portState;
static int performIo (struct gpibDpvt *pdpvt, int P1, int P2, char **P3)
{
portState *pPortState;
pPortState = pdpvt->????->????->????;
if (pPortState == NULL) {
/* Allocate port specific data
*/
pPortState = dbCalloc (1, sizeof (portState));
pdpvt-????->????->???? = pPortState;
/* Initialise port specific data
*/
pPortState->Count = 0;
.....;
}
pPortState->Count++;
.....;
}
And if so, what can I safely use for ????->????->????
I have a work around by extracting the port number xxx corresponding
to the
field (INP, "#Lxxx Aaaa @ccc");
from the inp/out field of the record, but this seems a bit of a hack.
Regards
Andy
Andrew Starritt, Principal Controls Engineer, Australian Synchrotron
800 Blackburn Road, Clayton, Victoria 3168
| ||||||||||||||
ANJ, 31 Jan 2014 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |