1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 <2015> 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 <2015> 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: multiple interrupt callback for waveform record |
From: | Mark Rivers <[email protected]> |
To: | "'Vishnu Patel'" <[email protected]>, "techtalk " <[email protected]> |
Date: | Tue, 24 Feb 2015 21:21:57 +0000 |
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
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. if (interrupt[addr]) {
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? Thanks Vishnu
|