EPICS-Overview-Lecture1 by xiaopangnv

VIEWS: 7 PAGES: 25

									                 EPICS Overview


                   Lecture 1
                    Matt Boyes




25 August 2009                                Matt Boyes
EPICS Overview                   mboyes@slac.stanford.edu
                                 Class Outline
      Lecture 1: Intro to EPICS
           What is EPICS
           EPICS Channel Access
           What is a PV
           What is a Database
                 Types of IOCs
           LCLS Network Details
           Channel Access Permissions/Security
           LCLSHome
                 EPICS LCLS Environment Setup
                 LCLSHome Displays
                 Display Tips




25 August 2009                                                Matt Boyes
EPICS Overview                                   mboyes@slac.stanford.edu
                             Class Outline (cont.)
      Lecture 2: Diagnostics and tools
           Channel Archiver
           StripTool
           Message Log
           Score
           BPM Orbit Display
           IRMIS
           Matlab GUIs
                 Correlation plots
           Command Line Tools
                 cainfo
                 caget
                 caput
                 Camonitor
                 CWget
                 CWput

25 August 2009                                             Matt Boyes
EPICS Overview                                mboyes@slac.stanford.edu
                                  What is EPICS
      EPICS stands for Experimental Physics and 
Industrial Control System

           A Collaboration
                 Major Collaborators
                     ANL (APS Accelerator, APS Beamlines, IPNS)
                     LANL
                     ORNL (SNS)
                     SLAC (SSRL, LCLS)
                     JLAB (CEBAF)
                     DESY
                     BESSY
                     PSI (SLS)
                     KEK
                     Diamond Light Source




25 August 2009                                                                 Matt Boyes
EPICS Overview                                                    mboyes@slac.stanford.edu
                                What is EPICS
           A Software Toolkit

           A Control System Architecture



                              EPICS
                     CA                     CA
                     Client                Client



                                 CA                 CA
                                 Server             Server



25 August 2009                                                   Matt Boyes
EPICS Overview                                      mboyes@slac.stanford.edu
                                                              5
                                Channel Access
 Channel Access protocol is the way EPICS communicates. Process Variable (PV)
   data is transferred between Servers and Clients.

      CA Servers (IOCs)
           IOCs (Distributed)
             Where PVs live
                 Database
      Clients
           EDM Displays
           StripTool
           Probe
           Channel Archiver
           Matlab
           etc




25 August 2009                                                 Matt Boyes
EPICS Overview                                    mboyes@slac.stanford.edu
                               EPICS CA Overview
                 Client     StripTool     Probe     EDM     Matlab           Archiver




                                          Channel Access




                   Server               SIOC          IOC                   IOC


                                        Meter     Power Supply           Camera
                                                               Based On Getting Started with EPICS Lecture
                                                              Series “Introduction to Channel Access Clients”
                                                                                          Kenneth Evans, Jr.


25 August 2009                                                           Matt Boyes
EPICS Overview                                              mboyes@slac.stanford.edu
                 Search and Connect Procedure
                 Client     StripTool     Probe         EDM           Matlab           Archiver

                                              3. TCP Connection
                                                  Let’s talk !

                              2. UDP Reply                       1.    UDP Broadcast Sequence

                                I have it !                                   Who has it ?



                   Server
                   Check               IOC
                                      Check               IOC
                                                           IOC
                                                          Check                      IOC
                                                                                    Check


                                        Meter        Power Supply                  Camera
                                                                         Based On Getting Started with EPICS Lecture
                                                                        Series “Introduction to Channel Access Clients”
                                                                                                    Kenneth Evans, Jr.


25 August 2009                                                                     Matt Boyes
EPICS Overview                                                        mboyes@slac.stanford.edu
                                     What is EPICS?
      Process Variable

           A Process Variable (PV) is a named piece of data associated with the
           machine (e.g. status, readback, setpoint, parameter)

           Examples of PV names and values:
                  LASR:IN20:196:PWR 27.8 uJ
                  VGCC:IN20:605:P 3.2e-08 torr
                  BPMS:IN20:425:X1H -0.323 mm                     Examples of:
                  BEND:LI21:215:BACT 0.7684 kG-m                   LCLS Electron        PV Names
                  VVPG:IN20:155:POSITION ‘OPEN’
                  S3:DIPOLE:PS:setPoint 123.4 Amps
                  APS:Mode ‘Stored Beam’
                  BL3:HISTOGRAM {3, 8, 1, 2, 56, 44, 32, 43, 3, 5, 1}

                 Details of the LCLS Electron PV naming convention can be found here:
                 http://lcls-dev.slac.stanford.edu/tiki-index.php?page=LCLS+Naming+Conventions
                                                                                Getting Started with EPICS Lecture Series
                                                                                                     Introductory Session I
                                                                                                                Ned Arnold




