Cosylab has been contributing to the MYRRHA project since at least 2012. The recent work on the implementation of a generic data acquisition solution for the MYRRHA test stand at Louvain-la-Neuve (Belgium) was reported at IPAC19 in Melbourne, Australia. This article captures the key technical elements of the IPAC presentation.
MYRRHA (Multi-purpose Hybrid Research Reactor for High-tech Applications) is a multi-purpose irradiation facility in Mol, Belgium that has been designed to be an accelerator-driven system .
The main motivation for the current work is the need for better sampling performance, signal quality, arbitrary processing and storage of measurements. Full integration of the data acquisition (DAQ) system in the global EPICS control environment was a strong requirement and an intermediate DAQ platform was put in place to satisfy the control and experiment needs.
Design and Implementation
National Instruments (NI) LabVIEW and the DAQmx  driver was used to create a generic DAQ application that runs on a PXIe industrial computer with a Multifunction I/O Module. This platform was chosen because it was capable of satisfying the requirement to acquire data with a frequency up to 2 MHz on 16 channels simultaneously and process it in real-time.
The software architecture consists of four independent modules that each executes its own function: Data Acquisition, EPICS, Data Logger and Error Handler. Each of these modules has its own queue and other modules can send messages with payloads to those queues allowing the modules to interact with each other while at the same time remaining independent.
The Data Acquisition module (Fig. 1) is a master module and defines the workflow of the application.
The main loop in the Data Acquisition module executes a state machine with states defining what is considered as the positive workflow and what is not, e.g. the system is waiting for a configuration from the GUI, the system is waiting for a trigger or the system is acquiring data. Messages from other modules work as interrupt routines to the execution of the state machine. If a message arrives from another module, it is handled in the next iteration of the main loop. Actions and state transitions are defined by the type of message and its payload. An example of a message to the DAQ module from the EPICS module is of type ‘configure’ with the details of the configuration data contained in the payload. This message triggers validation of the configuration, storage of the configuration and a state transition from the ‘init’ state to the ‘configured’ state. The DAQ module also contains an asynchronous process loop. This loop gets acquired samples from the DAQ module, processes the samples for the GUI and for storage and forwards the results to the EPICS and Data Logger modules.
The EPICS module runs SoftIOC from the CALab library. This is where process variables (PVs) are stored. The EPICS module serves as a communicator with the EPICS control environment. Its main functionality is to update control and data PVs from SoftIOC to the DAQ application and vice versa. The EPICS module intercepts all user actions on the GUI and forwards it to the DAQ module.
Data Logger Module
The Data Logger module takes care of storing the acquired data and measurement configurations for post-analysis. The TFS text data format , defined by CERN, was chosen by SCK-CEN to the store data for compatibility reasons. The header contains configuration and static beam parameters and the body contains the acquired and processed data with the timestamp of acquisition.
Error Handler Module
The Error Handler module takes care of any events that could cause any malfunction in the operation of the application. It stores all status, warning and error events in a .log file for later inspection. The Error Handler module takes care of the proper shut-down of the system in the case of a critical error or a user shut-down action from the GUI.
Integration into EPICS
To be able to integrate the DAQ application running on National Instruments hardware into the EPICS control environment, we needed a library for LabVIEW that would be able to run SoftIOC and establish communication with it over EPICS channel access. We evaluated a number of options according to performance, ease of use, features and licensing and we chose the best two for further evaluation: CALab from BESSY and the National Instruments native support for EPICS. The CALab library performed better in upstream data update, which has a far more demanding requirement than downstream, and it integrated better into the LabVIEW environment. So, we implemented the DAQ application with the CALab library.
The GUI, developed in Control System Studio, provides the user with the necessary configuration, visualization, and control capability. The GUI has three tabs (Fig. 2), each with specific functionality. Firstly, the user sets the acquisition parameters and acquisition type in the Configuration tab. In the Control tab, the user issues software triggers, stops or aborts acquisitions and shuts down the DAQ application after use. The Measurements tab (Fig. 2) displays the last measurements in real-time on an amplitude-time graph. Visible channels can be selected. There is also functionality to manipulate the graph to better inspect the chosen parts of the data.
We decided to use the DAQ project as an exercise in requirement-driven engineering. An upcoming MINERVA endeavor by SCK will greatly scale the required control system efforts. Control system components developed will have to follow global control system design decisions, governed by an experienced control system architect.
We wanted to utilize the best software engineering practices early on and equip the SCK team with a scalable control system development strategy. Cosylab helped with the requirement definition and review. The requirements were then approved by SCK. The design and implementation, code review and elaborate test plan together with the review process were done by Cosylab. The test plan was approved by SCK. Acceptance was done via execution of the test plan first at Cosylab (FAT), which made it possible to address any issues before shipping the solution to LLN. Installation and on-site acceptance were done by the Cosylab team at LLN. The test plan was executed by SCK for final acceptance.
Cosylab managed the complete project, while SCK remained in full control through requirement and test plan approval. With this approach, SCK was able to make good use of the available resources, while fully controlling the deliverable to obtain the required functionality.
Any additional ideas for functionality were noted as feature requests and will be implemented in the next version of the application.
A fully functional, and configurable DAQ solution was developed for MYRRHA using National Instruments hardware and drivers. The DAQ application runs in LabVIEW on native hardware. For integration into the EPICS control system, CALab was used and the user interface for configuration and data visualization was created in Control System Studio.
Robert Modic joined Cosylab in 2012, first working on a timing system study for RAON. His other projects include ELI-NP, where he was responsible for the complete timing system of the accelerator from writing down the requirements, doing the design and managing the implementation. He is currently the control system task leader for MYRTE, the research and transmutation endeavour of the MYRRHA (Multi-Purpose Hybrid Research Reactor for High-Tech Applications) research facility. In his free time, Robert enjoys spending time out in nature, hiking or cycling with friends and family; enjoying the elements is his way of recharging.
Primož Mekuč joined Cosylab in 2016. He started working on some parts of Cosylab’s Accelerator Control System (C-ACS) software framework and some smaller projects. Then he moved on to comprehensive testing of Accelerator Control System and Timing system products and worked on the DAQ system for the MYRRHA project as the Lead Developer. He later switched his focus more to systems engineering. He is working with proton therapy customers on writing requirements and test cases for the devices that are part of Proton therapy facilities. In his free time Primož leads a local scout group, explores mountains on his mountain-bike and spends time with his wife and friends — preferably outdoors, in nature.
Philippe della Faille works at the Belgian Nuclear Center SCK•CEN and has joined the MYRRHA project in January 2018. He holds a Bachelor’s degree in computer science and has managed different projects of control systems in the nuclear sector, such as RIC, RICN4 and ICEDA. His main passion is aviation and has a private pilot license.