Hi Vishnu,
> Do any one doing multiple callback for same channel till all the buffered data pushed out to waveform record with same interrupt node?
I don’t think that is possible.
This the relevant code snippet:
static void interruptCallback(void *drvPvt, asynUser *pasynUser, \
EPICS_TYPE *value, size_t len) \
{ \
devAsynWfPvt *pPvt = (devAsynWfPvt *)drvPvt; \
waveformRecord *pwf = (waveformRecord *)pPvt->pr; \
int i; \
EPICS_TYPE *pData = (EPICS_TYPE *)pwf->bptr; \
\
…
dbScanLock((dbCommon *)pwf); \
if (len > pwf->nelm) len = pwf->nelm; \
for (i=0; i<(int)len; i++) pData[i] = value[i]; \
pwf->time = pasynUser->timestamp; \
pPvt->gotValue++; \
pPvt->nord = (epicsUInt32)len; \
if (pPvt->status == asynSuccess) pPvt->status = pasynUser->auxStatus; \
dbScanUnlock((dbCommon *)pwf); \
if (pPvt->isOutput) \
scanOnce((dbCommon *)pwf); \
else \
scanIoRequest(pPvt->ioScanPvt); \
So your driver passes “*value” (pointer to array) and “len” (number of elements in array) to the callback function. If NELM is less than “len” it only copies NELM elements. It does
not pass back the actual number of elements copied to your driver, so your driver would not know how to loop.
You could send NELM to your driver by some mechanism, and then your driver could loop. However, you would need to enable ring buffers in the waveform record device support, otherwise
it is likely that when you do the callback for the next loop you will simply overwrite the data from the previous callback, because the record will not have had a chance to process yet.
Why are you trying to set NELM less than 100?
Mark
From: [email protected] [mailto:[email protected]]
On Behalf Of Vishnu Patel
Sent: Tuesday, February 24, 2015 2:39 PM
To: techtalk
Subject: multiple interrupt callback for waveform record
Hi,
In my asynDriver based driver, i am acquiring 100 data points in the poling mode and then call interrupt callback for waveform record for each channel.
If i keep my NELM field more than 100 in the application waveform record, it works fine and i am not loosing any data. but if application have waveform record NELM less then 100, i am loosing data.
I tried to run loop for calling interrupt call back function upto 100 data points over but it seems it doesn't call callback after once called. and need end and restart interrupt.
The way i am calling interrupt is as below with addr=channel number.
p_interruptFloat32Array->pasynUser->auxStatus = interrupt_status[addr];
p_interruptFloat32Array->callback(p_interruptFloat32Array->userPvt,
p_interruptFloat32Array->pasynUser, buffer[addr], threshold);
Do any one doing multiple callback for same channel till all the buffered data pushed out to waveform record with same interrupt node?
Get your own
FREE website,
FREE domain &
FREE mobile app with Company email.
|
Know
More >
|