25 August 2009                                                                     Matt Boyes
EPICS Overview                                                        mboyes@slac.stanford.edu
                                 What is EPICS?
       A Process Variable is a named piece of data with a set of fields
         Examples of fields:
                 Alarm Severity (e.g. NO_ALARM, MINOR, MAJOR, INVALID,
                 WHITE)
                      IOC:IN20:TM01:HEARTBEAT
                 Engineering Unit Designation (e.g. degrees, mm, MW)
                      LASR:IN20:196:PWR
                 Value (default if no field is given)
                      IOC:IN20:TM01:HEARTBEAT




                                                               Getting Started with EPICS Lecture Series
                                                                                   Introductory Session II
                                                                                           John Maclean

25 August 2009                                                       Matt Boyes
EPICS Overview                                          mboyes@slac.stanford.edu
                      What do PV (records) do?
           Records are active, they do things
                Get data from other records or from hardware
                Perform calculations
                Check values are in range and raise alarms
                Put data to other records or to hardware
                Activate or disable other records
                Wait for hardware signals (interrupts)
           What a record does depends upon its type and the values in its fields
           A record does nothing until it is processed, it’s INVALID




                                                                             Getting Started with EPICS Lecture Series
                                                                                                 Introductory Session II
                                                                                                         John Maclean

                                                                                                                       11
25 August 2009                                                                     Matt Boyes
EPICS Overview                                                        mboyes@slac.stanford.edu
                               PV Record types
          Classified into four general types
          Input: e.g.
               Analog In (AI)
               Binary In (BI)
               String In (SI)
          Algorithm/control: e.g.
               Calculation (CALC)
               Subroutine (SUB)
               General Subroutine (genSub)
          Output: e.g.
               Analog Out (AO)
               Binary Out (BO)
          Custom: e.g.
               Beam Synchronous Acquisition (BSA)


                                                           Getting Started with EPICS Lecture Series
                                                                               Introductory Session II
                                                                                       John Maclean

                                                                                                     12
25 August 2009                                                   Matt Boyes
EPICS Overview                                      mboyes@slac.stanford.edu
           EPICS Databases – What are they?
           A collection of one or more EPICS records of various types
           Records can be interconnected and are used as building blocks to create
           applications
           A data file that’s loaded into IOC memory at boot time
           Channel access talks to the IOC memory copy of the database




                                                                    Getting Started with EPICS Lecture Series
                                                                                        Introductory Session II
                                                                                                John Maclean

                                                                                                              13
25 August 2009                                                            Matt Boyes
EPICS Overview                                               mboyes@slac.stanford.edu
                 EPICS IOCs – What are they?

      IOC: Input Output Controller
      Communicates with the hardware, other IOCs and clients
      Were the EPICS PVs live
      LCLS IOC Types
           VME IOCs
                VME: 3100/6100 (IOC)
                Embedded: Coldfire (EIOC)
                SoftIOCs: Linux process (SIOC)




                                                                                      14
