EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: areaDetector with 'empty' array output
From: Phil Atkin <[email protected]>
To: [email protected]
Date: Mon, 25 Jul 2016 11:35:05 +0100
Hi,

My areaDetector plugin has an option to generate an array containing a 'list' of events.  In pseudocode, it does something like the following in the processCallbacks method:

    if (this->pArrays[0]) {
        this->pArrays[0]->release();
        this->pArrays[0] = NULL;
    }
   
    this->unlock();

        // Copy the events list to the output array
        size_t count = events.size();
        dims[xDim] = count;
        dims[yDim] = 3; // x, y and type
        this->pArrays[0] = pNDArrayPool->alloc(2, dims, NDFloat32, 0, nullptr);

    this->pArrays[0]->timeStamp = pArray->timeStamp;
    this->pArrays[0]->epicsTS = pArray->epicsTS;
    this->pArrays[0]->uniqueId = pArray->uniqueId;
    pArray->pAttributeList->copy(this->pArrays[0]->pAttributeList);

    this->lock();
    // [Set some parameter values, including NDArraySizeX,Y,Z]
    this->getAttributes(this->pArrays[0]->pAttributeList);
    this->unlock();
    doCallbacksGenericPointer(this->pArrays[0], NDArrayData, 0);
    this->lock();
    callParamCallbacks();
Currently I'm experiencing a crash if there are no events in the list.  pNDArrayPool->alloc returns null if count is zero.  I guess this is neither surprising nor unreasonable, but it leaves me with the question of what I should (and should not) do if the list is empty.  I somehow need to 'output' something, otherwise plugins downstream won't be called, will they?

Thanks in advance,

Phil

--
Pixel Analytics is a limited company registered in England. Company number: 7747526; Registered office: 93A New Road, Haslingfield, Cambridge CB23 1LP

Replies:
RE: areaDetector with 'empty' array output Mark Rivers

Navigate by Date:
Prev: Can I start a pcaspy ioc together with a streamdevice ioc Silver
Next: may I start a pcaspy ioc together with a streamdevice ioc? Silver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Can I start a pcaspy ioc together with a streamdevice ioc Silver
Next: RE: areaDetector with 'empty' array output Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 25 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·