Hi Marcin,
Your startup script has:
dbpf TEST:NDimensions 2
DBR_LONG: 2 0x2
dbpf TEST:Dimensions 1236
DBR_LONG: 1236 0x4d4
So you are setting the number of dimensions to 2, but only defining the first dimension. If the second dimension is not defined then you might get that error.
This is the code where the error you are seeing is coming from:
/* Allocate the raw buffer we use to compute images. */
this->pArrays[0] = this->pNDArrayPool->alloc(numDimensions, arrayDimensions_, (NDDataType_t)dataType, 0, NULL);
pArray = this->pArrays[0];
if (!pArray) {
asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR,
"%s:%s: error allocating raw buffer\n",
driverName, functionName);
return asynError;
}
You could add this debugging statement right before the first line above to see if it explains the problem:
printf(“numDimensions=%d, arrayDimensions_=[%d, %d], dataType=%d\n”, numDimensions, arrayDimensions_[0], arrayDimensions_[1], dataType);
Mark
Hi all,
I have a problem with the proper configuration of NDDriverStdArrays areaDetector driver.
To test my settings, I have prepared IOC which contains NDDriverStdArrays driver and NDStdArrays plugin.
To caput picture 1236x1236 as a waveform I am using quick python script:
#!/usr/bin/env python
import epics
import numpy as np
import time
while(1):
for x in range(17):
data="">
pv=epics.PV('TEST:ArrayIn')
pv.put(data)
time.sleep(1)
However, I am receiving following error:
2017/04/10 19:46:38.422 NDDriverStdArrays:writeXXXArray: error allocating raw buffer
2017/04/10 19:46:38.422 TEST:ArrayIn devAsynInt16Array::callbackWfOut write error
It looks like my settings are incorrect somewhere. Has anyone encountered this problem before?
Full st.cmd below.
Many thanks,
Marcin
#!../../bin/linux-x86_64/testAD
## You may have to change testAD to something else
## everywhere it appears in this file
< envPaths
epicsEnvSet("IOC","ioctestAD")
epicsEnvSet("TOP","/home/eli_sw/work/testAD")
epicsEnvSet("SUPPORT","/home/eli_sw/epics/support")
epicsEnvSet("AREA_DETECTOR","/home/eli_sw/epics/support/areaDetector-2-6")
epicsEnvSet("ADCORE","/home/eli_sw/epics/support/areaDetector-2-6/ADCore")
epicsEnvSet("NDDRIVERSTDARRAYS","/home/eli_sw/epics/support/areaDetector-2-6/NDDriverStdArrays")
epicsEnvSet("ASYN","/home/eli_sw/epics/support/asyn-4-31")
epicsEnvSet("BUSY","/home/eli_sw/epics/support/busy-1-6-1")
epicsEnvSet("EPICS_BASE","/home/eli_sw/epics/R3.15")
cd "/home/eli_sw/work/testAD"
# Prefix for all records
epicsEnvSet("PREFIX", "TEST:")
# The port name for the NDStdArray driver
epicsEnvSet("NDPORT", "NDSA")
# The queue size for all plugins
epicsEnvSet("QSIZE", "3")
# The maximim image width; used to set the maximum size for this driver and for row profiles in the NDPluginStats plugin
epicsEnvSet("XSIZE", "1236")
# The maximim image height; used to set the maximum size for this driver and for column profiles in the NDPluginStats plugin
epicsEnvSet("YSIZE", "1236")
# The maximum number of time series points in the NDPluginStats plugin
epicsEnvSet("NCHANS", "1236")
# The maximum number of frames buffered in the NDPluginCircularBuff plugin
epicsEnvSet("CBUFFS", "500")
# The search path for database files
epicsEnvSet("EPICS_DB_INCLUDE_PATH", "/home/eli_sw/epics/support/areaDetector-2-6/ADCore/db")
# The number of elements in the driver waveform record
epicsEnvSet("NELEMENTS", 1527696)
# The datatype of the waveform record
epicsEnvSet("FTVL", "USHORT")
# The asyn interface waveform record
epicsEnvSet("TYPE", "Int16")
#asynSetMinTimerPeriod(0.001)
epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES", "10000000")
## Register all support components
dbLoadDatabase "dbd/testAD.dbd"
testAD_registerRecordDeviceDriver pdbbase
#-----------------------------------------------------------------------------------
# Create an NDDriverStdArrays driver
# NDDriverStdArraysConfig(portName, maxBuffers, maxMemory, priority, stackSize)
NDDriverStdArraysConfig("NDSA", 3, 0, 0)
dbLoadRecords("/home/eli_sw/epics/support/areaDetector-2-6/NDDriverStdArrays/db/NDDriverStdArrays.template","P=TEST:,R=,PORT=NDSA,ADDR=0,TIMEOUT=1,NELEMENTS=1527696,TYPE=Int16,FTVL=USHORT")
#-----------------------------------------------------------------------------------
# Create an NDStdArrays plugins
# NDStdArraysConfigure (const char *portName, int queueSize, int blockingCallbacks,
# const char *NDArrayPort, int NDArrayAddr, size_t maxMemory,
# int priority, int stackSize)
NDStdArraysConfigure("Image1", 3, 0, NDSA, 0)
dbLoadRecords("NDStdArrays.template", "P=TEST:,R=image1:,PORT=Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=NDSA,TYPE=Int16,FTVL=USHORT,NELEMENTS=1527696")
## Load record instances
#dbLoadRecords("db/xxx.db","user=m")
#asynSetTraceMask $(NDPORT) 0 0xFF
#synSetTraceInfoMask $(NDPORT) 0 0x7
cd "/home/eli_sw/work/testAD/iocBoot/ioctestAD"
iocInit
Starting iocInit
############################################################################
## EPICS R3.15.4 $Date: Fri 2016-05-27 08:54:04 +0200$
## EPICS Base built Mar 28 2017
############################################################################
iocRun: All initialization complete
## Start any sequence programs
#seq sncxxx,"user=m"
dbpf TEST:NDimensions 2
DBR_LONG: 2 0x2
dbpf TEST:Dimensions 1236
DBR_LONG: 1236 0x4d4
dbpf TEST:DataType UInt16
DBR_STRING: "UInt16"
dbpf TEST:ColorMode Mono
DBR_STRING: "Mono"
dbpf TEST:Acquire 1
DBR_STRING: "Acquire"
epics> 2017/04/10 20:10:33.858 NDDriverStdArrays:writeXXXArray: error allocating raw buffer
2017/04/10 20:10:33.858 TEST:ArrayIn devAsynInt16Array::callbackWfOut write error
2017/04/10 20:10:35.009 NDDriverStdArrays:writeXXXArray: error allocating raw buffer
2017/04/10 20:10:35.009 TEST:ArrayIn devAsynInt16Array::callbackWfOut write error
2017/04/10 20:10:36.160 NDDriverStdArrays:writeXXXArray: error allocating raw buffer
2017/04/10 20:10:36.160 TEST:ArrayIn devAsynInt16Array::callbackWfOut write error
2017/04/10 20:10:37.322 NDDriverStdArrays:writeXXXArray: error allocating raw buffer
2017/04/10 20:10:37.323 TEST:ArrayIn devAsynInt16Array::callbackWfOut write error
2017/04/10 20:10:38.521 NDDriverStdArrays:writeXXXArray: error allocating raw buffer
2017/04/10 20:10:38.521 TEST:ArrayIn devAsynInt16Array::callbackWfOut write error