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  <20132014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: areaDetector patches
From: Bruce Hill <bhill@slac.stanford.edu>
To: Mark Rivers <rivers@cars.uchicago.edu>
Cc: Techtalk <tech-talk@aps.anl.gov>
Date: Wed, 11 Dec 2013 15:08:37 -0800
Hi Mark,
I've been doing some updates to our version of areaDetector 1.9.1
recently, and wanted to share some of the patches with you in case
you find them helpful.

One easy one is maxBuffers-comment.patch.
It just updates the cpp comments re what values to use for
maxBuffers and maxMemory when you want unlimited use.

Another easy one is plugin-enable.patch, which just
allows us to configure at build time whether or not
a plugin is enabled.   It defaults to disabled as it is
in areaDetectorR1-9-1.

prosilica-gain.patch adds $(P)$(R)Gain to prosilica.template
so we can set DRVL, DRVH, etc for the prosilica cameras.

The most useful patch is probably prosilica-reconnect.patch,
which fixes a problem we've had when we use procServ to
restart our ioc.   This kills the ioc process without a clean shutdown,
so there's a delay of around 5 seconds before the prosilica lib
allows a master connection to the camera.   Before this patch,
our users have had to either do a manual connect or reboot
the ioc twice.

All the above patches are relative to the areaDetectorR1-9-1 files.

The remaining changes are more of a departure from
the current areaDetector release and include some binary
files, so I haven't attached patch files, but would be happy
to share any you find useful.

We had a need for a viewer to determine bytes per pixel
and bits per pixel for different plugins, so I've added
$(P)$(R):N_BYTES_PER_PIXEL and $(P)$(R)BIT_DEPTH
to NDPluginBase.template, which we configure via env
variables and dbLoad macros.

We use edm, so I have a lot of edm related changes.
I don't know if you'd want these, as they follow our
conventions for coloring, and use
areaDetectorScreens/<screen-name>.edl
for all related screen references.   I also added a
commonPlugins.edl.   I haven't had much success
with merging edm files, so if you'd like these, I can
send you a link for a tar file you can download.

I also have some build updates which I can get you
that you may not need.    For example, we needed to
build separate libs for RHEL6 vs RHEL5, so I added libs
and build settings for a rhel6-x86_64 architecture.
These require similar changes in EPICS base to add rhel6-x86_64.

For our 32bit RHEL5 build, I found we needed shared libs
for libhdf5 and libsz, so I've added libhdf5.so.7.0.1,
libsz.so.2.0.0, and associated variants like libhdf5.so.7
under ADApp/hdf5Support/os/linux-x86.

These updates include binary lib files, so if you'd like
them, I can send you a link for downloading from my
SLAC site.

Regards,
- Bruce

--
Bruce Hill
Member Technical Staff
SLAC National Accelerator Lab
2575 Sand Hill Road M/S 10
Menlo Park, CA  94025