25 August 2009                                                          Matt Boyes
EPICS Overview                                             mboyes@slac.stanford.edu
                              IOC view of a record
   record(sub, "BEND:DMP1:400:BACT") {
     field(DESC, "Actual B")                   record(ai, "BPMS:LI21:131:X") {
     field(INAM, "mgntInitPoly")                 field(DESC, "X Position")
     field(SNAM, "mgntReversePoly")              field(EGU, "mm")
     field(INPA, "BEND:DMP1:400:BACT")           field(DTYP, "Raw Strip Signal")
     field(INPB, "BEND:DMP1:400:POLYCOEF")       field(INP, "#C0 S14")
     field(INPC, "BEND:DMP1:400:POLYCOEF.A")     field(FLNK, "BPMS:LI21:131:Y")
     field(EGU, "GeV/c")                         field(PREC, "4")
     field(HOPR, "17.5")                         field(LOPR, "-12")
     field(LOPR, "0.055")                        field(HOPR, "+12")
     field(HIHI, "17.5")                       }
     field(LOLO, "0.055")
     field(PREC, "7")
     field(BRSV, "INVALID")
     field(HHSV, "MAJOR")
     field(HSV, "MINOR")
     field(LSV, "MINOR")
     field(LLSV, "MAJOR")
     field(FLNK, "BEND:DMP1:400:BACTFO")
     field(HIGH, "17.5")
     field(LOW, "0.055")
     field(INPD, "BEND:DMP1:400:POLYCOEF.B")
     field(INPE, "BEND:DMP1:400:IACT MS")
     field(INPF, "BEND:DMP1:400:BDELTAS PP")                    Getting Started with EPICS Lecture Series
                                                                                    Introductory Session II
     field(INPG, "100")
                                                                                            John Maclean
   }
                                                                                                          15
25 August 2009                                                        Matt Boyes
EPICS Overview                                           mboyes@slac.stanford.edu
                       Putting it all together
                                                Channel Access Client             ProcTemp
                               Tell me about                                      .VAL
                                                                                  .VAL  = 51.5  =   45.5
                                                                                  .EGU          =   deg C
                                                                                  .STAT         =   MAJOR
                                                                                                    Normal
                                    ProcTemp


                                     IOC                    Channel Access Server
   Process       Temperature        Analog to
                 Sensor             Digital
                                                          Database
                                    Converter

                                                               Analog In
                                                               ProcTemp
                 45.5°C 4.55V                                                        45.5 deg
                                                                                     51.5 deg
                 51.5°C 5.15V                  116
                                               132 bits        INP        VAL           C
                                                                                        C
                                                               EGU : deg C
                                                               EGUL: 0
                                                               EGUF: 100
Normal Operation 0 – 100°C 8 bit ADC
                                                               HIGH: 51
5 - 50°C         0 – 10V   0 – 10V
                           0 – 255 bits                                  Getting Started with EPICS Lecture Series
                                                                                             Introductory Session II
                                                                                                     John Maclean
                                                                                                                   16
25 August 2009                                                               Matt Boyes
EPICS Overview                                                  mboyes@slac.stanford.edu
                                              LCLS Controls System
                                                                                           Staging System                  REMEDY
                 AFS                               NFS                                        (backup)                     (Artemis)
                                                                                                                                                           SCCS PUBS



    desktops             CVS                 NIS                WEB                              lcls-dev2                             IOCs
                                                                                                                                                               LCLSDEV




                           px01                                                opi00nas03        mccora2          mccas0         mccas1         NIS      WEB
   LAVC                                                                                                                                                            DMZ
                                                                Filtering
                                                                 Router

                                                                                  lcls-prod01       lcls-prod02       lcls-archsrv        physics-elog      mccelog
                               sunsrv00            MCC
               px00
    PEP




                OPIs            lcls-opi01         lcls-opi02                         mccfs2                                           lcls-builder
                                                                                                                                                                  CA



   IOCs           lcls-opi03          lcls-opi04                            lcls-daemon1        lcls-srv01        lcls-archeng



                                                                                                                                          Ernest and Jingchen, 04/15/08



25 August 2009                                                                                                            Matt Boyes
EPICS Overview                                                                                               mboyes@slac.stanford.edu
                   Important Network Details
                                                                                      LCLS Controls System
  • LCLS DEV clients (lcls-dev2) can not
  access CA Network PVs                                  AFS                               NFS
                                                                                                                                   Staging System
                                                                                                                                      (backup)
                                                                                                                                                                   REMEDY
                                                                                                                                                                   (Artemis)
                                                                                                                                                                                                   SCCS PUBS



                                            desktops             CVS                 NIS                WEB                              lcls-dev2                             IOCs
                                                                                                                                                                                                       LCLSDEV




                                                                   px01                                                opi00nas03        mccora2          mccas0         mccas1         NIS      WEB
                                           LAVC                                                                                                                                                            DMZ
                                                                                                        Filtering
                                                                                                         Router


  • LCLS DMZ clients (lcls-prod02) have                px00
                                                                       sunsrv00            MCC
                                                                                                                          lcls-prod01       lcls-prod02       lcls-archsrv        physics-elog      mccelog



  read only access to CA Network PVs
                                           PEP




                                                        OPIs            lcls-opi01         lcls-opi02                         mccfs2                                           lcls-builder
                                                                                                                                                                                                          CA



                                           IOCs           lcls-opi03          lcls-opi04                            lcls-daemon1        lcls-srv01        lcls-archeng



                                                                                                                                                                                  Ernest and Jingchen, 04/15/08




  • EPICS Environment automatically
  setup for group accounts on CA
  Network Computers
  (host=lcls-srv01 users={physics,
  acclegr, iocegr})


