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
This message and any attachments may contain proprietary or confidential information. If you are not the intended recipient or you received the message in error, you must not use, copy or distribute the message. Please notify the sender immediately and destroy the original message. Thank you.