BNMR: EPICS

From DaqWiki
Revision as of 11:11, 2 May 2022 by Bsmith (talk | contribs)
Jump to navigation Jump to search

Purpose

This page gives bnmr or bnqr DAQ users information about the ISAC EPICS Control Pages and the Access required for running bnmr or bnqr experiments.

Introduction

The EPICS system is used at TRIUMF for the control system for beamlines etc. Experimenters will need to display the Epics Control Pages in order to run the bnmr or bnqr experiments. They must also ensure that BNMR has been granted write access to the required Epics parameters as described below, or they will not be able to change the relevant beamline controls.

Display ISAC EPICS control pages

Switch onto a different desktop on linux box isdaq01 (or isdaq06) so the Epics Control page does not clutter the desktop used for running the experiment. Access the epics control pages on isacepics1 with ssh from an xterm window, as follows (if you don't know the password, ask a group member).

ssh bnmr@isacepics1
( Type in the password )

You should see the main ISAC EPICS control page come up after a few seconds (Figure 1).

Figure 1: ISAC EPICS control page



Note
There is no bnqr user account on isacepics1. The bnmr account is used for both experiments and the same EPICS access permission (i.e. BNMR) applies to both.

Write access to EPICS polarizer parameters

Most Epics parameters can be read by anyone, but write access has to be granted by the Controls Group. Several experiments have been granted write access to the same polarizer IOCs, and to avoid conflict, only one of these experiments is granted overall Access. During the beam period, and for testing the helicity switching etc, access must be granted to expbnmr.

To check whether expbnmr has access, display the main EPICS control pages.

On the main EPICS Control Page (cf Figure 1) click the button labelled "Access". A page similar to Figure 2 will be displayed.

Figure 2: ISAC Access Control


Clicking on the View access button (Figure 2) will show the current access. This should be set to expbnmr as in Figure 3.

Figure 3: Polarizer Access set to expbnmr


If the Access is not set to expbnmr, ask the operators to switch the access by pressing the button Polarizer Access for bNMR/bNQR (Figure 2).

Even when "Access" is granted to BNMR, only those EPICS IOCs to which BNMR has been granted write access can be changed by the experimenters from the EPICS Control pages, e.g. Helicity, NaCell Voltage, and all BNMR/BNQR parameters for single/dual channel mode control.

Some of these parameters are also writable by the bnmr and bnqr BNMR and BNQR VMICs (lxbnmr,lxbnqr). They have been granted write access by the Controls Group to allow the frontend programs to flip helicity and turn the beam on/off via PPG signals. The frontends also use EPICS to scan the Rb cell voltage, for example.

WARNING

There is NO protection against bnmr and bnqr experimenters changing Epics parameters via the Epics Control pages or the frontend programs while an experimental run is in progress on either bnmr or bnqr. When running in single channel mode, there is also no protection against each experiment interfering with each other by both flipping the helicity for example. Users must ensure that they know what they are doing!

Usage in software (frontend and logger)

EPICS is used by:

  • the frontend to scan the Rb cell voltage, laser intensity etc in certain modes
  • the frontend to report some histogram totals to operators
  • the frontend to sanity-check the dual channel mode and helicity settings
  • the logger to read any variables the user wants logging in the MUD file

EPICS environment variables

Currently (April 2022) bnmr and bnqr experiments are using epics-baseR3.14.12.

$ ls -lt /home/midas/packages/epics-base
 /home/midas/packages/epics-base -> epics-baseR3.14.12//
NOTE
Normally, EPICS environment variables are set for host and vmic hosts as in column 1 in Table 1 below.
As of April 2022, due to ongoing Juniper issues, we are using the temporary parameters listed in column 2 in Table 1 for isdaq01 only:
Table 1: EPICS Environment Variables
Values for isdaq01,lxbnmr,lxbnqr Temporary Values for isdaq01 only
[bnmr@lxbnmr ~]$ env | grep EPICS | sort
EPICS_BASE=/home/midas/packages/epics-base
EPICS_CA_ADDR_LIST=142.90.133.255
EPICS_CA_ADDR_PORT=142.90.130.27
EPICS_CA_AUTO_ADDR_LIST=YES
EPICS_CA_AUTO_LIST=NO
EPICS_CA_REPEATER_PORT=9003
EPICS_CA_SERVER_PORT=9004
EPICS_HOST_ARCH=linux-x86
EPICS_PATH=/home/midas/packages/epics-base/bin/linux-x86
[bnmr@isdaq01 ~]$ env | grep EPICS | sort
EPICS_BASE=/home/midas/packages/epics-base
EPICS_CA_ADDR_LIST=142.90.132.202
EPICS_CA_AUTO_ADDR_LIST=NO
EPICS_CA_REPEATER_PORT=9093
EPICS_CA_SERVER_PORT=9094
EPICS_HOST_ARCH=linux-x86_64
EPICS_PATH=/home/midas/packages/epics-base/bin/linux-x86_64

EPICS Troubleshooting

All EPICS access depends on the EPICS Environment variables being set up correctly, and linking with the correct version of the EPICS software in epics-base. Check the #EPICS_environment_variables are set correctly.

Try reading using caget

When having trouble accessing EPICS, first try to read one of the IOCs, e.g. the Na/Rb cell voltage with caget, e.g.

 caget ILE2:BIAS15:RDVOL
 ILE2:BIAS15:RDVOL              262.074

If instead the command times out

 caget ILE2:BIAS15:RDVOL
 Channel connect timed out: 'ILE2:BIAS15:RDVOL' not found

this indicates a problem with the EPICS environment variable settings or a firewall issue. EPICS controls are firewalled. Try the caget command several times, as there may be a packet-loss problem where caget only works some of the time (though most likely your environment variables are incorrect, or you're connecting from the wrong machine or account).

From isdaq01, reading any EPICS variable should work.

Check access using cainfo

First see write access to EPICS Polarizer parameters. If access is not granted, writing to the Polarizer parameters will not be successful.

In order to write to an EPICS variable, permission must be granted by the EPICS group. This is done by user and cpu. For example, users bnmr and bnqr on isdaq01 are granted permission to write to the EPICS Experiment variables for bnmr and bnqr respectively. Writing to the Na/Rb cell voltage IOC 'ILE2:BIAS15:RDVOL' is granted to users bnmr and bnqr on lxbnmr and lxbnqr respectively.

Run cainfo to check for write permission, e.g.

[bnqr@isdaq01 bnqr]$ cainfo BNQR:VAR1
BNQR:VAR1
    State:            connected
    Host:             ile2ioc.triumf.ca:9004
    Access:           read, write
    Native data type: DBF_DOUBLE
    Request type:     DBR_DOUBLE
    Element count:    1

Try writing using caput

caput can be used to write to an IOC, e.g.

[bnmr@isdaq01 ~]$  caput BNMR:VAR1 5
Old : BNMR:VAR1                      1.9869e+06
New : BNMR:VAR1                      5

If write access is false, the value will not change, but no error message will be output.

Try reading/writing using epics_test.exe

The frontend and logger use a more user-friendly C++ wrapper around the native EPICS API. You can test this wrapper using the epics_test.exe and epics_test_32bit.exe programs that are built alongside the frontend/logger.

Usage is like:

epics_test.exe get BNQR:VAR1       # Connect to EPICS then read PV as a number
epics_test.exe getstr BNQR:VAR1    # Connect to EPICS then read PV as a string
epics_test.exe set BNQR:VAR1 2.5   # Connect to EPICS then set PV value

EPICS checking

  • The frontend performs sanity-check of some EPICS variables at the start of the run - see the dual channel mode page for details.
  • The frontend checks the state of the helicity waveplate during a run - see the helicity page for details.