EPICS Training @ PSI - PowerPoint PPT Presentation

About This Presentation
Title:

EPICS Training @ PSI

Description:

... (not complete!): ANL (APS Accelerator, APS Beamlines, IPNS) in Chicago, USA ... Power Supply Beam Position Monitor Vacuum Gauge Computer Interface Computer ... – PowerPoint PPT presentation

Number of Views:336
Avg rating:3.0/5.0
Slides: 73
Provided by: elk74
Category:

less

Transcript and Presenter's Notes

Title: EPICS Training @ PSI


1
EPICS Training _at_ PSI
  • Controls Section PSI
  • 2015

2
Acknowledgment
  • Some slides in this talk came form the
  • Getting started with EPICS lecture series of
    APS.
  • My special thanks go to
  • Ned Arnold
  • and
  • John Maclean
  • from the Advanced Photon Source.
  • The original talks can be found on
  • www.aps.anl.gov/epics/docs/GSWE.php

3
Contents
  • What is EPICS
  • The Parts of EPICS
  • What are Records
  • An Example for a Record
  • How to Solve Problems with EPICS

4
What is an Accelerator Control System?
  • The Accelerator Control System connects the
    Operator in the control room with the accelerator
    hardware. The control room might not be near the
    accelerator
  • Our Control System
  • is called EPICS

?
EPICS
Operator
Accelerators
5
What does EPICS Control?
For example Swiss Light Source (SLS at PSI)
Accelerator components to control ca. 200
computers ca. 600 magnets (power supplies) 300
vacuum pumps 9 cavity structures ca. 150 beam
position monitors 21 beamlines (together) ca.
300 computers 10 undulator magnets more than 1200
motors Distances between components (storage
ring with 130 m diameter) 50 km power cable and
more than 500 km signal cable
6
What is EPICS?
EPICS is an abbreviation for Experimental
Physics and Industrial Control System
  • EPICS is
  • A collaboration
  • A software tool kit
  • A control system architecture
  • EPICS
  • supports distributed control systems for large
    research facilities like accelerators
  • uses Client/Server and Publish/Subscribe methods
  • uses the Channel Access (CA) network protocol

7
The History
  • In1989 started a collaboration between Los Alamos
    National Laboratory (GTA) and Argonne National
    Laboratory (APS)
  • (Jeff Hill, Bob Dalesio Marty Kraimer)
  • More than 150 licenses agreements were signed,
    before EPICS became Open Source in 2004
  • Team work on problems, for example over Tech
    Talk mailing list
  • Two collaboration meetings every year (spring and
    autumn) in turns in America, Asia, and Europe
  • Collaborative efforts vary
  • Assistance in finding bugs
  • Share tools, schemes, and advice

GTA Ground Test Accelerator APS Advanced Photon
Source
8
EPICS Who is Using That?
  • Some members of the collaboration (not
    complete!)
  • ANL (APS Accelerator, APS Beamlines, IPNS) in
    Chicago, USA
  • LANL in Los Alamos, USA
  • ORNL (SNS) in Oak Ridge, USA
  • SLAC (SSRL, LCLS) in Standford, USA
  • JLAB (CEBAF) in Newport, USA
  • DESY in Hamburg, Deutschland
  • BESSY in Berlin, Deutschland
  • PSI (SLS, HIPA, PROSCAN, SwissFEL) in Villigen,
    Schweiz
  • KEK in Tsukuba, Japan
  • DIAMOND Light Source (Rutherford Appleton
    Laboratory) in Oxfordshire, England
  • Iter (Test Fusion Power Plant), South France
  • ESS (European Spallation Source), Lund, Sweden

9
Are There Alternatives to EPICS?
  • System Name
  • EPICS
  • TANGO
  • DOOCS
  • Tine
  • ACS
  • PVSS(Cern)

10
The Architecture of EPICS
Network based Client/Server Model (hence the
EPICS logo)
A Server provides information and service A
Client uses the service or asks for the
information
CA
CA
Client
Client
CA
CA
Server
Server
  • For EPICS, client and server refer to their
    Channel Access role i.e. Channel Access Client
    and Channel Access Server
  • This standard control system architecture is
    often called
  • 3 tier architecture or 3 layer model

