Project

General

Profile

Feature #22806

DAQInterface should provide a hook to allow an arbitrary experiment-provided function to run periodically

Added by John Freeman 3 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
06/24/2019
Due date:
% Done:

100%

Estimated time:
Experiment:
-
Co-Assignees:
Duration:

Description

Wes pointed out it would be useful for SBND if, as part of operations, a hook was available in DAQInterface to periodically query and report the individual statuses of artdaq processes. A way to do this should be provided which is backwards compatible, doesn't by default slow things down, and doesn't interfere with other experiment's workflow.

History

#1 Updated by John Freeman 3 months ago

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

Using DAQInterface at the head of feature/issue22806_provide_experiment_hooks, commit bae537b08e7e4e8369896d65a0b5365308446bb6, you can implement a function which executes once a second in DAQInterface of the form

def perform_periodic_action_base(self):
     pass 

as long as it's (A) defined in a file called daqinterface_overrides_for_experiment.py, and (B) before you launch DAQInterface, you've pointed an environment variable "DAQINTERFACE_OVERRIDES_FOR_EXPERIMENT_MODULE_DIR" to the directory in which daqinterface_overrides_for_experiment.py is located. Note that in the example above, you'd replace "pass" with useful code, and that any code in that function has access to DAQInterface member variables such as self.procinfos.

Incidentally, the same also applies to functions "start_datataking_base", "stop_datataking_base", "do_enable_base" and "do_disable_base".

#2 Updated by John Freeman 3 months ago

After discussion at today's meeting, added the possibility to implement a check_config_base function, which should throw an exception if a problem's observed just before DAQInterface proceeds to send the init transition to the artdaq processes. If an exception is thrown, DAQInterface goes back to "booted" from "configuring". Commit c6d70bd8827525135f0135c91f8f4e8fab70d221 at the head of feature/issue22806_provide_experiment_hooks.



Also available in: Atom PDF