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.

As it name implies, ADSpinnaker uses the FLIR/Point Grey Spinnaker library. It runs on Windows, and on Linux with Ubuntu 18 and higher. It does not run on other most older Linux versions (e.g. Centos 7/RHEL 7) because the FLIR Spinnaker SDK is compiled with a very recent gcc version and thus requires new 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.

The Spinnaker SDK must be downloaded and installed on the Windows or Linux machine prior to running the IOC because it installs the necessary drivers.

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 traceMask, int memoryChannel,
                  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.

traceMask is the initial value of asynTraceMask to be used for debugging problems in the constructor.

memoryChannel is the internal channel number in the camera to be used for saved cameras settings.

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.

../_images/ADSpinnaker.png

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.

../_images/ADSpinnaker_features1.png
../_images/ADSpinnaker_features2.png
../_images/ADSpinnaker_features3.png
../_images/ADSpinnaker_features4.png
../_images/ADSpinnaker_features5.png
../_images/ADSpinnaker_features6.png