290 likes | 592 Views
EPICS Training @ PSI. Acknowledgment. Some slides in this talk came form the
E N D
1. EPICS Training @ PSI Controls Section PSI
2007
2. EPICS Training @ PSI
3. EPICS Training @ PSI Contents What is EPICS
The Parts of EPICS
What are Records
An Example for a Record
How to Solve Problems with EPICS
4. EPICS Training @ PSI What are we doing? We need to control an accelerator (SLS) with many components remotely (due to radiation and size of the machine). How can we do this?
Our answer is EPICS
5. EPICS Training @ PSI What is EPICS? EPICS is:
A collaboration
A tool kit
A control system architecture
6. EPICS Training @ PSI The History In1989 started a collaboration between Los Alamos National Laboratory (GTA) and Argonne National Laboratory (APS)
(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
Collaborative efforts vary
Assistance in finding bugs
Share tools, schemes, and advice
7. EPICS Training @ PSI 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) in Villigen, Schweiz
KEK in Tsukuba, Japan
DIAMOND Light Source (Rutherford Appleton Laboratory) in Oxfordshire, England
The Australian Synchrotron (AusSy) in Melbourne, Australien
8. EPICS Training @ PSI Are there alternatives to EPICS? Tango/Taco
Developed at ESRF
Used by ESRF, Elettra, Soleil
DOOCS
Developed and used by DESY
Tine
Developed and used by DESY
ACS
Developed and used at PSI
9. EPICS Training @ PSI Network based Client/Server Model (hence the EPICS logo) The architecture of EPICS
10. EPICS Training @ PSI What is Channel Access A protocol how to transfer data
A single data unit is called Process Variable
A Process Variable has a unique name, which is used to refer to the data
The detailed operation of Channel Access is unimportant for most programmers (it already works…)
Channel Access is not dependent on a single programming language
11. EPICS Training @ PSI Channel Access network flow
12. EPICS Training @ PSI Control System Architecture A network based “Client/Server” Model, whose smalest data set is a Process Variable
The Channel Access Protocol defines, what data (Process Variable) is transferred between server and client
The entire set of Process Variables establish a Distributed Real-time Database of machine status, information and control parameters
13. EPICS Training @ PSI 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
14. EPICS Training @ PSI Contents What is EPICS
The Parts of EPICS
What are Records
An Example for a Record
How to Solve Problems with EPICS
15. EPICS Training @ PSI Parts of EPICS
16. EPICS Training @ PSI Typical Realisation
17. EPICS Training @ PSI 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 is VxWorks from Wind River company
Very expensive – search for new solutions in EPICS community
18. EPICS Training @ PSI What is an IOC A special CA Server and CA Client
A computer running “IOC Core”
This computer may be:
VME based, operating system vxWorks (only possibility up to 3.14) or 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
An EPICS control system is based on at least one Channel Access Server (normally an IOC)
An IOC runs a record database, which defines what this IOC is doing
19. EPICS Training @ PSI Inside an IOC
20. EPICS Training @ PSI For what to use a Sequencer?
21. EPICS Training @ PSI 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
and many more …
22. EPICS Training @ PSI Example: ALH
23. EPICS Training @ PSI
24. EPICS Training @ PSI Example: ALH
25. EPICS Training @ PSI 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
and many more …
26. EPICS Training @ PSI Examples: StripTool
27. EPICS Training @ PSI 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
and many more …
28. EPICS Training @ PSI Examples: medm
29. EPICS Training @ PSI Channel Access Commands
30. EPICS Training @ PSI How does it do it? Let’s take an example:
Suppose you had a particle accelerator to control. Among many other things, Let’s take an example:
Suppose you had a particle accelerator to control. Among many other things,
31. EPICS Training @ PSI Contents What is EPICS
The Parts of EPICS
What are Records
An Example for a Record
How to Solve Problems with EPICS
32. EPICS Training @ PSI Close look at a Measured Value
33. EPICS Training @ PSI What are Records? A Record is an object with
a unique name
properties (fields) that contain information (data)
the ability to perform actions on that data
34. EPICS Training @ PSI From Measured Value to Record
35. EPICS Training @ PSI 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…
36. EPICS Training @ PSI What do 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 wide range of records have already been created
New record types can be added to a new application as needed
A record does nothing until it is processed
37. EPICS Training @ PSI Some Record Types 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
Sequence
String in
String out
Subarray
Subroutine
Waveform
38. EPICS Training @ PSI IOC view of a Record
39. EPICS Training @ PSI The Record Reference Manual In English (American style)
Explains database concepts and record types
All fields are explained for common record types
Test: What does the field HSV of an ai Record
Common fields for all records are described in the first part
The explained records are part of the EPICS base release
More Records exist. Find their documentation in the internet
40. EPICS Training @ PSI Contents What is EPICS
The Parts of EPICS
What are Records
An Example for a Record
How to Solve Problems with EPICS
41. EPICS Training @ PSI Our First Database
42. EPICS Training @ PSI Switch on VME (on every VME a Record is created, which is connected to the first potentiometer)
Type into a terminal:
caget MTRT1-TEMP:READ
(change the 1 for the number of your training station)
Move the potentiometer
Ask for another values Get values from a Record
43. EPICS Training @ PSI CA Commands Read a PV named <NAME>
caget NAME
Get information about that Record
cainfo NAME
Start a monitor
camon NAME
(Cancel with [Ctrl] + [c])
Try to remember at least
ca
44. EPICS Training @ PSI Create a Graphical User Interface (GUI) Open the editor with the command
medm
Click to menu File and New
Click with right mouse button in the new window and choose in Object > Monitors a "Text Monitor" (select the size of the window with the mouse)
Type to "Readback Channel" the record name (MTRT1-TEMP:READ)
Switch to "Execute"
45. EPICS Training @ PSI Say it with Pictures
46. EPICS Training @ PSI Files for the Temperature Example The local files are in the directory G/TRAINING/T1
The template file is named G_TRAINING_T1_TEMPERATUR.template
The substitution file is named
MTEST-VME-T1_example.subs
The created record is
MTRT1-TEMP:READ
(rsp. MTRT2-TEMP-READ, MTRT3-TEMP:READ and
MTRT4-TEMP:READ)
47. EPICS Training @ PSI Inside the Files
48. EPICS Training @ PSI Exercise: a Second Record Imagine we have a second temperature sensor – we need a second record:
49. EPICS Training @ PSI Installing an EPICS database Everything written correctly?
Install to the boot directory of the IOC
slsinstall –V -ioc IOC-NAME
(enter command in the local directory which contains the files to be installed)
Reboot IOC (press button = hard reboot) or
Log into the IOC using
rmc IOC-NAME
and type in (soft reboot)
reboot
50. EPICS Training @ PSI 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
51. EPICS Training @ PSI Commands on the VME Computer Get a list of all installed records (on this IOC)
dbl
View interesting fields of a record
dbpr "Record-Name"
dbpr "MTRT1-TEMP:READ"
To get a list of VxWorks commands
help
52. EPICS Training @ PSI SLS Naming Convention Records need unique names
X=Beamline, A=Machine, M=Test (1 character)
Project abbreviation (4 characters), e.g. 06SA, TEST, RI=Ring, DI=DIAGNOSE
Optional: Device, Group, Component, e.g. OP, ID
Device, e.g. MO
Optional: Function (max. 11 characters),
z.B. TRY1-SET
53. EPICS Training @ PSI Name of the Temperature Sensors (at SLS) 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-TEMP1:READ und MTRT1-TEMP2:READ
54. EPICS Training @ PSI Exercise: medm Application Create an medm 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.
55. EPICS Training @ PSI IOC Status On every IOC there are some Status Records created automatically:
56. EPICS Training @ PSI Contents What is EPICS
The Parts of EPICS
What are Records
An Example for a Record
How to Solve Problems with EPICS
57. EPICS Training @ PSI Solve a Problem in EPICS
58. EPICS Training @ PSI
59. EPICS Training @ PSI The Template File Predefined records in the file G_TRAINING_T1_COOLER.template
Would the IOC boot with this file?
Please copy Record Fields from the notes
…
60. EPICS Training @ PSI 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
Some more information from the database:
http://pc4860/testplan/hosts_iocs_list_pub.php
61. EPICS Training @ PSI Record Processing 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
Event driven: Events include
Hardware interrupts
Request from another record via links
EPICS Events
Channel Access Puts
62. EPICS Training @ PSI Develop medm GUIs What should be displayed:
Both temperature sensors
The alarm states of the sensors
The switch state of the chiller should be given as text and with an “LED”, which is lighted yellow when the device is switched on
A title text (never do a GUI without)
A plot of the temperatures
63. EPICS Training @ PSI More Exercises Display the average temperature
The temperature limit of 10 deg C should be accessible in medm using a new record
There should be another temperature limit: a heater should be switched on if the temperature drops below a lower limit
Another calc record
Another bo record
"#C2 S33 @"
In the accelerator there are as well some chillers and heaters needed. Duplicate your settings.
64. EPICS Training @ PSI 10 really neat Things about EPICS It is free
It is Open Source
There are lots of users
All a client needs to know to access data is a PV name
You can pick the best tools out there …
… or build your own
The boring stuff is already done
There is a lot of expertise available close by
A good contribution becomes internationally known
It does not matter, if you need 10 or 10 million PVs
65. EPICS Training @ PSI 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