BNMR: Scripts: Difference between revisions
en>Suz (New page: {{Pagelinks}} ==Introduction == A number of scripts are used in the DAQ for the {{bnmqr|join=and}}. The most important of these will be described in this page. == start-all == ''start-al...) |
en>Suz mNo edit summary |
||
Line 1: | Line 1: | ||
{{Pagelinks}} | {{Pagelinks}} | ||
== | == Links == | ||
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3"> | |||
* [[BNMR]] | |||
* | * [[BNMR: Midas Host#Environment Variables|Environment variables]] | ||
* [[BNMR: Experimental Modes|Experimental Modes]] | |||
* [[BNMR: Getting Started|Getting Started]] | |||
* [[BNMR#Nomenclature|Nomenclature]] | |||
</div> | |||
== Introduction == | |||
A number of important scripts are used in the {{bnmqr|join=and}} experiments. The most important of these are described here. | |||
; Unless otherwise noted, the scripts can be found in directory {{Filepath|path=~/online/[[BNMR#Nomenclature|<beamline>]]/bin}}. | |||
=== .cshrc === | |||
This important script in $HOME is the '''script executed on log in'''. This sets up the path, the aliases and environment variables required for running the DAQ system. This file is shared by all the machines in the NIS cluster with ''isdaq00'' as master. This includes ''isdaq01, isdaq06, lxbnmr, lxbnqr''. This script therefore checks the $HOST environment variable before setting up the DAQ system. | |||
== | === start-all === | ||
'' | ''start-all'' is an alias to the script {{File|name=start-all-daq-bn[mq]r}} (see [[BNMR#Nomenclature|Nomenclature]]). This script is run by the experimenter to start all the MIDAS clients needed for the DAQ system. It checks to see if each client is already running, and if not, starts it. It can be run at any time during the run to restart missing clients. | ||
=== kill-all === | |||
''kill-all'' is an alias to the script {{File|name=kill-all}}. This script kills all DAQ related clients. When there is some problem with the DAQ that cannot be otherwise resolved, users often do a ''' ''kill-all'' followed by a ''start-all'' ''' to ensure a clean restart. | |||
[[Category: | Recently (June 2016) an extra feature has been added to the script {{File|name=kill-all}}. This is the execution of the file {{File|name=init_odb.com}}. This file is an [https://midas.triumf.ca/MidasWiki/index.php/Odbedit odbedit] command file containing a list of ODB keys to initialize to their default state. | ||
=== at_start_run.pl === | |||
The script {{File|name=at_start_run.pl}} is executed at the start of every run by the MIDAS system (see [[#NOTE]] below). It checks access to the CAMP slow control system, and checks that the CAMP logged variables (including automatic logged variables) can be accessed, and zeroes the CAMP statistics. Similarly, it also checks the EPICS logged variables (if enabled) exist and can be accessed. If an error occurs, it sets alarms in the ODB to inform the experimenters by means of an alarm banner on the custom status page. | |||
=== at_end_run.csh === | |||
The script {{File|name=at_end_run.csh}} is executed at the end of every run (see [[#NOTE]]). This script runs a second script {{File|name=elog_every_run.csh}}. This script | |||
reads the {{Odbpath|path=/Experiment/Edit on start}} parameters (i.e. the parameters entered by the experimenter on starting a run), other ODB parameters including the Experimental (PPG) Mode of the run and whether it is run in dual or single channel mode, reads the statistics of the CAMP logged devices, and | |||
sends them all to the appropriate ELOG. | |||
<div id=NOTE></div> | |||
;NOTE | |||
The MIDAS system provides a means whereby users' scripts can be automatically executed at the start or end of the run, by means of keys in the ODB {{Odbpath|path=/programs}} tree. The key {{Odbpath|path=Execute on start run}} contains the name and path of a script to be executed at the start of every run, | |||
and the key {{Odbpath|path=Execute on stop run}} contains the name and path of a script to be executed at the end of every run. For example, | |||
[local:bnqr:Stopped]/>ls "/programs/Execute on start run" | |||
Execute on start run /home/bnqr/online/bnqr/bin/at_start_run.pl /home/bnqr/online/perl bnqr >/home/bnqr/tmp/at_start_run_pl.log | |||
[local:bnqr:Stopped]/>ls "/programs/Execute on stop run" | |||
Execute on stop run /home/bnqr/online/bnqr/bin/at_end_run.csh | |||
For more information see MIDAS [https://midas.triumf.ca/MidasWiki/index.php//Programs_ODB_tree /Programs ODB tree]. | |||
[[Category:Scripts]] |
Revision as of 17:50, 20 June 2016
Links
Introduction
A number of important scripts are used in the bnmr and bnqr experiments. The most important of these are described here.
- Unless otherwise noted, the scripts can be found in directory
~/online/<beamline>/bin.
.cshrc
This important script in $HOME is the script executed on log in. This sets up the path, the aliases and environment variables required for running the DAQ system. This file is shared by all the machines in the NIS cluster with isdaq00 as master. This includes isdaq01, isdaq06, lxbnmr, lxbnqr. This script therefore checks the $HOST environment variable before setting up the DAQ system.
start-all
start-all is an alias to the script start-all-daq-bn[mq]r (see Nomenclature). This script is run by the experimenter to start all the MIDAS clients needed for the DAQ system. It checks to see if each client is already running, and if not, starts it. It can be run at any time during the run to restart missing clients.
kill-all
kill-all is an alias to the script kill-all. This script kills all DAQ related clients. When there is some problem with the DAQ that cannot be otherwise resolved, users often do a kill-all followed by a start-all to ensure a clean restart.
Recently (June 2016) an extra feature has been added to the script kill-all. This is the execution of the file init_odb.com. This file is an odbedit command file containing a list of ODB keys to initialize to their default state.
at_start_run.pl
The script at_start_run.pl is executed at the start of every run by the MIDAS system (see #NOTE below). It checks access to the CAMP slow control system, and checks that the CAMP logged variables (including automatic logged variables) can be accessed, and zeroes the CAMP statistics. Similarly, it also checks the EPICS logged variables (if enabled) exist and can be accessed. If an error occurs, it sets alarms in the ODB to inform the experimenters by means of an alarm banner on the custom status page.
at_end_run.csh
The script at_end_run.csh is executed at the end of every run (see #NOTE). This script runs a second script elog_every_run.csh. This script reads the /Experiment/Edit on start parameters (i.e. the parameters entered by the experimenter on starting a run), other ODB parameters including the Experimental (PPG) Mode of the run and whether it is run in dual or single channel mode, reads the statistics of the CAMP logged devices, and sends them all to the appropriate ELOG.
- NOTE
The MIDAS system provides a means whereby users' scripts can be automatically executed at the start or end of the run, by means of keys in the ODB /programs tree. The key Execute on start run contains the name and path of a script to be executed at the start of every run, and the key Execute on stop run contains the name and path of a script to be executed at the end of every run. For example,
[local:bnqr:Stopped]/>ls "/programs/Execute on start run" Execute on start run /home/bnqr/online/bnqr/bin/at_start_run.pl /home/bnqr/online/perl bnqr >/home/bnqr/tmp/at_start_run_pl.log [local:bnqr:Stopped]/>ls "/programs/Execute on stop run" Execute on stop run /home/bnqr/online/bnqr/bin/at_end_run.csh
For more information see MIDAS /Programs ODB tree.