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: RE: areaDetector with 'empty' array output
From: Mark Rivers <[email protected]>
To: "'Phil Atkin'" <[email protected]>, "[email protected]" <[email protected]>
Date: Mon, 25 Jul 2016 14:47:48 +0000

Rather than using a 0 array dimension to signal no events, could you use a special data value instead?  Make a 1x1 array with value=0 or -1 or something to signal no events?

 

By using the data rather than the dimension you could then use NDPluginCircularBuff to trigger some action on the special value.

 

Mark

 

 

From: Phil Atkin [mailto:[email protected]]
Sent: Monday, July 25, 2016 9:17 AM
To: Mark Rivers; [email protected]
Subject: Re: areaDetector with 'empty' array output

 

Perhaps a better example: suppose we want to plot the events as each camera frame is processed?  If there are no events, we want to clear the display.

Phil

 

On 25/07/2016 13:44, Mark Rivers wrote:

I'm not sure I understand the question.  If count is 0 then is there any point in allocating the NDArray and doing callbacks?  Do you still want to pass NDAttributes to downstream plugins?  If not, then why not just skip the NDArray allocation and callbacks when count is 0?
 
Mark
 
________________________________
From: [email protected] [[email protected]] on behalf of Phil Atkin [[email protected]]
Sent: Monday, July 25, 2016 5:35 AM
To: [email protected]
Subject: areaDetector with 'empty' array output
 
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
 
--
[cid:[email protected]]Pixel Analytics is a limited company registered in England. Company number: 7747526; Registered office: 93A New Road, Haslingfield, Cambridge CB23 1LP
 

 

--
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 Phil Atkin
References:
areaDetector with 'empty' array output Phil Atkin
RE: areaDetector with 'empty' array output Mark Rivers
Re: areaDetector with 'empty' array output Phil Atkin

Navigate by Date:
Prev: Re: MEDM installation error on Linux Mint (libXp.a error) Michael Westfall
Next: Re: areaDetector with 'empty' array output Phil Atkin
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: Re: areaDetector with 'empty' array output Phil Atkin
Next: Re: areaDetector with 'empty' array output Phil Atkin
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 ·