25 August 2009                                                                                                          Matt Boyes
EPICS Overview                                                                                             mboyes@slac.stanford.edu
                   Channel Access Permissions/Security

      PV Read Only Access from DMZ computers
      (lcls-prod02)

      PV Write Access from CA computers
      (lcls-srv01, sunrays, MCC computers)

      IOCs can further restrict read/write access by
      username and by computer name
      (eoicdesk only)




25 August 2009                                                      Matt Boyes
EPICS Overview                                         mboyes@slac.stanford.edu
                            User Environment Setup
      epicsReset.bash
            Must be in bash shell
            Channel Access settings
            Necessary for running lclshome

      LCLS EPICS Read Only Setup on Linux
      Login to lcls-prod02 with:
      (From outside SLAC: you can not go directly to this machine unless you use VPN or jump from another SLAC host)
      $ ssh -X -Y username@lcls-prod02.slac.stanford.edu

      Find out what shell you are running by typing echo $SHELL. Your shell will be either tcsh or bash.
      ex:
      $ echo $SHELL
              /bin/bash (I am running bash.)

      If you are using tcsh, type this command to enter the bash shell before proceeding:
      $ bash

      If you are using bash, type this command:
      $ source /afs/slac/g/lcls/epics/setup/epicsReset.bash

      As an alternative you can skip the above step and instead copy the following file to your home directory. This file
      includes the command to source the setup script listed in the above. The advantage is that this script is executed
      automatically when you type bash.
      $ cp ~jingchen/.bashrc .

      More info at http://lcls-dev.slac.stanford.edu/tiki-index.php -> EPICS Classes

25 August 2009                                                                                  Matt Boyes
EPICS Overview                                                                     mboyes@slac.stanford.edu
                                       LCLSHome
      To start LCLSHome, type
      [mboyes@lcls-prod02:~]$ lclshome
      Top display is summary status by subsystem vs location
           Complex areas are further divided, check help for details
           Important Alarms/severity should propagate up from lower sub displays
           Summary Alarms can by bypassed on LCLSHOME, a        * indicates a PV in that location is
           bypassed.




25 August 2009                                                                    Matt Boyes
EPICS Overview                                                       mboyes@slac.stanford.edu
                                       Display Tips
      Some helpful EDM tips
         Middle Mouse Click on a PV will show the PV name.
                 This can by dragged and dropped to copy/paste the PV name somewhere else.
           Control + Middle Mouse Click on a PV
                 A message window will appear with helpful PV info (cainfo)
                 Additional operations will append message window until use clears window.
                 HOST IOC (where PV exists) is displayed, only works on production hosts (lcls-srv01)
                       Does not apply to
                       SoftIOCs running
                       on a linux server.



           Graphs
                 Rubber banding
                 to zoom


25 August 2009                                                                     Matt Boyes
EPICS Overview                                                        mboyes@slac.stanford.edu
                               Display Tips (cont.)
      Some helpful EDM tips
         Control + Shift + Middle Mouse Click on a PV
                 Brings up submenu to send PV to
                      Probe
                      Plot History in Matlab Window




25 August 2009                                                       Matt Boyes
EPICS Overview                                          mboyes@slac.stanford.edu
                 Your Homework before Lecture 2
      Each person should:
        Have a unix account
        Have the EPICS environment a setup
           See slide “User Environment Setup”
        Be able to start lclshome on lcls-prod02
        Optional:
                 Be able to log in to lcls-srv01 with a group account:
                     acclegr
                     physics




25 August 2009                                                       Matt Boyes
EPICS Overview                                          mboyes@slac.stanford.edu
                 Questions




25 August 2009                            Matt Boyes
EPICS Overview               mboyes@slac.stanford.edu

								
To top