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: Implementing NDTransform plugin for areaDetector
From: "Marco A. Barra Montevechi Filho via Tech-talk" <tech-talk at aps.anl.gov>
To: "Pearson, Matthew" <pearsonmr at ornl.gov>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 13 Sep 2022 19:39:57 +0000
Thanks!

In that case, if i want the image saved rotated, it should be something like:

dbpf MOBICDTE:Trans1:NDArrayPort "SIM1"
dbpf MOBICDTE:HDF1:NDArrayPort "TRANS1"
dbpf MOBICDTE:image:NDArrayPort "TRANS1"

?

I tried this and my visualizer (the PyDM AreaDetector display) got all black. I tried then starting acquisition and got:

epics> dbpf MOBICDTE:HDF1:NDArrayPort "TRANS1"
DBF_STRING:         "TRANS1"  
epics> dbpf MOBICDTE:image:NDArrayPort "TRANS1"
DBF_STRING:         "TRANS1"  
epics> dbgf MOBICDTE:image:EnableCallbacks
DBF_STRING:         "Enable"  
epics> dbgf MOBICDTE:HDF1:EnableCallbacks
DBF_STRING:         "Enable"  
epics> dbgf MOBICDTE:Trans1:EnableCallbacks
DBF_STRING:         "Disable"
epics> dbpf MOBICDTE:Trans1:EnableCallbacks 1
DBF_STRING:         "Enable"  
epics> dbpf MOBICDTE:Trans1:Type 1mobipix:initDevices: entering
chunk_size: 262144, total: 524288000
chunk_size: 128, total: 256000
../mobipix.cpp, V4LTask (182): entering, index=0, device=/dev/video0, fd=32
../mobipix.cpp, V4LTask (190) about to VIDEOC_STREAMON, dev: /dev/video0
../mobipix.cpp, V4LTask (182): entering, index=1, device=/dev/video1, fd=33
../mobipix.cpp, V4LTask (190) about to VIDEOC_STREAMON, dev: /dev/video1
2022/06/22 19:47:06.547 asynPortDriver:getAddress: TRANS1 invalid address=2, must be in range 0 to 0
2022/06/22 19:47:07.333 asynPortDriver:getAddress: TRANS1 invalid address=2, must be in range 0 to 0
2022/06/22 19:47:08.433 asynPortDriver:getAddress: TRANS1 invalid address=2, must be in range 0 to 0
2022/06/22 19:47:09.533 asynPortDriver:getAddress: TRANS1 invalid address=2, must be in range 0 to 0
2022/06/22 19:47:10.635 asynPortDriver:getAddress: TRANS1 invalid address=2, must be in range 0 to 0

And the messages kept going untill i finally gave up and stopped acquisition. I suspect this has something to do with MOBICDTE:image:NDArrayAddress = 2 and MOBICDTE:Trans1:NDArrayAddress = 0. But i cannot understand exactly what is going on or what is the problem with Trans1:NDArrayAddress being equal to 2.

I found this in the st.cmd file that i think helps in the discussion:

# mobipixConfig(const char *portName, int maxSizeX, int maxSizeY, int dataType,
#                   int maxBuffers, int maxMemory, int priority, int stackSize)
mobipixConfig("SIM1", 512, 512, 3, 0, 0)
#... a few lines after:

dbLoadRecords("NDStdArrays.template", "P=MOBICDTE:,R=image:,PORT=Image,ADDR=2,TIMEOUT=2,NDARRAY_PORT=SIM1,TYPE=Int16,FTVL=SHORT,NELEMENTS=12000000")


But im still kinda lost.


From: Pearson, Matthew <pearsonmr at ornl.gov>
Sent: 13 September 2022 16:09
To: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: RE: Implementing NDTransform plugin for areaDetector
 

Hi,

 

I think you need to chain the plugins together, rather than have them all point to SIM1.

 

If you modify the StdArray plugins to register for callbacks from TRANS1, it should work.

 

For example:

SIM1->TRANS1->Image

 

The HDF plugin can either point to the SIM1 or TRANS1, depending on if you want the saved image rotated or not.

 

Cheers,

Matt

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Marco A. Barra Montevechi Filho via Tech-talk
Sent: Tuesday, September 13, 2022 2:59 PM
To: tech-talk at aps.anl.gov
Subject: [EXTERNAL] Implementing NDTransform plugin for areaDetector

 

Hello all.

Im implementing the NDTransform plugin for an areaDetector IOC made here and following these documentations for this: https://areadetector.github.io/master/ADCore/NDPluginTransform.html# https://areadetector.github.io/master/ADCore/NDPluginDriver.html and https://areadetector.github.io/master/ADCore/NDPluginTransform.html#.



