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 2022 2023 2024 <2025> | 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 2022 2023 2024 <2025> |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: Using AD plugins on asyn port |
From: | Abdalla Ahmad via Tech-talk <tech-talk at aps.anl.gov> |
To: | Mark Rivers <rivers at cars.uchicago.edu>, "Johnson, Andrew N." <anj at anl.gov>, "Pearson, Matthew" <pearsonmr at ornl.gov>, "tech-talk at aps.anl.gov" <Tech-talk at aps.anl.gov> |
Date: | Wed, 23 Jul 2025 09:20:49 +0000 |
Hi all Thanks for the feedback, I created an IOC with NDDriverStdArrays support, attached
is the startup file. The ArrayIn PV is receiving data from my waveform record through an intermediate ‘aao’ record in the attached nd.db database, where the DOL field is set to a waveform of size 200 scanned at 1 second. The IOC boots but when I press acquire
on the GUI, the IOC segfaults immediately. I added the gdb output of loading the core dump at the end of the startup file, it always crashes here:
https://github.com/areaDetector/NDDriverStdArrays/blob/master/NDDriverStdArraysApp/src/NDDriverStdArrays.cpp#L259 . I used the IOC in the source
code but I got the same segfault at the same location. Could it be related to the fact that the array size is 0? I also attached a screenshot of the NDDriverStdArrays UI file. Am I missing something? Best Regards, Abdalla Al-Dalleh Control Engineer SESAME
From: Mark Rivers <rivers at cars.uchicago.edu>
That’s a very useful addition. Whether it can be used with NDDriverStdArrays depends on the behavior of the input waveform record you are copying via the aao record. If it only posts monitors when the waveform is
“done” then it could work. But in some applications the input waveform may process many times with “intermediate results” before it is really done. One example would be a waveform digitizer with relatively slow sample rate. The waveform record may be processing
multiple times during an acquisition so the operator can see the waveform trace update before it is complete. Another example is an MCA spectrum which is acquiring for a relative long time. The waveform will update during acquisition so the operator can
see the waveform amplitude grow. In these cases you probably don’t want the intermediate values of the waveform to be sent to NDDriverStdArrays, you only want to write the final value. That is where a more sophisticated CA client may be needed. Mark From: Johnson, Andrew N. <anj at anl.gov>
You can use an aao (array analog output) record to read array data from another record using the DOL input link and write it through
the OUT output link to another record. The DOL and OMSL fields were added to it in EPICS 7.0.7. - Andrew -- Complexity comes for free, Simplicity you have to work for. |
#!../../bin/linux-x86_64/ioc dbLoadDatabase "dbd/ioc.dbd" ioc_registerRecordDeviceDriver pdbbase < iocBoot/ioc/envPaths epicsEnvSet("PREFIX", "NDSA:") epicsEnvSet("PORT", "NDSA") epicsEnvSet("QSIZE", "20") epicsEnvSet("NELEMENTS", 200) epicsEnvSet("FTVL", "FLOAT") epicsEnvSet("TYPE", "Float32") epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(ADCORE)/db") dbLoadRecords("db/test.db") NDDriverStdArraysConfig("$(PORT)", $(QSIZE), 0, 0) dbLoadRecords("$(NDDRIVERSTDARRAYS)/db/NDDriverStdArrays.template","P=$(PREFIX),R=cam1:,PORT=$(PORT),ADDR=0,TIMEOUT=1,NELEMENTS=$(NELEMENTS),TYPE=$(TYPE),FTVL=$(FTVL)") # asynSetTraceMask $(PORT) 0 0xFF # asynSetTraceInfoMask $(PORT) 0 0x7 NDStdArraysConfigure("Image1", 3, 0, "$(PORT)", 0) dbLoadRecords("NDStdArrays.template", "P=$(PREFIX),R=image1:,PORT=Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=$(TYPE),FTVL=$(FTVL),NELEMENTS=$(NELEMENTS)") iocInit dbpf NDSA:cam1:PoolUsedMem.SCAN Passive dbpf NDSA:image1:EnableCallbacks 1 dbpf NDSA:image1:ArrayCallbacks 1 ====== Core dump with GDB Core was generated by `./bin/linux-x86_64/ioc iocBoot/ioc/st.cmd'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f33834b2a1d in NDDriverStdArrays::writeXXXArray<float> (pasynUser=<optimized out>, nElements=1, pValue=<optimized out>, this=0x990070) at ../NDDriverStdArrays.cpp:259 259 for (i=numDimensions-1; i>0; i--) { [Current thread is 1 (Thread 0x7f33786d4700 (LWP 114206))]
Attachment:
nd.db
Description: nd.db
Attachment:
nd-gui.png
Description: nd-gui.png