Index: ADApp/perkinElmerSrc/PerkinElmer.cpp
===================================================================
--- ADApp/perkinElmerSrc/PerkinElmer.cpp	(revision 15144)
+++ ADApp/perkinElmerSrc/PerkinElmer.cpp	(working copy)
@@ -37,9 +37,9 @@
   *  IDType = 3 GigE detector, IDValue = detector name (e.g. 8#2608).  Can get network detector names with asynReport(10)
   * \param[in] IDValue The detector ID as explained above (IP name, MAC address, detector name)
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
@@ -62,9 +62,9 @@
   *  IDType = 3 GigE detector, IDValue = detector name (e.g. 8#2608).  Can get network detector names with asynReport(10)
   * \param[in] IDValue The detector ID as explained above (IP name, MAC address, detector name)
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/pilatusSrc/pilatusDetector.cpp
===================================================================
--- ADApp/pilatusSrc/pilatusDetector.cpp	(revision 15144)
+++ ADApp/pilatusSrc/pilatusDetector.cpp	(working copy)
@@ -1613,9 +1613,9 @@
   * \param[in] maxSizeY The size of the Pilatus detector in the Y direction.
   * \param[in] portName The name of the asyn port driver to be created.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/roperSrc/roper.cpp
===================================================================
--- ADApp/roperSrc/roper.cpp	(revision 15144)
+++ ADApp/roperSrc/roper.cpp	(working copy)
@@ -979,9 +979,9 @@
   * ADDriver.
   * \param[in] portName The name of the asyn port driver to be created.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/brukerSrc/BISDetector.cpp
===================================================================
--- ADApp/brukerSrc/BISDetector.cpp	(revision 15144)
+++ ADApp/brukerSrc/BISDetector.cpp	(working copy)
@@ -725,9 +725,9 @@
   * \param[in] statusPort The name of the asyn port previously created with drvAsynIPPortConfigure to
   *            receive status information from BIS.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/pluginSrc/NDPluginTransform.cpp
===================================================================
--- ADApp/pluginSrc/NDPluginTransform.cpp	(revision 15144)
+++ ADApp/pluginSrc/NDPluginTransform.cpp	(working copy)
@@ -624,9 +624,9 @@
   * \param[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
   * \param[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/pluginSrc/NDPluginColorConvert.cpp
===================================================================
--- ADApp/pluginSrc/NDPluginColorConvert.cpp	(revision 15144)
+++ ADApp/pluginSrc/NDPluginColorConvert.cpp	(working copy)
@@ -587,9 +587,9 @@
   * \param[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
   * \param[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/pluginSrc/NDPluginOverlay.cpp
===================================================================
--- ADApp/pluginSrc/NDPluginOverlay.cpp	(revision 15144)
+++ ADApp/pluginSrc/NDPluginOverlay.cpp	(working copy)
@@ -210,9 +210,9 @@
   * \param[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
   * \param[in] maxOverlays The maximum number ofoverlays this plugin supports. 1 is minimum.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/pluginSrc/NDPluginROI.cpp
===================================================================
--- ADApp/pluginSrc/NDPluginROI.cpp	(revision 15144)
+++ ADApp/pluginSrc/NDPluginROI.cpp	(working copy)
@@ -249,9 +249,9 @@
   * \param[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
   * \param[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/pluginSrc/NDPluginDriver.cpp
===================================================================
--- ADApp/pluginSrc/NDPluginDriver.cpp	(revision 15144)
+++ ADApp/pluginSrc/NDPluginDriver.cpp	(working copy)
@@ -433,9 +433,9 @@
   * \param[in] maxAddr The maximum  number of asyn addr addresses this driver supports. 1 is minimum.
   * \param[in] numParams The number of parameters that the derived class supports.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] interfaceMask Bit mask defining the asyn interfaces that this driver supports.
   * \param[in] interruptMask Bit mask definining the asyn interfaces that can generate interrupts (callbacks)
   * \param[in] asynFlags Flags when creating the asyn port driver; includes ASYN_CANBLOCK and ASYN_MULTIDEVICE.
Index: ADApp/pluginSrc/NDPluginStats.cpp
===================================================================
--- ADApp/pluginSrc/NDPluginStats.cpp	(revision 15144)
+++ ADApp/pluginSrc/NDPluginStats.cpp	(working copy)
@@ -704,9 +704,9 @@
   * \param[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
   * \param[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/pluginSrc/NDPluginStdArrays.cpp
===================================================================
--- ADApp/pluginSrc/NDPluginStdArrays.cpp	(revision 15144)
+++ ADApp/pluginSrc/NDPluginStdArrays.cpp	(working copy)
@@ -254,7 +254,7 @@
   * \param[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
   * \param[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/pluginSrc/NDPluginProcess.cpp
===================================================================
--- ADApp/pluginSrc/NDPluginProcess.cpp	(revision 15144)
+++ ADApp/pluginSrc/NDPluginProcess.cpp	(working copy)
@@ -337,9 +337,9 @@
   * \param[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
   * \param[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/pluginSrc/NDPluginFile.cpp
===================================================================
--- ADApp/pluginSrc/NDPluginFile.cpp	(revision 15144)
+++ ADApp/pluginSrc/NDPluginFile.cpp	(working copy)
@@ -713,9 +713,9 @@
   * \param[in] maxAddr The maximum  number of asyn addr addresses this driver supports. 1 is minimum.
   * \param[in] numParams The number of parameters supported by the derived class calling this constructor.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] interfaceMask Bit mask defining the asyn interfaces that this driver supports.
   * \param[in] interruptMask Bit mask definining the asyn interfaces that can generate interrupts (callbacks)
   * \param[in] asynFlags Flags when creating the asyn port driver; includes ASYN_CANBLOCK and ASYN_MULTIDEVICE.
Index: ADApp/PSLSrc/PSL.cpp
===================================================================
--- ADApp/PSLSrc/PSL.cpp	(revision 15144)
+++ ADApp/PSLSrc/PSL.cpp	(working copy)
@@ -716,9 +716,9 @@
   * \param[in] serverPort The name of the asyn port driver previously created with drvAsynIPPortConfigure
   *            connected to the PSL_server program.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/andorSrc/andorCCD.cpp
===================================================================
--- ADApp/andorSrc/andorCCD.cpp	(revision 15144)
+++ ADApp/andorSrc/andorCCD.cpp	(working copy)
@@ -86,9 +86,9 @@
   * and sets reasonable default values the parameters defined in this class, asynNDArrayDriver, and ADDriver.
   * \param[in] portName The name of the asyn port driver to be created.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] installPath The path to the Andor directory containing the detector INI files, etc.
   *            This can be specified as an empty string ("") for new detectors that don't use the INI
   *            files on Windows, but must be a valid path on Linux.
@@ -1404,9 +1404,9 @@
 /** IOC shell configuration command for Andor driver
   * \param[in] portName The name of the asyn port driver to be created.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] installPath The path to the Andor directory containing the detector INI files, etc.
   *            This can be specified as an empty string ("") for new detectors that don't use the INI
   *            files on Windows, but must be a valid path on Linux.
Index: ADApp/mar345Src/mar345.cpp
===================================================================
--- ADApp/mar345Src/mar345.cpp	(revision 15144)
+++ ADApp/mar345Src/mar345.cpp	(working copy)
@@ -681,9 +681,9 @@
   * \param[in] serverPort The name of the asyn port driver previously created with drvAsynIPPortConfigure
   *            connected to the mar345dtb program.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread.
   * \param[in] stackSize The stack size for the asyn port driver thread.
   */
Index: ADApp/simDetectorSrc/simDetector.cpp
===================================================================
--- ADApp/simDetectorSrc/simDetector.cpp	(revision 15144)
+++ ADApp/simDetectorSrc/simDetector.cpp	(working copy)
@@ -920,9 +920,9 @@
   * \param[in] maxSizeY The maximum Y dimension of the images that this driver can create.
   * \param[in] dataType The initial data type (NDDataType_t) of the images that this driver will create.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/ADSrc/NDArray.h
===================================================================
--- ADApp/ADSrc/NDArray.h	(revision 15144)
+++ ADApp/ADSrc/NDArray.h	(working copy)
@@ -265,9 +265,9 @@
 private:
     ELLLIST      freeList_;      /**< Linked list of free NDArray objects that form the pool */
     epicsMutexId listLock_;      /**< Mutex to protect the free list */
-    int          maxBuffers_;    /**< Maximum number of buffers this object is allowed to allocate; -1=unlimited */
+    int          maxBuffers_;    /**< Maximum number of buffers this object is allowed to allocate; 0=unlimited */
     int          numBuffers_;    /**< Number of buffers this object has currently allocated */
-    size_t       maxMemory_;     /**< Maximum bytes of memory this object is allowed to allocate; -1=unlimited */
+    size_t       maxMemory_;     /**< Maximum bytes of memory this object is allowed to allocate; 0=unlimited */
     size_t       memorySize_;    /**< Number of bytes of memory this object has currently allocated */
     int          numFree_;       /**< Number of NDArray objects in the free list */
 };
Index: ADApp/prosilicaSrc/prosilica.cpp
===================================================================
--- ADApp/prosilicaSrc/prosilica.cpp	(revision 15144)
+++ ADApp/prosilicaSrc/prosilica.cpp	(working copy)
@@ -1504,9 +1504,9 @@
   * \param[in] portName The name of the asyn port driver to be created.
   * \param[in] cameraId The uniqueId, IP address or IP DNS name  of the camera to be connected to this driver.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] maxPvAPIFrames The number of frame buffers to use in the PvAPI library driver. Default=MAX_PVAPI_FRAMES=2.
Index: ADApp/andor3Src/andor3.cpp
===================================================================
--- ADApp/andor3Src/andor3.cpp	(revision 15144)
+++ ADApp/andor3Src/andor3.cpp	(working copy)
@@ -1270,9 +1270,9 @@
   *            example for number).
   * \param[in] maxBuffers The maximum number of NDArray buffers that the
   *            NDArrayPool for this driver is allowed to allocate. Set this to
-  *            -1 to allow an unlimited number of buffers.
+  *            0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for
-  *            this driver is allowed to allocate. Set this to -1 to allow an
+  *            this driver is allowed to allocate. Set this to 0 to allow an
   *            unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread
   *            if ASYN_CANBLOCK is set in asynFlags.
Index: ADApp/marCCDSrc/marCCD.cpp
===================================================================
--- ADApp/marCCDSrc/marCCD.cpp	(revision 15144)
+++ ADApp/marCCDSrc/marCCD.cpp	(working copy)
@@ -1074,9 +1074,9 @@
   * \param[in] serverPort The name of the asyn port driver previously created with drvAsynIPPortConfigure
   *            connected to the marccd_server program.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is 
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/firewireWinSrc/firewireWinDCAM.cpp
===================================================================
--- ADApp/firewireWinSrc/firewireWinDCAM.cpp	(revision 15144)
+++ ADApp/firewireWinSrc/firewireWinDCAM.cpp	(working copy)
@@ -187,9 +187,9 @@
  *            then the first camera found on the Firewire bus will be used.
  * \param[in] maxBuffers Maxiumum number of NDArray objects (image buffers) this driver is allowed to allocate.
  *            This driver requires 2 buffers, and each queue element in a plugin can require one buffer
- *            which will all need to be added up in this parameter. Use -1 for unlimited.
+ *            which will all need to be added up in this parameter. Use 0 for unlimited.
  * \param[in] maxMemory Maximum memory (in bytes) that this driver is allowed to allocate. So if max. size = 1024x768 (8bpp)
- *            and maxBuffers is, say 14. maxMemory = 1024x768x14 = 11010048 bytes (~11MB). Use -1 for unlimited.
+ *            and maxBuffers is, say 14. maxMemory = 1024x768x14 = 11010048 bytes (~11MB). Use 0 for unlimited.
  * \param[in] priority The EPICS thread priority for this driver.  0=use asyn default.
  * \param[in] stackSize The size of the stack for the EPICS port thread. 0=use asyn default.
  */
Index: ADApp/URLSrc/URLDriver.cpp
===================================================================
--- ADApp/URLSrc/URLDriver.cpp	(revision 15144)
+++ ADApp/URLSrc/URLDriver.cpp	(working copy)
@@ -365,9 +365,9 @@
   * and sets reasonable default values for parameters defined in this class, asynNDArrayDriver and ADDriver.
   * \param[in] portName The name of the asyn port driver to be created.
   * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
+  *            allowed to allocate. Set this to 0 to allow an unlimited number of buffers.
   * \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is
-  *            allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
+  *            allowed to allocate. Set this to 0 to allow an unlimited amount of memory.
   * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
   */
Index: ADApp/Db/prosilica.template
===================================================================
--- ADApp/Db/prosilica.template	(revision 15144)
+++ ADApp/Db/prosilica.template	(working copy)
@@ -130,6 +130,19 @@
    field(SVVL, "")
 }
 
+record(ao, "$(P)$(R)Gain")
+{
+   field(PINI, "YES")
+   field(DTYP, "asynFloat64")
+   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))GAIN")
+   field(VAL,  "1.0")
+   field(DRVL, "0.0")
+   field(DRVH, "31.0")
+   field(LOPR, "0.0")
+   field(HOPR, "31.0")
+   field(PREC, "3")
+}
+
 # The following records are specific to the Prosilica
 
 ###############################################################################
Index: ADApp/Db/NDPluginBase.template
===================================================================
--- ADApp/Db/NDPluginBase.template	(revision 15144)
+++ ADApp/Db/NDPluginBase.template	(working copy)
@@ -72,7 +72,7 @@
     field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))ENABLE_CALLBACKS")
     field(ZNAM, "Disable")
     field(ONAM, "Enable")
-    field(VAL,  "0")
+    field(VAL,  "$(Enable=0)")
 }
 
 record(bi, "$(P)$(R)EnableCallbacks_RBV")
Index: ADApp/prosilicaSrc/prosilica.cpp
===================================================================
--- ADApp/prosilicaSrc/prosilica.cpp	(revision 15144)
+++ ADApp/prosilicaSrc/prosilica.cpp	(working copy)
@@ -1075,7 +1075,7 @@
 
     /* First disconnect from the camera */
     disconnectCamera();
-    
+ 
     /* Determine if we have been passed a uniqueID (all characters in cameraId are digits), 
      * or an IP address (anything else) */
     isUniqueId = true;
@@ -1111,18 +1111,39 @@
         this->uniqueId = this->PvCameraInfo.UniqueId;
     }
 
+	// Here's where reconnect fails.
+	// PermittedAccess flags are 0x0002 for around 5 seconds after
+	// a hard IOC restart which didn't call disconnectCamera()
+	unsigned retryCount = 0;
+	while ( (this->PvCameraInfo.PermittedAccess & ePvAccessMaster) == 0 ) {
+		asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, 
+			  "%s:%s: No RW access for camera %lu, retrying ...\n", 
+			  driverName, functionName, this->uniqueId);
+
+		// Wait a second and fetch status again
+		epicsThreadSleep(1);
+        status = PvCameraInfoEx(this->uniqueId, &this->PvCameraInfo, sizeof(this->PvCameraInfo));
+        if (status) {
+            asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, 
+                  "%s:%s: Cannot read status for camera %lu\n", 
+                  driverName, functionName, this->uniqueId);
+            return asynError;
+        }
+		if ( ++retryCount >= 10 )
+			break;
+    }
     if ((this->PvCameraInfo.PermittedAccess & ePvAccessMaster) == 0) {
         asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, 
               "%s:%s: Cannot get control of camera %lu, access flags=%lx\n", 
                driverName, functionName, this->uniqueId, this->PvCameraInfo.PermittedAccess);
