EPICS interface

From tigwiki

Jump to: navigation, search

Contents

[edit] Caveat

Last updated 2 August 2005.  This is a work in progress.  This section includes a description of a TYPICAL setup in August 2005, and may not reflect current reality.  Always check the E-logs for the most recent configuration of the Lecroy 2551 IScalers, Scalers -- what they are, how to view them#IScalers. If in doubt, trace the cables yourself.

[edit] Why you might want to do this

The interface between EPICS and 8pi MIDAS is intended to facilitate beamline setup and beam monitoring, by providing information on the beamline setup and count rates in the 8pi detectors in a way that can be accessed centrally by ISAC operations and the experimenters.  It has been recently upgraded to allow ISAC EPICS variables to be included in the data stream.

For example, it would be possible for ISAC operations to simultaneously view SCEPTAR beta-singles count rate and cyclotron current, so that while they are tuning a particularly low-yield product, they would be able to see immediately what effect they are having on delivery to the experimental station.  It is now also possible to read in the cyclotron current at a given time, which would be useful for rejecting runs or parts of runs where no useful activity was created and delivered.

[edit] How it works

The Epics client is treated as its own equipment.  This version is adapted from a general-purpose MIDAS-EPICS interface.  It demands, or attempts to write, data into up to 20 ISAC devices, and measures, or reads back, those same 20 devices.  This happens approximately once per second.  At specified intervals it writes an Event Type 5 containing the floating-point values demanded in a DMND bank, and the values measured in an MSRD bank.

The channels being accessed and the values being written are controlled through ODB entries in the /Equipment/Epics/Settings/ tree, http://isdaq08.triumf.ca:8081/Equipment/Epics/Settings?exp=8pi    The entries Devices/Epics/Channel names[0...19] contain the EPICS device (or channel) names to be demanded and measured.  The entries Names[0...19] are set to appropriate labels for those channels.  The Update Threshold Measurement[0...19] settings do something but I'm not sure what.

The Epics client for the 8pi also has some built-in code that periodically (once per second) sets the "demand" values 0 to 11 to those in /Equipment/Iscaler/Variables/ISCL[0...11], i.e., identical to those in the Scalers -- what they are, how to view them#IScalers.

[edit] Starting the Front-End MIDAS to EPICS client

The Epics client executable is called fe_epics and exists in /tig/grsmid00_home1/eightpi/online/fe_epics.  You will see a green Epics entry on the status page when it is running properly.  Typically you should run it on grsmid00.  To run it:

nice +4 /tig/grsmid00_home1/eightpi/online/fe_epics/fe_epics

NOTES:

  • Any time you change channels or names, stop and restart this client.
  • This code does NOT run nicely in the background.
  • I have not been able to stop it from the Programs listing reliably.
  • Chances are you will have to kill it manually.

[edit] Connecting to Epics GUI

The EPICS GUI is handy for viewing the status of beamline, plus it has a handy "striptooling" feature. To get into it, ssh -X 8pi@isacepics1.

  • For striptooling, click on the Utilities button and select Start Strip Tool from the pull-down menu. This brings up a StripTool Controls window. You can then type in any valid EPICS variable in the Plot New Signal field and press Connect, including those mentioned in the "8pi EPICS Once this is done you will get a graphics strip tool that displays traces from the variables you requested. If you lose the Controls window, right click on the graphical traces display and select Controls Dialog from the pulldown.
  • For the 8pi beamline, navigate through the various windows and pulldowns, starting with the Vacuum 1 or LE Exp. buttons as appropriate.

If you are having trouble connecting to isacepics1:

  • Make sure your DISPLAY variable is set properly: echo $DISPLAY from a Linux console. Typically it will have a form like isdaq08.triumf.ca:0.0. Replace isdaq08.triumf.ca with whatever machine you happen to be sitting at. If the DISPLAY variable looks wrong, set it with either export DISPLAY=isdaq08.triumf.ca:0.0 or setenv DISPLAY isdaq08.triumf.ca:0.0
  • Delete the ~/.ssh/known_hosts file and try again.

[edit] EPICS Device Names for the 8pi

The 8pi EPICS virtual devices have the form 8PI:CSCL:VAR1 to 8PI:CSCL:VAR20.  Writing to these devices will not actually affect any real physical devices controlled by the ISAC EPICS server; as far as ISAC is concerned, it is a purely logical, virtual device.  We can write values to them, and everyone with EPICS access can read those values.

[edit] Finding ISAC Device Names

Any variable on an EPICS page that is blue is a measured value that can be sent back to the 8pi Epics client for inclusion into the data stream.  To determine the EPICS device name, name, middle-click on the value. This will automatically copy the EPICS name into the cut-and-paste buffer. You can then paste it into an entry field, like the StripTool Plot New Signal field, by middle-clicking in the field.

On modern mice, the wheel is your middle button; push it down.  If you are on a two-button system, like most older PCs and some laptops, X servers can be configured to emulate the middle button by simultaneously pressing both buttons.  Check the help menus on your X server for "middle button" to see how this is done.