Basically, i want a given image to rotate by 90 degrees and the documentation made me believe that this shouldnt be much trouble. The Array i want to rotate is a PV called MOBICDTE:image:ArrayData. I currently load the plugins via standard plugin file: commonPlugins.cmd inside ADCore and it seems to work since we are saving files in hdf5 format with the HDF plugin. The HDF plugin was also loaded with default macros from commonPlugins.cmd.

However, when i try to rotate the image by doing:

dbpf MOBICDTE:Trans1:EnableCallbacks 1

dbpf MOBICDTE:Trans1:Type 1

simply nothing changes in my visualizer when i start acquisition. I tried changing the configurations in the default commonPlugins.cmd file and comparing them with MOBICDTE:image paramaters but im not getting any luck with this. Does anyone have any tips on how to proceed?

What i tried so far:

The initial configurations were as follows:

 

NDStdArraysConfigure("Image1", 200, 0, "SIM1", 0, 0, 0, 0, 0, 5)

NDStdArraysConfigure("Image2", 200, 0, "SIM1", 1, 0, 0, 0, 0, 5)

# *** image is a combined image of image1 and image2***

NDStdArraysConfigure("Image", 200, 0, "SIM1", 2, 0, 0, 0, 0, 5)

 

dbLoadRecords("NDStdArrays.template", "P=MOBICDTE:,R=image1:,PORT=Image1,ADDR=0,TIMEOUT=2,NDARRAY_PORT=SIM1,TYPE=Int16,FTVL=SHORT,NELEMENTS=12000000")

dbLoadRecords("NDStdArrays.template", "P=MOBICDTE:,R=image2:,PORT=Image2,ADDR=1,TIMEOUT=2,NDARRAY_PORT=SIM1,TYPE=Int16,FTVL=SHORT,NELEMENTS=12000000")

# *** combined image ***

dbLoadRecords("NDStdArrays.template", "P=MOBICDTE:,R=image:,PORT=Image,ADDR=2,TIMEOUT=2,NDARRAY_PORT=SIM1,TYPE=Int16,FTVL=SHORT,NELEMENTS=12000000")

 

... #Then elsewhere, from the commonPlugins.cmd file:

NDTransformConfigure("TRANS1", 200, 0, "SIM1", 0, 0, 0, 0, 0, 4)

dbLoadRecords("NDTransform.template", "P=MOBICDTE:,R=Trans1:,  PORT=TRANS1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=SIM1")

 

and by dbgf i could see that:


MOBICDTE:image:PluginType_RBV = NDPluginStdArrays
MOBICDTE:Trans1:PlguinType_RBV = NDPluginTransform

MOBICDTE:image:NDArrayPort_RBV = SIM1
MOBICDTE:Trans1:ArrayPort_RBV = SIM1

 

MOBICDTE:image:NDArrayAddress_RBV = 0x2
MOBICDTE:Trans1:NDArrayAddress_RBV = 0x0

 

MOBICDTE:image:QueueSize_RBV = 0xc8
MOBICDTE:Trans1:QueueSize_RBV = 0xc8

 

MOBICDTE:image:MaxThreads_RBV = 0x5
MOBICDTE:Trans1:MaxThreads_RBV = 0x4


So i thought i should change Trans1:NDArrayAddress to 0x2 by dbpf. Not only it did not work, but i also noticed that

 

MOBICDTE:HDF1:NDArrayAddress = 0x0

 

And the HDF plugin works fine, so i dont think the problem is the address anymore.



Am i doing something wrong? Im quite new to this plugin concept when applied to Area Detector. Thanks in advance for any help.

 

Aviso Legal: Esta mensagem e seus anexos podem conter informações confidenciais e/ou de uso restrito. Observe atentamente seu conteúdo e considere eventual consulta ao remetente antes de copiá-la, divulgá-la ou distribuí-la. Se você recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente.

Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately.


Replies:
RE: Implementing NDTransform plugin for areaDetector Pearson, Matthew via Tech-talk
References:
Implementing NDTransform plugin for areaDetector Marco A. Barra Montevechi Filho via Tech-talk
RE: Implementing NDTransform plugin for areaDetector Pearson, Matthew via Tech-talk

Navigate by Date:
Prev: RE: Implementing NDTransform plugin for areaDetector Pearson, Matthew via Tech-talk
Next: RE: Implementing NDTransform plugin for areaDetector Pearson, Matthew 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: Implementing NDTransform plugin for areaDetector Pearson, Matthew via Tech-talk
Next: RE: Implementing NDTransform plugin for areaDetector Pearson, Matthew 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 ·