11
What is Channel Access?
  • A protocol how to transfer data over network
  • A single data unit is called Process Variable
  • A Process Variable has a unique name, which is
    used to refer to the data (Naming convention
    needed!)
  • The detailed operation of Channel Access is
    unimportant for most programmers (it already
    works)
  • Channel Access is not dependent on a single
    programming language (native library in C/C,
    Java, and C available)
  • The entire set of Process Variables establish a
    Distributed Real-time Database of machine status,
    information and control parameters

EPICS Database
12
Channel Access Network Flow
1. Query Broadcast
CA Client
2. Answer direct connection
3. All further queries and answers work directly
(Point-To-Point)
Network
CA Server 1
CA Server 2
CA Server 3
13
Channel Access Commands
connection request or search request
put or caput
get or caget
set a monitor
Change its value to 30.5
Notify me when the value changes
Who has a PV named S1AH1CurrentAO?
What is its value?
Channel Access Client
CA Client
CA Server
I do.
25.5 AMPS
OK, it is now 30.5
It is now 20.5 AMPS
It is now 10.5 AMPS
It is now 0.0023 AMPS
Channel Access Server
Process Variables
put complete
S1AH1CurrentAO S1P1x S1P1y S1G1vacuum
30.5 is too high. It is now set to the maximum
value of 27.5.
post an event or post a monitor
or
You are not authorized to change this value
or
14
How is it Done?
Channel Access Client
Channel Access Client
Channel Access Client
Operator
Network (Channel Access Protocol)
Channel Access Server
Process Variables
Power Supply
Computer Interface
S1AH1CurrentAO S1P1x S1P1y S1G1vacuum
Beam Position Monitor
Computer Interface
Vacuum Gauge
Computer Interface
Machine
15
What is EPICS - Conclusion
  • EPICS is a control system architecture
  • EPICS is the connection between accelerator and
    operator
  • EPICS is based on a transfer protocol named
    Channel Access
  • Channel Access works with data sets called
    Process Variables
  • EPICS is used by many institutes all over the
    world

16
Contents
  • What is EPICS
  • The Parts of EPICS
  • What are Records
  • An Example for a Record
  • How to Solve Problems with EPICS

17
Parts of EPICS
Client Programs alarmhandler Striptool,
caQtDM, many more (user programs)
CA Client
CA Client
Control Room
Cannel Access (UDP/TCP)
Input
CA Server
IOC
CA Server
Server Programs (user programs) Realtime
Control Records
4th Layer Hardware maybe controllers and PLCs
18
VME Computer
  • VME is an abbreviation for VERSAmodule Eurocard
  • Industry Computer
  • Developed since 1980
  • It is not a PC
  • Real-time capable (i.e. delays are calculable)
  • Operating system was VxWorks from Wind River
    company will be real time Linux (at PSI)
  • Very expensive(search for new solutions in EPICS
    community)

19
What is an IOC?
IOC means Input Output Controller
  • A special CA Server and CA Client (IOCs can
    talk to each other)
  • A computer running the IOC Core program (at
    least once)
  • This computer may be
  • VME based, operating system vxWorks (only
    possibility for old EPICS Versions up to 3.14),
    Linux, RTEMS
  • PC, operating system Windows, Linux, RTEMS
  • Apple, operating system OSX
  • UNIX Workstation, operating system Solaris
  • An IOC normally is connected to input and/or
    output hardware (otherwise called softIOC)
  • An IOC runs a record database, which defines what
    this IOC is doing

20
Some CA Clients
  • (from the EPICS Website - incomplete)
  • ALH Alarm Handler
  • BURT Backup and Restore Tool
  • CASR Host-based Save/Restore
  • CAU Channel Access Utility
  • Channel Archiver (SNS)
  • Channel Watcher (SLAC)
  • EDM Extensible Display Manager (ORNL)
  • JoiMint Java Operator Interface and Management
    INtegration Toolkit (DESY)
  • Knobs Knob Manager und KnobConfig, eine
    Schnittstelle zu SunDials
  • MEDM Motif Editor und Display Manager
  • StripTool Strip-chart Plotting Tool
  • Command line tools (caget, caput, )
  • and many more