-        return asynError;
-    }
+    	return asynError;
+	}
 
     if (isUniqueId)
       status = PvCameraOpen(this->uniqueId, ePvAccessMaster, &this->PvHandle);
     else
       status = PvCameraOpenByAddr(ipAddr.s_addr, ePvAccessMaster, &this->PvHandle);
-    
+ 
     if (status) {
         asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, 
               "%s:%s: unable to open camera %lu\n",
@@ -1130,7 +1151,7 @@
         this->PvHandle = NULL;
         return asynError;
     }
-    
+
     /* Negotiate maximum frame size */
     status = PvCaptureAdjustPacketSize(this->PvHandle, MAX_PACKET_SIZE);
     if (status) {
@@ -1570,7 +1591,6 @@
     if (maxPvAPIFrames_ == 0) maxPvAPIFrames_ = MAX_PVAPI_FRAMES;
     /* Create the PvFrames buffer.  Note that these structures must be set to 0! */
     PvFrames = (tPvFrame *)calloc(maxPvAPIFrames_, sizeof(tPvFrame));
-    
 
     /* Initialize the Prosilica PvAPI library 
      * We get an error if we call this twice, so we need a global flag to see if 
@@ -1587,6 +1607,7 @@
     
     tPvErr errCode;
     // register camera connection callback
+	// Note: Adding the callback invokes connectCamera()
     if((errCode = PvLinkCallbackRegister(GlobalCameraLinkCallback,ePvLinkAdd,(void*)this)) != ePvErrSuccess)
         printf("PvLinkCallbackRegister err: %u\n", errCode);
 
@@ -1594,21 +1615,23 @@
     if((errCode = PvLinkCallbackRegister(GlobalCameraLinkCallback,ePvLinkRemove,(void*)this)) != ePvErrSuccess)
         printf("PvLinkCallbackRegister err: %u\n", errCode);
 
-    /* Need to wait a short while for the PvAPI library to find the cameras (0.2 seconds is not long enough in 1.24) */
-    epicsThreadSleep(1.0);
-    
-    /* Try to connect to the camera.  
-     * It is not a fatal error if we cannot now, the camera may be off or owned by
-     * someone else.  It may connect later. */
-    this->lock();
-    status = connectCamera();
-    this->unlock();
-    if (status) {
-        printf("%s:%s: cannot connect to camera %s, manually connect when available.\n", 
-               driverName, functionName, cameraId);
-        return;
-    }
-    
+    if ( this->PvHandle == NULL ) {
+		/* Need to wait a short while for the PvAPI library to find the cameras */
+		/* (0.2 seconds is not long enough in 1.24) */
+		epicsThreadSleep(1.0);
+
+		/* Try to connect to the camera.  
+		 * It is not a fatal error if we cannot now, the camera may be off or owned by
+		 * someone else.  It may connect later. */
+		this->lock();
+		status = connectCamera();
+		this->unlock();
+		if (status) {
+			printf("%s:%s: cannot connect to camera %s, manually connect when available.\n", 
+				   driverName, functionName, cameraId);
+		}
+	}
+ 
     /* Register the shutdown function for epicsAtExit */
     epicsAtExit(shutdown, (void*)this);
 }

Replies:
RE: areaDetector patches Mark Rivers

Navigate by Date:
Prev: Re: Error associated to building asyn4-21 Eric Norum
Next: RE: Mclennan PM600 motor controller Peter Linardakis
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: Error associated to building asyn4-21 Eric Norum
Next: RE: areaDetector patches Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·