Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  22 Nov 2023, Pavel Murat, Forum, run number from an external (*SQL) db? 
    Reply  22 Nov 2023, Ben Smith, Forum, run number from an external (*SQL) db? 
    Reply  22 Nov 2023, Stefan Ritt, Forum, run number from an external (*SQL) db? 
       Reply  01 Dec 2023, Pavel Murat, Forum, run number from an external (*SQL) db? 
          Reply  02 Dec 2023, Stefan Ritt, Forum, run number from an external (*SQL) db? 
             Reply  02 Dec 2023, Pavel Murat, Forum, run number from an external (*SQL) db? 
                Reply  03 Dec 2023, Pavel Murat, Forum, run number from an external (*SQL) db? 
                   Reply  04 Dec 2023, Stefan Ritt, Forum, run number from an external (*SQL) db? 
                Reply  04 Dec 2023, Stefan Ritt, Forum, run number from an external (*SQL) db? 
Message ID: 2640     Entry time: 02 Dec 2023     In reply to: 2638     Reply to this: 2642   2643
Author: Pavel Murat 
Topic: Forum 
Subject: run number from an external (*SQL) db? 
> 
> If you go in this direction, there is an alternative to what Ben wrote: Use the sequencer to start a run.
> The sequencer script can obtain a new run number from a central instance (e.g. by calling a shell script 
> like 'curl ...' to obtain the new run number, then put it into /Runinfo/Run number as Ben wrote. This has
> the advantage that the run is _started_ already with the correct number, so the history system is fine.
> 

Hi Stefan, this sounds like a perfect solution - thanks! - and leads to another, more technical, question:

- how does one communicate with an external shell script from MSL ? I looked at the MIDAS Sequencer page 
  
  https://daq00.triumf.ca/MidasWiki/index.php/Sequencer

  and didn't find an immediately obvious candidate among the MSL commands. 
  The closest seems to be 

  'SCRIPT script [, a, b, c, ...]' 

  but I couldn't easily figure how to propagate the output of the script back to MIDAS. 
  Let say, the script creates an ASCII file with the next run number. What is the easiest 
  way to import the run number into ODB? - Should an external script spawn a [short-lived] 
  MIDAS client ?  - That would work, but I'm almost sure there is a more straightforward solution. 

  Of course, the assumption that the 'SCRIPT' command provides the solution could be wrong.

-- thanks again, regards, Pasha
ELOG V3.1.4-2e1708b5