BNMR: Experimental Setup

From DaqWiki
Revision as of 13:34, 4 July 2018 by en>Suz
Jump to navigation Jump to search

Links

Introduction

This page describes the experimental setup of the bnmr and bnqr experiments, which are based on the MIDAS DAQ system.

MIDAS Host

The MIDAS Host for the bnmr and bnqr experiments is currently isdaq01, located in the ISAC1 counting room. Another desktop (isdaq06) is located nearby. isdaq06 is normally used as a terminal by the bnmr and bnqr experimenters, but also serves as the secondary MIDAS Host, in case of failure of isdaq01 (see #Changing the Midas host).

NIS ISAC Cluster

Both these desktops run NIS and are part of the ISAC cluster. The "master" computer is isdaq00 (located in the Computing Services server room). isdaq00 is the main file server and hosts the home directories for the cluster. The VMIC cpus (lxbnqr,lxbnmr) and the CAMP VxWorks cpus (bnmrvw,polvw) also mount home directories served by isdaq00. These machines (isdaq00, isdaq01, isdaq06) are on UPS.

Note
Unless isdaq00 is up and running, and the network is working, it will be impossible to run the experiments.

Experimental setup

Two accounts with usernames "bnmr" and "bnqr" have been set up to run the bnmr and bnqr experiments. These accounts run the tshell, and the files /home/<beamline>/.cshrc contain the required setup for the experiments (see #File .cshrc). The ~/.login file (executed when logging in interactively) contains requried EPICS fonts (see #File .cshrc). Users may add more definitions to these files, but should not change any of the DAQ definitions or their experiments may fail to run properly.

Physica

Scripts to run physica are in directory /home/<beamline>/bin This directory also contains links to run bnmrfit, campvarlog and lcrplot. This directory is included in the PATH (hence no alias is defined). A local copy of the physica package is used (NOT the one in /triumfcs/linux/physica , which does not work for SL6).

Environment variables required for physica defined in .cshrc are shown in Table 3 below.


Environment Variables

There are a number of important Environment variables that must be correctly defined for the DAQ to run successfully. These are defined in .cshrc. This file is executed at login.

Some of the environment variables needed for data acquistion are :

  • DAQ setup (Table 1)
  • MIDAS setup (Table 2)
  • EPICS setup (Table 3)
  • Physica (Table 4)
Table 1 Defined Environment Variables (DAQ)
Name Purpose Value for expt:
bnmr bnqr
DAQ_HOST defines the name of the MIDAS Host isdaq01
BEAMLINE defines the beamline bnmr bnqr
VMIC_HOST defines the name of the MIDAS Frontend host (VMIC) lxbnmr lxbnqr
MUSR_DIR defines the path of MUSR libraries and required software /home/musrdaq/musr
CAMP_HOST name of CAMP host (mvme162) running VxWorks bnmrvw polvw
MSERVER_PORT defines the port to be used by environment variable MIDAS_SERVER_HOST 1176 1177


The MIDAS Environment variables required are shown in Table 2.

Table 2 Defined Environment Variables (MIDAS)
Name Purpose Value for expt:
bnmr bnqr
MIDASSYS Path of local copy of the MIDAS software package /home/bnmr/packages/midas /home/bnqr/packages/midas
MIDAS_EXPTAB Path of the experimental directory /home/bnmr/online/ /home/bnqr/online/
MIDAS_SERVER_HOST Must not be defined on MIDAS Host. Must be defined on VMIC isdaq01:1176 isdaq01:1177
MIDAS_EXPT_NAME MIDAS Experiment Name. Defined as BEAMLINE bnmr bnqr


Environment variables defined for EPICS are shown in Table 3 below:

Table 3 Defined Environment Variables for EPICS access
Name Purpose Value
EPICS_BASE path of EPICS package /home/midas/packages/epics-base
EPICS_HOST_ARCH host architecture linux-x86_64
FE_EPICS path of MIDAS client fe_epics /home/bnmr/epics
EPICS_PATH path of EPICS utilities /home/midas/packages/epics-base/bin/linux-x86_64
EPICS_CA_AUTO_ADDR_LIST YES
EPICS_CA_ADDR_LIST 142.90.133.255
EPICS_CA_REPEATER_PORT 9003
EPICS_CA_SERVER_PORT 9004
EPICS_CA_AUTO_LIST NO
EPICS_CA_ADDR_PORT 142.90.130.27


Environment variables defined for #Physica are shown in Table 4 below:

Table 3 Defined Environment Variables for PHYSICA
Name Purpose Value
TRIUMF_TERMINAL_TYPE TRIUMF default terminal type x
TRIUMF_PLOTTER_TYPE TRIUMF default plotter hp
TRIUMF_FONTS TRIUMF default fonts ${HOME}/physica/fonts
PHYSICA_INIT Initialization file ${HOME}/physica/physica_macros/PHYSICA.INIT
PHYSICA_DIR Path of physica package ${HOME}/packages/physica

Changing the Midas host

The MIDAS host is defined by the environment variable DAQ_HOST in the ~/.cshrc file. Only isdaq01 or alternatively isdaq06 can be the midas host, and successfully run the experiment, because these hosts have the required permission to write to the required EPICS variables. If isdaq01 fails, change the environment variable DAQ_HOST to isdaq06 and also remove or edit /home/<beamline>/vmic_online/$BEAMLINE/.SHM_HOST.TXT .

Aliases

A number of useful aliases that run various scripts or start programs are defined in .cshrc, e.g.

  • start-all runs a script to start missing MIDAS clients
  • kill-all runs a script to kill all MIDAS clients
  • show-windows runs a script to show the client windows for clients frontend, mdarc and mheader
  • BNMR: cleanup runs a program to perform the end-of-run clean up and archive procedure on saved run files.
  • camp runs the CAMP user interface
  • BNMR: mud_util runs the MUD utility program

File .cshrc

The parts of the ~/.cshrc file relevent to DAQ is shown below:

# file:  .cshrc 
........
## we do not use ROOT# ROOT
unsetenv ROOTSYS

# required fonts for EPICS are in .login

# clear these to start with
unsetenv LD_LIBRARY_PATH_ROOT
unsetenv LD_LIBRARY_PATH

# The MIDAS experiment (bnmr/bnqr) is running on $DAQ_HOST
setenv DAQ_HOST isdaq01
## setenv DAQ_HOST isdaq06   ## alternative host
##        (also has permission to write to EPICS)
##  When changing host,  also remove or edit
## /home/$BEAMLINE/vmic_online/$BEAMLINE/.SHM_HOST.TXT
#

# set up long host name(s) 
set triumf=".triumf.ca"
# needed for message in .login 
setenv daq_host $DAQ_HOST$triumf

setenv MIDASSYS $HOME/packages/midas
# standard MUSR cvs version (post-Ted)
setenv MUSR_DIR /home/musrdaq/musr 

# EPICS base 3.14.12 (installed under midas/packages/epics-base
# EPICS_CA_* environment variables defined below (independent of version)
setenv EPICS_BASE /home/midas/packages/epics-base

if (($LOGNAME == "bnmr") || ($LOGNAME == "bnqr")) then
  setenv BEAMLINE $LOGNAME
  setenv VMIC_HOST lx$BEAMLINE  # VMIC hostname (also used in some makefiles)
  setenv vmic_host $VMIC_HOST$triumf  # long name
endif

setenv ONLINE vmic_online   # online is now a softlink to vmic_online


# Specific to DAQ machines  DAQ_HOST and VMIC_HOST
switch (`hostname`)
 case $DAQ_HOST*:
 case $VMIC_HOST*:

   setenv MIDAS_EXPT_NAME $BEAMLINE
  
   # Assign MSERVER_PORT
   # MSERVER_PORT also used in start-daq-tasks-bn[mq]r
   switch  ($BEAMLINE)
     case bnmr:
       setenv MSERVER_PORT 1176
       breaksw
     case bnqr:
       setenv MSERVER_PORT 1177
     endsw

   # setup the MIDAS mserver
   switch (`hostname`)
   case $DAQ_HOST*:
      unsetenv MIDAS_SERVER_HOST
      setenv MIDAS_EXPTAB  $HOME/$ONLINE/exptab
      breaksw
   case $VMIC_HOST*:
      # MIDAS server port for this beamline is $MSERVER_PORT
      # needed for $VMIC_HOST to communicate with $DAQ_HOST
      setenv MIDAS_SERVER_HOST $daq_host":"$MSERVER_PORT
      if ( $BEAMLINE == "bnmr") then
         setenv FECOL azure
      else
         setenv FECOL mintcream
      endif
   endsw
endsw  #  end of DAQ_HOST and VMIC_HOST

# select 64-bit or 32-bit MIDAS
switch (`uname -i`)
case i386:
     setenv LINUX linux-m32
     setenv EPICS_HOST_ARCH linux-x86
     setenv CAMP_DIR $MUSR_DIR/camp/linux-m32
     alias  start-fe $HOME/$ONLINE/$BEAMLINE/bin/start_fe$BEAMLINE
     alias  kill-fe  'perl $HOME/$ONLINE/$BEAMLINE/bin/kill_fe$BEAMLINE.pl'
     breaksw
default:
     setenv LINUX linux
     setenv EPICS_HOST_ARCH linux-x86_64
     setenv CAMP_DIR $MUSR_DIR/camp/linux
     alias  cleanup  $HOME/bin/cleanup
     #MUD_UTIL  MUD is only built 64 bit
     setenv MUD_UTIL $MUSR_DIR/mud/bin 
     alias mud_util $MUD_UTIL/mud_util
endsw

# Specific to $DAQ_HOST  DAQ machine
if ( ($HOST == $DAQ_HOST) ||(  $HOST == $daq_host)) then
     alias start_autoruns  ~musrdaq/musr/musr_midas/mui/autoruns.tcl
     # softlink $HOME/epics now points to $HOME/vmic_online/epics
     setenv FE_EPICS $HOME/epics
     alias start-all ~/$ONLINE/$BEAMLINE/bin/start-daq-tasks-$BEAMLINE
     alias kill-all ~/$ONLINE/$BEAMLINE/bin/kill-all
     alias show-windows  ~/$ONLINE/$BEAMLINE/bin/show-windows
     alias start_mhttpd ~/$ONLINE/$BEAMLINE/bin/start_mhttpd
     alias restart_mhttpd ~/$ONLINE/$BEAMLINE/bin/restart_mhttpd
     # alias for serial debug port for MVME162 CAMP board via terminal server 
     alias ppc2 '~/$ONLINE/vw_console/start_pol_mvme162 $BEAMLINE'

  if ( $BEAMLINE == "bnmr") then
       setenv FGCOL white
       setenv BGCOL blue 
       setenv FECOL azure
    else
       setenv FGCOL white
       setenv BGCOL lightseagreen
       setenv FECOL mintcream
    endif

else   # NOT $DAQ_HOST
    alias start-all echo "This is $HOST.  Run start-all from $DAQ_HOST."
    alias kill-all  echo "This is $HOST.  Run kill-all from $DAQ_HOST."
endif 

setenv MIDAS_LINUX $MIDASSYS/$LINUX
setenv EPICS_PATH $EPICS_BASE/bin/$EPICS_HOST_ARCH
setenv LD_LIBRARY_PATH ${EPICS_BASE}/lib/$EPICS_HOST_ARCH
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/musrdaq/lib

setenv PATH $MIDAS_LINUX/bin:${PATH}:.
setenv PATH ${PATH}:${EPICS_PATH}:${CAMP_DIR}
setenv PATH ${PATH}:$HOME/scripts:$HOME/bin
# use own copy of physica;  /triumfcs/linux/physica does not work


# EPICS any base
setenv EPICS_CA_AUTO_ADDR_LIST YES
setenv EPICS_CA_ADDR_LIST 142.90.133.255
setenv EPICS_CA_REPEATER_PORT 9003
setenv EPICS_CA_SERVER_PORT 9004
setenv EPICS_CA_AUTO_LIST NO
setenv EPICS_CA_ADDR_PORT 142.90.130.27
#


alias check_host ~/$ONLINE/$BEAMLINE/bin/check-host-$BEAMLINE
#

#CAMP
setenv CAMP_HELP $CAMP_DIR
setenv CAMP_HOST polvw.triumf.ca
alias camp_cmd $CAMP_DIR/camp_cmd
alias camp     $CAMP_DIR/camp_cui


set history = 500
setenv CERN_ROOT /cern/pro
setenv NODE `hostname`
setenv EXINIT 'set redraw wm=8'

setenv HP_LASER las61
setenv PRINTER las61

# Physica - use small scripts in ~/bin
# To run bnmrfit, use bnmrfit script, not "physica"
setenv TRIUMF_TERMINAL_TYPE x
setenv TRIUMF_PLOTTER_TYPE hp
setenv TRIUMF_FONTS  ${HOME}/physica/fonts
setenv PHYSICA_INIT  ${HOME}/physica/physica_macros/PHYSICA.INIT
setenv PHYSICA_DIR   ${HOME}/packages/physica


# CVS
alias cvsmidas 'cvs -d pierre@midas.psi.ch:/usr/local/cvsroot \!*'
setenv CVSROOT midas@dasdevpc:/usr/local/cvsroot
setenv CVS_RSH ssh
setenv EDITOR "emacs -nw"
alias emacs  "emacs -fn 10x20"
alias cvs_suz 'cvs -d "suz@dasdevpc:/usr/local/cvsroot"'
.........................

alias msr2txt "/home/bnmr/bin/msr2txt"
setenv LANG C  # for man page

File .login

The file ~/.login is shown below"

# The commands in this file are executed when a csh user first
# logs in.  This file is processed after .cshrc.
#
# $Revision: 1.6 $
#
# EPICS fonts...  put xset in .login rather than .cshrc
if ( "$?DISPLAY" ) then
  if ( "$DISPLAY" =~ "*:0.*" ) then
    if ( `xset -q` =~ "*/usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/75dpi/*" ) then
      #echo "Bitmap font paths already set"
    else
      #echo "Set bitmap font paths for display $DISPLAY"
      xset +fp /usr/share/X11/fonts/100dpi/
      xset +fp /usr/share/X11/fonts/75dpi/
    endif
  else
    #echo "Display is not the console"
  endif
else
  #echo "There is no display"
endif