MCA Data Server

MCA Data Server

The MCA Data Server (MDS) provides client access to all of Bridgeport's MCA.

Purpose

Data acquisition and device driver: The purpose of the MCA Data Server is to provide high-level access to the radiation detectors and their MCA's. It acts as a bridge between the MCA's on the USB side and clients on the internet. Being a true server, the MDS can be accessed by client software written in 40+ diferent programming languages.

Software stack:The MDS is a layered software stack. Most often a client gains access through the ZMQ server interface – virtually in any programming language they desire. Alternatively, client software can access the command layer or the API layer directly using Python.

Commands sent to the ZMQ server interface are sent as JSON strings of the form {"type": "mca_cmd", "name":"read_mca", "sn": "eRC5000"}

See the MDS documentation for a detailed description of all MDS commands.

The MDS source files are in the folder /wxMCA/mds/

There are also commands that address the MDS itself, as opposed to detector commands, eg get_pid and exit.

MCA Data Server

MDS Structure

MDS – Software Stack
ZMQProtocol layer for robust TCP/IP socket communication; accessible in 40+ programming languages.
mca_server.pyUser code can access this in 40+ languages via ZMQ
mca_api.pyUser can access this API code in Python using dictionaries for commands.
emorpho_data.py, mca1k_data.py, mca2k_data.py, mca3k1_data.pyMCA-specific data definitions.
mca_usb1.py Morpho device driver and bridge to libusb1
import usb1 ctypes interface to libusb1
MCA MCA module connected via USB
MCA Data Server software stack. Only the libusb USB-driver depends on hardware and OS. It has been implemented on x86/x64/ARM under Win 10/11 and Linux

Run the MDS

The MCA Data Server reads its configuration file only on start up. So, for any edits to take effect you must terminate and restart the MDS.

This may be done under manual control. If the MDS is running under the control of the MCA Data Daemon (MDD) you can quit the MDS and let the MDD respawn it.

How to start the MDS

  • Manually: On Windows, double-click on the MDS icon on the desktop; or double-click on run_mds.cmd in the wxMCA folder . Under Linux use python wxMCA/mds/mca_server.py .
  • Automatically: When using the MDD, let the MDD start the MDS for you by setting mds_present to 1 in the mdd_config file.

How to quit the MDS

  • Kill: Manually find the process and kill it.
  • MDS command: Send the command {"type": "server_cmd", "name": "exit"} to the MDS and it will exit.
  • MDD command: Send the command {"type":"mdd_cmd", "name": "stop_mds"} to the MCA Data Daemon and it will force the MDS to exit.

See the MDS documentation for a detailed description.