ADSpinnaker
- author:
Mark Rivers, University of Chicago
Overview
This is an areaDetector driver for GenICam cameras using the Spinnaker library.
GenICam is a Generic Interface for Cameras from the European Machine Vision Association (EMVA).
ADSpinnaker is derived from the base class ADGenICam, which handles many of the details of mapping GenICam features to EPICS records.
ADSpinnaker class describes this class in detail.
As it name implies, ADSpinnaker uses the FLIR/Point Grey Spinnaker library. It runs on Windows, and on Linux versions with gcc 7.5 and higher (e.g. Ubuntu 18, RHEL 8, Centos 8, Debian 10) It does not run on older Linux versions (e.g. Centos 7/RHEL 7) because the FLIR Spinnaker SDK is compiled on Ubuntu 18 and thus requires newer versions of GLIBC and GLIBCXX.
Prior to using ADSpinnaker with a specific camera model, the XML file must be read from the camera using the arv-tool utility, as described in the ADGenICam documentation.
The EPICS database file and OPI screens must then be generated by running the Python programs as described in the ADGenICam documentation.
On Windows the Spinnaker SDK must be downloaded and installed prior to running the IOC because it installs the necessary drivers. On Linux everything is included in ADSpinnaker, and it is not necessary to download the SDK.
ADSpinnaker driver
ADSpinnaker inherits from ADGenICam. It adds the following parameters and EPICS records that are specific to ADSpinnaker.
EPICS record names |
Record types |
drvInfo string |
Description |
---|---|---|---|
TimeStampMode, TimeStampMode_RBV |
bo, bi |
SP_TIME_STAMP_MODE |
Controls whether the TimeStamp attribute comes from the camera internal time stamp or from the EPICS time. Choices are Camera (0), and EPICS (1). |
UniqueIdMode, UniqueIdMode_RBV |
bo, bi |
SP_UNIQUE_ID_MODE |
Controls whether the UniqueId attribute comes from the camera internal value or from the driver. Choices are Camera (0), and Driver (1). |
ConvertPixelFormat, ConvertPixelFormat_RBV |
mbbo, mbbi |
SP_CONVERT_PIXEL_FORMAT |
Controls conversion of the pixel format read from the camera to a different format. For example this can be used to convert Mono12Packed to Mono16, which allows the camera to send 12-bit data over the bus and then convert to 16-bit on the host computer, reducing the required bandwidth and increasing the frame rate. |
FailedPacketCount |
longin |
SP_FAILED_PACKET_COUNT |
Failed packet count |
FailedBufferCount |
longin |
SP_FAILED_BUFFER_COUNT |
Failed buffer count |
BufferUnderrunCount |
longin |
SP_BUFFER_UNDERRUN_COUNT |
Buffer underrun count |
IOC startup script
The command to configure an ADSpinnaker camera in the startup script is:
ADSpinnakerConfig(const char *portName, const char *cameraId, int numSPBuffers,
size_t maxMemory, int priority, int stackSize)
portName
is the name for the ADSpinnaker port driver
cameraId
is the either the serial number of the camera or the camera index number in the system. The serial number is normally printed
on the camera, and it is also the last part of the camera name returned by arv-tool, for example for
"Point Grey Research-Blackfly S BFS-PGE-50S5C-18585624"
, it would be 18585624.
If cameraId is less than 1000 it is assumed to be the system index number, if 1000 or greater it is assumed to be a serial number.
numSPBuffers
is the number of TransportLayer buffers to allocate in Spinnaker. If set to 0 or omitted the default of 100 will be used.
The driver enforces a minimum value of 10, which is the Spinnaker default. 10 is not large enough to prevent dropped frames
with some cameras, particularly when doing data type conversions from Mono12Packed to Mono16 or from Bayer to RGB.
maxMemory
is the maximum amount of memory the NDArrayPool is allowed to allocate. 0 means unlimited.
priority
is the priority of the port thread. 0 means medium priority.
stackSize
is the stack size. 0 means medium size.
MEDM screens
The following is the MEDM screen ADSpinnaker.adl when controlling a FLIR Oryx 51S5M 10 Gbit Ethernet camera. ADSpinnaker.adl is very similar to ADGenICam.adl, with a few additional widgets for the PVs that are specific to ADSpinnaker.
Note that each frame is 4.8 MB, and it is collecting 162 frames/s, which is 775 MB/s.
The following are the MEDM screens FLIR_ORX_10g_51S5M-features[1-6].adl when controlling a FLIR Oryx 51S5M 10 Gbit Ethernet camera. These screens were autogenerated by the Python script in ADGenICam, and are specific to this camera model. They are loaded from the “Camera-specific features” related display widget in the above screen.