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  2016  2017  2018  2019  2020  2021  <20222023  2024  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  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Adding a second output array to an areaDetector IOC
From: Iain Marcuson via Tech-talk <tech-talk at aps.anl.gov>
To: Mark Rivers <rivers at cars.uchicago.edu>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 31 Jan 2022 14:52:49 +0000

I didn’t change ASYN_MULTIDEVICE, but I did pass maxAddr=2.

 

My reason for doing this was largely to learn some more EPICS internals, as opposed to a practical end.

 

I can try out some of those suggestions.  Thank you.

 

From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Sunday, January 30, 2022 6:18 PM
To: Iain Marcuson <iain.marcuson at sydortechnologies.com>; tech-talk at aps.anl.gov
Subject: RE: Adding a second output array to an areaDetector IOC

 

Did you pass the ASYN_MULTIDEVICE flag to ADDriver in your constructor, and pass maxAddr=2 rather than 1?  I am not sure that is actually required since you only need 1 parameter library list, but it is a good idea.

 

Is there a reason you are using an NDArray for your profile, rather than a simple waveform record?

 

Using different addr fields for different NDArray meanings is implemented in a number of plugins, so I know that it works:

  • NDPluginAttribute (maxAddr=2)
  • NDPluginStats (maxAddr=2)
  • NDPluginTimeSeries (maxAddr=maxSignals+1, where maxSignals is passed to the constructor).

 

You could look at those for information.

 

Mark

 

 

 

From: Iain Marcuson <iain.marcuson at sydortechnologies.com>
Sent: Sunday, January 30, 2022 4:05 PM
To: Mark Rivers <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov
Subject: RE: Adding a second output array to an areaDetector IOC

 

I apologize for the long delay.  I did try changing “addr” in the second call.  That did indeed keep pImage from being overwritten.  However, the data in pProfile were being overwritten.  When I used an addr of 0, the pProfile data were correct (I used fixed values for debugging.)  However, when I used an addr of 1, the values coming from pProfile were very incorrect, despite having been written right before a getIntegerParam() and the doCallbacksGenericPointer(pImage, NDArrayData, 0).  I am unsure what would cause the issues I was seeing.

 

From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Monday, January 24, 2022 9:48 PM
To: tech-talk at aps.anl.gov; Iain Marcuson <iain.marcuson at sydortechnologies.com>
Subject: Re: Adding a second output array to an areaDetector IOC

 

Hi Iain,

 

Before answering your question, I have 2 suggestions:

 

  • NDPluginStats already has the capability of displaying profiles.  These can be the average profiles in the X and Y directions, the X and Y profiles at the centroid position, and the X and Y profiles at a user-specifed "cursor" position.
  • If you want to export a profile directly from the driver, I don't think you really need to use an NDArray for that, you can just use a simple 1-D array and a waveform record.

If you really do want to export an NDArray then you just need need to change "addr" in the second call to 1, because that is the addr you defined for the xprof profile.

 

       doCallbacksGenericPointer(pImage, NDArrayData, 0);

       // And call for profile

      doCallbacksGenericPointer(pProfile, NDArrayData, 1);

 

Mark

 


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Iain Marcuson via Tech-talk <tech-talk at aps.anl.gov>
Sent: Monday, January 24, 2022 6:02 PM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: RE: Adding a second output array to an areaDetector IOC

 

As an addendum, I was able to get $(P)xprof:ArrayData updating by doing

caput $(P)xprof:EnableCallbacks 1

 

although I still have the problem of the output data collision.

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Iain Marcuson via Tech-talk
Sent: Monday, January 24, 2022 6:46 PM
To: tech-talk at aps.anl.gov
Subject: Adding a second output array to an areaDetector IOC

 

I am working on a custom areaDetector IOC and also trying to learn more of the general areaDetector architecture.  For a first test, I have tried to add some profile functionality to the IOC.

 

I have started by creating an array for the output, following the example from mythen.

 

# Create a standard arrays plugin

NDStdArraysConfigure("Image1", 3, 0, "$(PORT)", 0, 0)

dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=image1:,PORT=Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),NDARRAY_ADDR=0,TYPE=Float64,FTVL=DOUBLE,NELEMENTS=$(NCHANS)")

 

# Create a standard arrays plugin for column profile

NDStdArraysConfigure("XProfile", 3, 0, "$(PORT)", 0, 0)

dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=xprof:,PORT=XProfile,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),NDARRAY_ADDR=1,TYPE=Float64,FTVL=DOUBLE,NELEMENTS=$(NCOLS)")

 

In the callback of the IOC, I create an NDArray for a column profile and populate the array.

 

When I run the IOC and start acquisition, $(P)xprof:ArrayData is undefined but of the correct size.  When I look at the image output in ImageJ, the display flickers between the full image and a one-row display of the profile data.  Some experimentation leads me to believe that the problem comes from the following lines:

 

if (arrayCallbacks) {

        /* Call the NDArray callback */

        doCallbacksGenericPointer(pImage, NDArrayData, 0);

                // And call for profile

                doCallbacksGenericPointer(pProfile, NDArrayData, 0);

    }

 

How can I get the two data separate?  Is the solution to make a profile plugin and feed the data to that?

 

Thank you,

 

Iain Marcuson

Software Engineer, Sydor Technologies

585.278.1168 | www.SydorTechnologies.com

Skype: iain.marcuson at sydorinstruments.com

 

 

This message has been scanned for malware by Forcepoint. www.forcepoint.com

 

Click here to report this email as spam.


References:
Adding a second output array to an areaDetector IOC Iain Marcuson via Tech-talk
RE: Adding a second output array to an areaDetector IOC Iain Marcuson via Tech-talk
Re: Adding a second output array to an areaDetector IOC Mark Rivers via Tech-talk
RE: Adding a second output array to an areaDetector IOC Iain Marcuson via Tech-talk
RE: Adding a second output array to an areaDetector IOC Mark Rivers via Tech-talk

Navigate by Date:
Prev: Questions from the Static Database Access chapter of the Application Developer's Guide Wang, Andrew via Tech-talk
Next: Re: motor record field assignment problem Kevin Peterson via Tech-talk
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  <20222023  2024 
Navigate by Thread:
Prev: RE: Adding a second output array to an areaDetector IOC Mark Rivers via Tech-talk
Next: p4p releases 3.5.5 and 4.0.0 Michael Davidsaver via Tech-talk
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  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·