21
Client Program Command Line Tools
  • Read a PV named ltNAMEgt
  • caget NAME
  • Write a PV named ltNAMEgt
  • caput NAME value
  • Get information about that Record
  • cainfo NAME
  • Start a monitor
  • camonitor NAME
  • (Cancel with Ctrl c)

gtcaget ARIDI-PCTCURRENT ARIDI-PCTCURRENT
350.56 gt
gtcaput ARIDI-PCTCURRENT 401.5 Old
ARIDI-PCTCURRENT 350.56 New ARIDI-PCTCURRENT
401.5 gt
gtcainfo ARIDI-PCTCURRENT ARIDI-PCTCURRENT
State connected Host
sls-cagw-1 Access read, no write Data
type DBR_DOUBLE Element count 1 gt
gtcamonitor ARIDI-PCTCURRENT ARIDI-PCTCURRENT
250.542 ARIDI-PCTCURRENT 250.537 ARIDI-PCTCURREN
T 250.533 ARIDI-PCTCURRENT 250.525 gt
22
Some CA Clients
  • (from the EPICS Website - incomplete)
  • ALH Alarm Handler
  • BURT Backup and Restore Tool
  • CASR Host-based Save/Restore
  • CAU Channel Access Utility
  • Channel Archiver (SNS)
  • Channel Watcher (SLAC)
  • EDM Extensible Display Manager (ORNL)
  • JoiMint Java Operator Interface and Management
    INtegration Toolkit (DESY)
  • Knobs Knob Manager und KnobConfig, eine
    Schnittstelle zu SunDials
  • MEDM Motif Editor und Display Manager
  • StripTool Strip-chart Plotting Tool
  • Command line tools (caget, caput, )
  • and many more

23
Example ALH
24
Alarms and Colours
NO_ALARM Green Everything ok
MINOR Yellow Warning
MAJOR Red Error(no Controls Problem)
INVALID White Device not reachable
Not connected White block or Pink Record not known
25
Example ALH
Tree structure of Records
Panel with more Information
Guidance
Usefull for users who know the environment (for
example operators in the main control room)
26
Some CA Clients
  • (from the EPICS Website - incomplete)
  • ALH Alarm Handler
  • BURT Backup and Restore Tool
  • CASR Host-based Save/Restore
  • CAU Channel Access Utility
  • Channel Archiver (SNS)
  • Channel Watcher (SLAC)
  • EDM Extensible Display Manager (ORNL)
  • JoiMint Java Operator Interface and Management
    INtegration Toolkit (DESY)
  • Knobs Knob Manager und KnobConfig, eine
    Schnittstelle zu SunDials
  • MEDM Motif Editor und Display Manager
  • StripTool Strip-chart Plotting Tool
  • Command line tools (caget, caput, )
  • and many more

27
Examples StripTool
28
Some CA Clients
  • (from the EPICS Website - incomplete)
  • ALH Alarm Handler
  • BURT Backup and Restore Tool
  • CASR Host-based Save/Restore
  • CAU Channel Access Utility
  • Channel Archiver (SNS)
  • Channel Watcher (SLAC)
  • EDM Extensible Display Manager (ORNL)
  • JoiMint Java Operator Interface and Management
    INtegration Toolkit (DESY)
  • Knobs Knob Manager und KnobConfig, eine
    Schnittstelle zu SunDials
  • MEDM Motif Editor und Display Manager
  • StripTool Strip-chart Plotting Tool
  • Command line tools (caget, caput, )
  • and many more

caQtDM Display Manager
29
Examples for caQtDM
30
Contents
  • What is EPICS
  • The Parts of EPICS
  • What are Records
  • An Example for a Record
  • How to Solve Problems with EPICS

31
Close Look at a Measured Value
295,5
Value with a data type
with a unit mA
with a time stamp 17.2.2005 142116
with a severity (alarm state) NO_ALARM
with technical limits 0 to
400
with graphical limits 0 to 370
with a description Beam current in SR
A measured value is an object with multiple
related information that have different data types
32
What are Records?
  • A Record is an object with
  • a unique name
  • properties (fields) that contain information
    (data) different data types can appear in
    different fields
  • the ability to perform actions on that data

