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.