Dear all,
We have a question about a SRQ support which uses asyn(R4-10).
We are developing a device support for a waveform digitizer which
employs
the vxi11 protocol. It basically works properly except for the SRQ
function.
What happens is as follows:
When we receive SRQ from the device, the following message comes up
and the readout of the status byte fails:
2009/01/15 17:21:35.042 inst0 vxiCreateDeviceLink error VXI:
out of resources L0 vxiCreateDevLink failed for addr 0
2009/01/15 17:21:35.042 L0 addr 0 asynGpib:srqPoll serialPoll error
We chased this error within the asyn code and found that it comes
from the function of vxiSerialPll() in asyn/vxi11/drvVxi11.c:
---------------------------
static asynStatus vxiSerialPoll(void *drvPvt, int addr,
double timeout,int *statusByte)
{
...
if(!pdevLink->lid) {
Device_Link lid;
if(!vxiCreateDevLink(pvxiPort,addr,&lid)) {
printf("%s vxiCreateDevLink failed for addr %d\n",
pvxiPort->portName,addr);
return asynError;
}
pdevLink->lid = lid;
}
...
}
----------------------------
This function judges whether the connection has been made or not by
checking
the value of "lid"; "non-zero" means "connected", and "zero" means
"not connected".
In the case of the device we are struggling with, Device_Link can
be "zero"
even if the connection succeeds. (I heard that this behavior of the
device
does not violate the vxi11 specifications.)
And the problem happens when Device_Link is zero.
We therefore modified the above code as shown below:
----------------------------
if(!pdevLink->conneced) { /* Modified */
Device_Link lid;
if(!vxiCreateDevLink(pvxiPort,addr,&lid)) {
printf("%s vxiCreateDevLink failed for addr %d\n",
pvxiPort->portName,addr);
return asynError;
}
pdevLink->lid = lid;
pdevLink->conneced = TRUE; /* Added */
}
----------------------------
By this modification, everything seems to work properly now.
What we'd like to know is whether this modification is reasonable or
not;
we wonder if the original code employs "lid" instead of "connected"
because of some important reason we don't know.
Does anybody kindly tell us about this, please?
Many thanks in advance.
Best regards,
Takashi Asakawa
Yokogawa Electric Corporation, Japan