areaDetector / ADPvCam

An EPICS areaDetector driver for the Roper Scientific detectors, which includes all cameras from Photometrics and most but not all cameras from Princeton Instruments. The driver is based upon the PVCAM library from Photometrics, and runs on Microsoft Windows and Linux.
https://areadetector.github.io/areaDetector/ADPvCam/pvcamDoc.html
1 stars 6 forks source link

Add 32 and 64 bit linux and 64 bit windows support, formatting changes. #5

Closed jwlodek closed 6 months ago

jwlodek commented 1 year ago

With these changes I was able to use ADPvCam with a Kinetix detector over PCIE on a linux host (RHEL8), which is only supported in the most recent versions of the SDK.

The changes include:

MarkRivers commented 6 months ago

@jwlodek thanks for this, and sorry it took me so long to merge.

I merged and tried building. It looks like you did not add support for 64-bit Windows, correct?

On Linux I get the following compile errors:

/usr/bin/g++  -D_GNU_SOURCE -D_DEFAULT_SOURCE          -D_X86_64_ -DUNIX  -Dlinux      -O3 -g   -Wall      -mtune=generic     -m64  -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include      -I/corvette/home/epics/devel/asyn-4-43/include     -I/corvette/home/epics/devel/areaDetector-3-13/ADSupport/include/os/Linux -I/corvette/home/epics/devel/areaDetector-3-13/ADSupport/include   -I/corvette/home/epics/devel/areaDetector-3-13/ADCore/include -I/corvette/usr/local/epics-devel/base-7.0.8/include/compiler/gcc -I/corvette/usr/local/epics-devel/base-7.0.8/include/os/Linux -I/corvette/usr/local/epics-devel/base-7.0.8/include        -c ../ADPvCam.cpp
In file included from ../ADPvCam.h:45,
                 from ../ADPvCam.cpp:11:
../../../include/pvcam.h:90:5: error: ‘long64’ does not name a type; did you mean ‘long’?
   90 |     long64 TimeStamp;     /**< Frame EOF (end-of-frame) timestamp. */
      |     ^~~~~~
      |     long
../../../include/pvcam.h:92:5: error: ‘long64’ does not name a type; did you mean ‘long’?
   92 |     long64 TimeStampBOF;  /**< Frame BOF (beginning-of-frame timestamp. */
      |     ^~~~~~
      |     long
In file included from ../ADPvCam.h:45,
                 from ../ADPvCam.cpp:11:
../../../include/pvcam.h:1312:5: error: ‘ulong64’ does not name a type; did you mean ‘ulong’?
 1312 |     ulong64     timestampBOF;     /**< 8B - Beginning of frame timestamp, in picoseconds. */
      |     ^~~~~~~
      |     ulong
../../../include/pvcam.h:1313:5: error: ‘ulong64’ does not name a type; did you mean ‘ulong’?
 1313 |     ulong64     timestampEOF;     /**< 8B - End of frame timestamp, in picoseconds. */
      |     ^~~~~~~
      |     ulong
../../../include/pvcam.h:1314:5: error: ‘ulong64’ does not name a type; did you mean ‘ulong’?
 1314 |     ulong64     exposureTime;     /**< 8B - Exposure time, in picoseconds. */
      |     ^~~~~~~
      |     ulong
../../../include/pvcam.h:3258:1: error: ‘DEPRECATED’ does not name a type
 3258 | DEPRECATED rs_bool PV_DECL pl_cam_check(int16 hcam);
      | ^~~~~~~~~~
../../../include/pvcam.h:3381:1: error: ‘DEPRECATED’ does not name a type
 3381 | DEPRECATED rs_bool PV_DECL pl_cam_register_callback(int16 hcam, int32 callback_event,
      | ^~~~~~~~~~
../../../include/pvcam.h:3383:1: error: ‘DEPRECATED’ does not name a type
 3383 | DEPRECATED rs_bool PV_DECL pl_cam_register_callback_ex(int16 hcam, int32 callback_event,
      | ^~~~~~~~~~
../../../include/pvcam.h:3385:1: error: ‘DEPRECATED’ does not name a type
 3385 | DEPRECATED rs_bool PV_DECL pl_cam_register_callback_ex2(int16 hcam, int32 callback_event,
      | ^~~~~~~~~~
../../../include/pvcam.h:4210:1: error: ‘DEPRECATED’ does not name a type
 4210 | DEPRECATED rs_bool PV_DECL pl_exp_init_seq(void);
      | ^~~~~~~~~~
../../../include/pvcam.h:4211:1: error: ‘DEPRECATED’ does not name a type
 4211 | DEPRECATED rs_bool PV_DECL pl_exp_uninit_seq(void);
...
jwlodek commented 6 months ago

Hi Mark, let me try and reproduce the linux compile errors - I did not have those on my system.

As for 64 bit windows, I think I forgot to push the commits where I added the 64 bit windows dll and lib files under os. I see you've already done that on the main branch.

I've actually re-written this driver from scratch since I made this PR, available here: https://github.com/NSLS-II/ADKinetix. This new version of the driver uses the non-deprecated callback operating mode that the vendor SDK supplies, rather than the polling mode that ADPvCam uses. With it I was able to solve the performance issues we were seeing with the Kinetix camera at HEX at NSLS-II - we can now hit the advertised framerates from the manual, and also we can switch operating modes at runtime (16 bit high dynamic range and 8 bit speed modes in addition to default 12 bit mode).

Maybe it's worth moving this new driver to the areaDetector org? I am still finishing up some things with it like the OPI screens and some minor changes, but it is working well at the beamline now.

I've only tested the new driver on linux, but I can test on windows as well.

MarkRivers commented 6 months ago

@jwlodek I have fixed the compile errors and simplified the Makefiles. See the discussion under this issue: https://github.com/areaDetector/ADPvCam/issues/6