Idea #14606

Implement the transition scripts called by for high-level control of artdaq processes

Added by John Freeman almost 4 years ago. Updated over 3 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
60.00 h


Recently, in artdaq-utilities-sdaqinterface (, a "simple daqinterface" script,, was implemented. This script respects a set of state transitions, where for each transition, it calls a bash script in charge of that transition. The actual implementation of the bash scripts is left to the user of sdaqinterface. This Redmine Issue describes the need for a general-purpose implementation of the scripts, so that, once an experiment has its hands on the scripts, it should be relatively straightforward to get them to work for a specific experiment's artdaq-based DAQ system. Along with the scripts themselves, documentation on how to use them should additionally be provided.


#1 Updated by John Freeman almost 4 years ago

  • % Done changed from 0 to 20

Work has already been done on this project; as of this writing it can be found on github, , though we should think about where to give it a permanent home. It's basically a modification of the DAQInterface python code used on the 35ton experiment; an email describing in detail my plans for it was sent to yesterday (Nov. 21, 2016):

Hi all,

    In light of our recent discussions concerning the creation of an LRP (Long Running Process) through which to control artdaq processes, I've 
begun overhauling the 35ton DAQInterface python script so as to support this effort. Essentially, it will serve as an intermediary between Wes's script (found in and the artdaq processes. To get more specific, as of 
commit b49c0fac51e6972876c562f56d581f0bc130cf5c (dated Oct. 19) supports a state machine model of the following form: 
Existing -> "Initialize" -> Initialized -> "Boot" -> Booted -> "Config" -> Configured -> "Run" -> Running -> "Stop" -> Stopped -> "Shutdown" -> 
Initialized -> "Terminate" -> NO STATE. This state machine doesn't match up 1-1 with the state machine supported in artdaq v1_13_03, so 
DAQInterface takes account of this, accepting the sdaqinterface transitions via XML-RPC and "translating" them into artdaq transitions. How this 
is done, I describe below. If you have any questions / concerns / disagreements, please let me know. For each sdaqinterface transition, I describe 
things in the following format:

Argument(s): # of arguments
-Description of argument #1, etc. 

<<Starting State #1 -> Final State>>
Steps taken by DAQInterface when issuing transition "Transition" from Starting State #1

<<Starting State #2 -> Final State>>
Steps taken by DAQInterface when issuing transition "Transition" from Starting State #2


Let's begin. 


Argument(s): 0

<<Existing -> Initialized>>:
Launch DAQInterface (error/warning if it already exists?)

<<Initialized -> Initialized>>:
No-op (unless it doesn't exist, in which case issue warning and then launch DAQInterface)


Argument(s): 2+
-DAQInterface configuration file (provides # of eventbuilders and # of aggregators, location of artdaq-demo build)
-Component list (names of fragment generators) 

<<Initialized -> Booted>>:
Create the eventbuilders, aggregators and boardreaders via pmt.rb


Argument(s): 2
-Name of configuration in database
-Name of subdirectory associated with configuration

<<Booted -> Configured>>
-Take the FHiCL documents from the configuration
-Adjust them for bookkeeping purposes (based on # of eventbuilders, etc.)
-Send the artdaq "init" transition w/ the FHiCL documents

<<Configured -> Configured>>
-Repeat the steps from the <<Booted -> Configured>> case

<<Stopped -> Configured>>
-Send the artdaq "shutdown" transition
-Repeat the steps from the <<Booted -> Configured>> case


Argument(s): 1
-Run #

<<Configured -> Running>>
-Send the artdaq "start" transition w/ the run #
-Execute optional experiment-specific "experiment_run()" function (unless overridden, this is a no-op)

<<Stopped -> Running>>
-Repeat the steps from the <<Configured -> Running>> case 


Argument(s): 0

<<Running -> Stopped>>
-Execute optional experiment-specific "experiment_stop()" function (unless overridden, this is a no-op)
-Send the artdaq "stop" transition


Argument(s): 0

<<Stopped -> Initialized>>
-Send the artdaq "shutdown" transition
-Kill the artdaq processes

<<Configured -> Initialized>>
-Same steps as <<Stopped -> Initialized>>

<<Booted -> Initialized>>
-Kill the artdaq processes


Argument(s): 0

<<ANY STATE -> Terminated>>
-If in running state, make every effort to close output file and shut down hardware cleanly (i.e., attempt stop transition, etc.)
-Kill artdaq processes 
-Kill DAQInterface

#2 Updated by John Freeman over 3 years ago

  • Status changed from New to Resolved
  • % Done changed from 20 to 100

The needed SDAQ_*.sh scripts have been added to artdaq-utilities-daqinterface ( via commit 23a67b638a8fdb58e243b8436ea31dedbefbf783 , and I've been able to control DAQInterface by running the script from the commit b49c0fac51e6972876c562f56d581f0bc130cf5c version of artdaq-utilities-sdaqinterface after commenting/uncommenting the relevant lines in so that it uses the cmdlineControlInput module for input (i.e., takes commands at the command line).

#3 Updated by Eric Flumerfelt over 3 years ago

  • Project changed from artdaq to artdaq Utilities
  • Category set to 430

#4 Updated by Eric Flumerfelt over 3 years ago

  • Category changed from artdaq-utilities to artdaq-daqinterface

Also available in: Atom PDF