Some other handy variables you might want to be able to Striptool:

  • Ion guage near 8pi target chamber:  ILE1A:IG9:RDVAC
  • Main separator magnet measured field:  IMS:MB2:RDMETER
  • Main separator magnet measured current:  IMS:MB2:RDCUR
  • Shack temperature:  ILE1A:TC1:RDVOL

[edit] Common Non-ISAC Device Names

Some handy Non-ISAC device names:

  • Beam Line 2A Current:  CCS2ISAC:BL2ACURRENT

Ultimately, Jane Richards is the person to contact if you want to inquire about non-ISAC variables that might be available to ISAC EPICS for striptooling.  If you come across any other good varfiables let Greg know and he'll (try to) add them to this list.

[edit] A typical configuration

Some typical settings are demonstrated in the follwing extract from an odbedit session:

[local:8pi:S]/> ls -l "/equipment/epics/Settings/Devices/Epics/Channel name"
Key name                        Type    #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
Channel name                    STRING  20    32    3h   0   RWD
                                        [0]             8PI:CSCL:VAR1
                                        [1]             8PI:CSCL:VAR2
                                        [2]             8PI:CSCL:VAR3
                                        [3]             8PI:CSCL:VAR4
                                        [4]             8PI:CSCL:VAR5
                                        [5]             8PI:CSCL:VAR6
                                        [6]             8PI:CSCL:VAR7
                                        [7]             8PI:CSCL:VAR8
                                        [8]             8PI:CSCL:VAR9
                                        [9]             8PI:CSCL:VAR10
                                        [10]            8PI:CSCL:VAR11
                                        [11]            8PI:CSCL:VAR12
                                        [12]            CCS2ISAC:BL2ACURRENT
                                        [13]            IMS:MB2:RDMETER
                                        [14]            IMS:MB2:RDCUR
                                        [15]            ILE1A:IG9:RDVAC
                                        [16]            8PI:CSCL:VAR17
                                        [17]            8PI:CSCL:VAR18
                                        [18]            8PI:CSCL:VAR19
                                        [19]            8PI:CSCL:VAR20
[local:8pi:S]/> ls -l "/equipment/epics/Settings/Names" 
Key name                        Type    #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
Names                           STRING  20    32    3h   1   RWD
                                        [0]             Ge Array Raw
                                        [1]             Ge Accepted
                                        [2]             Plastic Array Raw
                                        [3]             Plastic 01 Raw
                                        [4]             Plastic 18 Raw
                                        [5]             Plastic Accepted
                                        [6]             SiLi Array Raw
                                        [7]             SiLi Accepted
                                        [8]             BaFF Array Raw
                                        [9]             BaFF Accepted
                                        [10]            Ge-Plastic Rate
                                        [11]            Gamma-Gamma
                                        [12]            BL2A Current
                                        [13]            Magnet Field
                                        [14]            Magnet Current
                                        [15]            Target Chamber Vacuum
                                        [16]            Unused
                                        [17]            Unused
                                        [18]            Unused
                                        [19]            Unused
[local:8pi:S]/> ls -l /equipment/epics/Variables/Measured[12]
Key name                        Type    #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
Measured[12]                    FLOAT   20    4     1s   0   RWD
                                        [12]            32.9

This arrangement gives the physical meaning of the Scalers -- what they are, how to view them#IScalers 0 to 11, and sends them to the virutal devices 8PI:CSCL:VAR1 to VAR12.  These can be read in the ISAC operations control room and possibly used to help tune beam.  The cyclotron current  CCS2ISAC:BL2ACURRENT is also read back as the 12th (from zero) device; in this screen dump it is measured to be 32.9 microamps.

As noted the demand and measured data are both dumped to event type 5:

8pi@isdaq08:/home/8pi> mdump -i 5
-1.9.4 -- Enter <!> to Exit ------- Midas Dump ---
------------------------ Event# 1 ------------------------
Evid:0005- Mask:0000- Serial:3595- Time:0x42eff51b- Dsize:184/0xb8
#banks:2 - Bank list:-DMNDMSRD-

Bank:DMND Length: 80(I*1)/20(I*4)/20(Type) Type:Real*4 (FMT machine dependent)
   1-> 2.059e+03 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00
   9-> 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00
  17-> 0.000e+00 0.000e+00 0.000e+00 8.900e+01

Bank:MSRD Length: 80(I*1)/20(I*4)/20(Type) Type:Real*4 (FMT machine dependent)
   1-> 2.059e+03 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00
   9-> 0.000e+00 0.000e+00 0.000e+00 0.000e+00 3.290e+01 -2.772e+03 1.302e+02 8.956e-07
  17-> 0.000e+00 0.000e+00 0.000e+00 8.900e+01

The 13th (or 12th, counting from zero) element of MSRD corresponds to measured device 12, CCS2ISAC:BL2ACURRENT, and happens to be reading 32.9 μA.

Personal tools
Experiment Pages