MCA Data Server V3 Reference

COUNTER

Introduction

USB driver

Counter Device

Data structures

Overview

Module Constants

ARM Data structures

Version

Status

Controls

Calibration

Two-channel Logger

Time histogram

API

Overview

The Counter Programmer's Model

The Counter has an embedded ARM M0+ MCU (Atmel SAM L21E), which includes a 32-bit ARM processor with a USB interface. All MCA data acquisitions, gain stabilization, alarming and data analysis functions are implemented in the ARM SoC. The Counter software serves the SiPM-Counter.

The software is structured into four layers as shown in the table below. It is written in Python and is compliant with 3.7 or higher.

Layer Purpose Description
mca_device.py USB driver This layer provides a Python interface to libusb0.1 using ctypes. Compiled libusb0.1 modules are provided for a number of platforms, and are also included by default in most commercial Linux computers. The most recent version also supports libusb1.0 directly via Python, without the need for explicit bindings via ctypes; cf https://libusb.info
counter_data.py Data descriptor This device-specific layer provides one class for each set of control and data registers within the Counter. The classes have standardized functions to communicate with the API layer.
mca_api.py API Level This is the API layer used to process commands directed at a single Counter or at an array of such devices.
mca_server.py Data server The data server is implemented using zero message queue ( zeromq.org). The server not only acts as a bridge between the detectors on the USB bus and the Internet, but also as a bridge between programming languages. All data are serialized using JSON strings. While the server is written in Python, clients can access the Counter using any programming language they like. Further, complex tasks can be distributed over independent clients, eg DAQ, reach back and gain stabilization, rather than creating one very complex super client.