unique name
XYZ1234 Employee James Bond Badge Number
007 Address Whitehall, London Salary
70070.07
fields
data
33
Make a Record from a Measured Value
with a unique name ARIDI-PCTCURRENT
record (ai, "ARIDI-PCTCURRENT")
Configured by

developer
295,5
ai
A value with a data type
field (EGU, "mA")
field (EGUF, "400") field (EGUL, "0")
with a unit mA
with a time stamp
17.2.2005 142116
field (HOPR, "370") field (LOPR, "0")
NO_ALARM
with a severity (alarm status)
field (DESC, "Beam current in SR")
with technical limits 0 to 400
field (DTYP, "HY8401") field (INP, "C3 S0 _at_")
with graphical limits 0 to 370

with a description Beam current in SR
VAL SEVR TIME
34
A Process Variable Name
  • A PV name is comprised of two parts
  • The record name, and
  • the name of a field belonging to that record
  • For example

that meansmost record fieldscan be
accessedindividually
ARIDI-PCTCURRENT
EGU
.
A Process variable name
A record name
A dot to join them
A field name
  • Note that if no field name is given, Channel
    Access will default to using the .VAL field
    ARIDI-PCTCURRENT is interpreted as
    ARIDI-PCTCURRENT.VAL

35
View of a Record
record(ao,"DemandTemp") field(DESC,"Temperat
ure") field(ASG,"") field(SCAN,"Passive")
field(PINI,"NO") field(PHAS,"0")
field(EVNT,"0") field(DTYP,"VMIC 4100")
field(DISV,"1") field(SDIS,"")
field(DISS,"NO_ALARM") field(PRIO,"LOW")
field(FLNK,"") field(OUT,"C0 S0")
field(OROC,"0.0e00") field(DOL,"")
field(OMSL,"supervisory") field(OIF,"Full")
field(PREC,"1") field(LINR,"NO
CONVERSION") field(EGUF,"100")
field(EGUL,"0") field(EGU,"Celcius")
field(DRVH,"100") field(DRVL,"0")
field(HOPR,"80") field(LOPR,"10")
field(HIHI,"0.0e00") field(LOLO,"0.0e00")
field(HIGH,"0.0e00") field(LOW,"0.0e00")
field(HHSV,"NO_ALARM") field(LLSV,"NO_ALARM
") field(HSV,"NO_ALARM")
field(LSV,"NO_ALARM") field(HYST,"0.0e00")
field(ADEL,"0.0e00") field(MDEL,"0.0e00")
field(SIOL,"") field(SIML,"")
field(SIMS,"NO_ALARM") field(IVOA,"Continue
normally") field(IVOV,"0.0e00")
All record fields have default values (in case
they are notspecified by thedeveloper)
36
What do Records do?
  • Depends on
  • Record Type
  • Field values
  • 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)
  • record do nothing until they are processed
  • Analog in
  • Analog out
  • Binary in
  • Binary out
  • Calculation
  • Calculation out
  • Compression
  • Data fanout
  • Event
  • Fanout
  • Histogram
  • Motor
  • Multi bit binary input
  • Multi bit binary output
  • PID control
  • Pulse counter
  • Pulse delay
  • Scan
  • Select

incomplete list!
37
Record Processing
Record Processing means Trigger Record to do
what itis configured to do.
  • Record processing can be periodic or event
    driven
  • Periodic Standard scan rates are
  • 10, 5, 2, 1, 0.5, 0.2 and 0.1 seconds
  • Custom scan rates can be configured up to speeds
    allowed by operating system and hardware
  • No precise timing!
  • Event driven Events include
  • Hardware interrupts
  • Request from another record via links
  • EPICS Events
  • Channel Access Puts

38
The Record Reference Manual
  • Explains records from the EPICS base release
  • Explains database concepts, record types, and
    record fields
  • New Version as Wikihttp//www.aps.anl.gov/epics/
    wiki/index.php/RRM_3-14
  • Old Version (R3.13) pdf http//www.aps.anl.gov/
    epics/EpicsDocumentation/AppDevManuals/RecordRef/R
    ecordref.pdf
  • More Records exist.For example Motor Record
    (part of synApps package)

Test What does the field HSV of an ai Record?
39
Contents
  • What is EPICS
  • The Parts of EPICS
  • What are Records
  • An Example for a Record
  • How to Solve Problems with EPICS

40
Example Record
IOC
Database
Analog to Digital Converter
Process
Temperature Sensor
record (ai, MTRT1-TEMPREAD) field (EGU,
deg C) field (EGUL, 0) field (EGUF, 100)
field (HSV, MAJOR) field (HIGH, 51)
field (SCAN, .1 second) field (DTYP,
Hy8401) field (INP, C3 S0 _at_)
Normal Operation 5 - 50C
0 100C 0 10V
8 bit ADC 0 10V 0 255 bits
41
Example Record
CA Client caQtDM
caQtDM sets a CA monitor
IOC
Record Support
record (ai, MTRT1-TEMPREAD) field
(SCAN, .1 second) field (DTYP, Hy8401)
field (INP, C3 S0 _at_) field (VAL, 34)
Device Support
every 0.1 seconds the recordasks the driver for
a value
Driver
and the driver reports back
Value (34 C)
42
Get a Values from a Record
  • Switch on VME (on every VME a Record is created,
    which is connected to the first potentiometer)
  • Type into a terminal
  • caget MTRT1-TEMPREAD
  • (change the 1 to the number of your training
    station)
  • Move the potentiometer
  • Ask for another values

43
CA Commands
  • Read a PV named ltNAMEgt
  • caget NAME
  • Get information about that Record
  • cainfo NAME
  • Start a monitor
  • camon NAME
  • (Cancel with Ctrl c)
  • Without argument all commands show some help

caget MTRT1-TEMPREAD
cainfo MTRT1-TEMPREAD
camon MTRT1-TEMPREAD
caget
44
Create a Graphical User Interface (GUI)
  • To start the Qt Designer(editor to create new
    GUI)caqtdm_designer
  • To start an existing GUI (configuration file
    already exist)caqtdm ltnamegt.ui

45
Create a caQtDM window (1/4)
select Main Window
create
46
Create a caQtDM window (2/4)
47
Create a caQtDM window (3/4)
MTRT1-TEMPREAD
48
Create a caQtDM window(4/4)
Temperature.ui
49
Create a Graphical User Interface (GUI)
  • To start the Qt Designer(editor to create new
    GUI)caqtdm_designer
  • To start an existing GUI (configuration file
    already exist)caqtdm ltnamegt.ui

50
Running a caQtDM Window
51
Files for the Temperature Example
  • Change into local directory cd G/TRAINING/T1
  • Open the files in an editor G_TRAINING_T1_TEMPER
    ATUR.template
  • MTEST-VME-T1_example.subs
  • For example use nedit (click on file -gt
    open)

52
Inside the Files
substitution file
template file
53
Why Substitution and Template Files?
  • What to do if you have more than one instance of
    a device?
  • Multiply the record and change the name works ok
  • If you have 20 devices the file gets lengthy
  • If the device not only needs one record but
    more(BPM with at least x, y, and intensity)the
    file gets even more lengthy and confusing spell
    maintenance nightmare
  • Solution provided by EPICSsubstitution (with
    macro definition) and template files

54
Inside the Files
DEVICE MTRT1 (DEVICE)-TEMPREAD MTRT1-TEMPREA
D
55
Exercise a Second Record
  • Imagine we have a second temperature sensor we
    need a second record
  • Edit the substitution file (MTEST-VME-T1_example.s
    ubs)

56
How to get the Record to the VME
New records can only be created during restart
of an IOC (for VME this means reboot)
get filesduring reboot
install files
Linux PC
Central Server
Trainings VME
57
Installing an EPICS Database
  • Everything written correctly?
  • Install to the boot directory of the IOC
  • swit V -ioc IOC-NAME
  • (enter command in the local directory which
    contains the files to be installed)
  • Reboot IOCLog into the IOC using
  • rmc IOC-NAME
  • and type in (soft reboot)
  • reboot

swit -V -ioc MTEST-VME-T1
rmc MTEST-VME-T1
MTEST-VME-T1gt reboot
58
What Happens at Booting
  • Boot Info (memory) VME-IOC where to find the
    startup.script
  • Load startup.script
  • In startup.script list of .subs files
  • Load .subs files
  • In .subs files List of .template files
  • Load .template files with substitutions
  • Create all loaded records

59
Commands on the VME Computer
  • Get a list of all installed records (on this IOC)
  • dbl
  • Get the number of installed records
  • dbnr
  • View interesting fields of a record
  • dbpr "MTRT1-TEMPREAD",1
  • To get a list of VxWorks commands
  • help

60
SLS Naming Convention
  • Records need unique names
  • XBeamline, AMachine, MTest (1 character)
  • Project abbreviation (4 characters), e.g. 06SA,
    TEST, RIRing, DIDIAGNOSE
  • Optional Device, Group, Component, e.g. OP, ID
  • Device, e.g. MO
  • Optional Function (max. 11 characters),
  • z.B. TRY1-SET

12 3 4 5
Length of 3length of 4 12 characters older
EPICS Names have 27 characters at maximum
61
Name for the Temperature Sensors
  • M Test
  • TR Training
  • T1, T2, T3, T4 Training IOCs
  • TEMP Temperature
  • READ Record for reading
  • For a second sensor
  • TEMP1 for the first, TEMP2 for the second
  • MTRT1-TEMP1READ und MTRT1-TEMP2READ

62
Exercise caQtDM Application
  • Create an caQtDM GUI, which shows
  • Your own Records
  • All Records of the course
  • The alarm states of all records
  • More to do Create a second GUI, which displays
    all records with names starting like MTEST-VME-T
    running on your IOC.

63
IOC Status
  • On every IOC there are some Status Records
    created automatically

caqtdm -macro IOCMTEST-VME-T1 /work/sls/config/qt
/G_IOCMON_ioc_status.ui
64
Contents
  • What is EPICS
  • The Parts of EPICS
  • What are Records
  • An Example for a Record
  • How to Solve Problems with EPICS

65
Solve a Problem in EPICS
IOC
ADC
Database
Analog In
MTTR1-LI-COOLTEMP1
BinaryI/O
VAL
INP
Problem In the LINAC we have a water chiller
that must be turned ON whenever the average
temperature of two temperature sensors rises
above a set point. The set point is nominally 10
degrees centigrade.
Calculation
Binary out
EGU deg C
MTRT1-LI-COOLCALC
MTRT1-LI-COOLSW
INPA
INPB
VAL
DOL
OUT
ADC
C 10
Chiller
Analog In
CALC ( (AB)/2 ) gt C
MTRT1-LI-COOLTEMP2
SCAN 10 second
INP
VAL
EGU deg C
66
The subs File
  • Name of the file MTEST-VME-T1_example.subs

means this line is a comment
67
Different Styles of subs files
few instances
many instances
Files are written for programmers not for
computers!
68
The Template File
  • Predefined records in the file G_TRAINING_T1_COOL
    ER.template

69
Useful Scripts
  • Is everything spelled correctly?
  • externalLinks subs-File
  • What was the name of this record?
  • findrecord Name-Part
  • When was this IOC booted last time?
  • bootinfo IOC-Name

externalLinks MTEST-VME-T1_example.subs
findrecord MTRT1-LI
bootinfo MTEST-VME-T1
70
Steps of Development
  1. Change your files
  2. Save your files
  3. Check syntax with externalLinks
  4. Install IOC files
  5. Reboot IOC(in rmc window reboot)
  6. Test

externalLinks MTEST-VME-T1_example.subs
swit -V -ioc MTEST-VME-T1
71
10 Really Neat Things About EPICS
  1. It is free
  2. It is Open Source
  3. There are lots of users
  4. All a client needs to know to access data is a
    PV name
  5. You can pick the best tools out there
  6. or build your own
  7. The boring stuff is already done
  8. There is a lot of expertise available close by
  9. A good contribution becomes internationally
    known
  10. It does not matter, if you need 10 or 10
    million PVs
  11. It is fun (dont tell the management)

72
EPICS Web Page
  • The central site for EPICS information
  • - Documentation
  • - CA Clients
  • - Device support (driver)
  • - Tech-talk (mailing list and archive)
  • http//www.aps.anl.gov/epics
Write a Comment
User Comments (0)
About PowerShow.com