Interfacing Interfacing EPICS and MonALISAEPICS and MonALISA
Peter Zumbruch
Experiment control systems group GSI
(KS/EE)
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 22
OverviewOverview
• What is EPICS?
• What is MonALISA
• Interfacing EPICS and MonALISA
• Summary
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 33
For EPICS, client and server speak of their Channel Access rolei.e. Channel Access Client & Channel Access Server
ClientClient
Server Server
CACA
CA CA
A Control System ArchitectureNetwork-based “client/server” model (hence the EPICS logo)
What is EPICS? What is EPICS? ((Getting Started with EPICS: Introductory Session IGetting Started with EPICS: Introductory Session I))
Network
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 44
What is EPICS?What is EPICS?
… short answer: EPICS: Experimental Physics and Industrial Control System
… a bit more elaborate: EPICS is a set of Open Source software tools, libraries and applications developed collaboratively and used worldwide to create distributed soft real-time control systems for scientific instruments such as particle accelerators, telescopes and other large scientific experiments. (From the EPICS Home Page : http://www.aps.anl.gov/epics/)
… striking - is three things at once: • A collaboration of major scientific laboratories and industry ( > 100)
• A world wide collaboration that shares designs, software tools and expertise for implementing large-scale control systems
• An architecture for building scalable control systems• A client/server model with an efficient communication protocol (Channel Access)
for passing data• The entire set of Process Variables establish a Distributed Real-time Database of
machine status, information and control parameters• A Software Toolkit of Open Source code and documentation
• A collection of software tools collaboratively developed which can be integrated to provide a comprehensive and scalable control system
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 55
Ten really neat things about EPICSTen really neat things about EPICS
(Getting Started with EPICS: Introductory Session I)(Getting Started with EPICS: Introductory Session I)
• It’s free
• It’s 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
• By following a few simple rules, you get a lot for free
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 66
EPICS and FAIREPICS and FAIR / GSI/ GSI
Experiments showing interest or more in usage of EPICS
• NuSTAR
• CBM (Embedded controls)
• FRS (HV controls
• HADES – running complete experiment control system
• PANDA
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 77
MonALISAMonALISA
Is a distributed service able to:• collect any type of information from different
systems• analyze this information in real time• take automated decisions and perform actions
based on it• optimize work flows in complex environments
Read more at
http://monalisa.caltech.edu
from: Online Monitoring with MonALISA – D.Protopopescu – Dubna 2007
“MONitoring Agents using a Large Integrated Services Architecture“
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 88
UsesUses
Monitoring distributed computing, i.e. GRIDs Optimizing flow in complex system (VRVS, optics cable networks) ALICE also uses ML for monitoring online reconstruction Some benchmark figures for the service: ~ 800k monitored parameters at 50k updates/second > 10k running (alien) jobs monitored simultaneously > 100 WAN links
from: Online Monitoring with MonALISA – D.Protopopescu – Dubna 2007
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 99
AdvantagesAdvantages
• MonALISA is simple to install, configure and use
• ApMon APIs are available in C, C++, Java, Python and Perl
• ROOT plugin allows macros to send data directly to MonaLISA
• Can easily interface with (or sit on top of) any existing or future slow controls subsystem (epics, pvss)
• Data is stored in a standard PgSQL (or MySQL) database that can be accessed by other applications, independently of ML
• Automatic data summarizing
• Several data repositories (and hence DBs) can exist (local and remote)
• Easy access via WebService (WS) from service and/or repository
• Fully supported by development team; work is being done in this direction
from: Online Monitoring with MonALISA – D.Protopopescu – Dubna 2007
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 1010
CapabilitiesCapabilities
Based on monitored information, actions can be taken in: ML Service ML Repository
Actions can be triggered by: Values above/below given thresholds Absence/presence of values Correlations between several values
Possible actions types: External command Plain event logging Annotation of repository charts; RSS feeds Email Instant messaging
from: Online Monitoring with MonALISA – D.Protopopescu – Dubna 2007
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 1111
InterfacingInterfacing
First approach:– Perl Script
• Using ApMon module of MonALISA
• Calling caget / camonitor / caput commands of EPICS
• Later, with help of POE module (process on event) change on event could be implemented
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 1212
http:mlr1.gla.ac.uk:7002/epics/edit.jsp
lxi003: MLD start
lxdv18: EPICS IOC
SetupSetup
Service
Proxies
Repository
CERN
GSI
GLASGOW
GSI
Channel Accessevent_pub.pl using caget/camonitor/caput
ApMon
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 1313
Screen shots (1)Screen shots (1)
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 1414
Screen shots (2)Screen shots (2)
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 1515
In future …In future …
Next approach:– Implement MonALISA‘s API.c/c++
• Create EPICS Device Support Module for MonALISA
• Maybe simpler “sub routine record“ approach
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 1616
SummarySummary
• Thanks to – Dan– Costin– Catalin– Kevin
at the 1st DCS Roundtable in Glasgow
• EPICS Process Variables can be read and manipulated by MonALISA
• The reverse mechanism is not foreseen
• Performance test not yet done.
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 1717
Thank you for your attention.
For more information …
Have a look at the extra slides.
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 1818
Extra slidesExtra slides
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 1919
VocabularyVocabulary (Getting Started with EPICS: Introductory Session I)(Getting Started with EPICS: Introductory Session I)
• EPICS– Experimental Physics and Industrial Control System
• Channel Access– The communication protocol used by EPICS
• Process Variable– A piece of named data referred to by its PV name
– The primary object of the Channel Access Protocol
• Channel– A synonym for Process Variable
• Channel Access Server– Software that provides access to a Process Variable using the Channel
Access Protocol
• Channel Access Client– Software that requests access to a Process Variable using the Channel
Access Protocol
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 2020
VocabularyVocabulary (Getting Started with EPICS: Introductory Session I)(Getting Started with EPICS: Introductory Session I)
• IOC – Input Output Controller– A computer running iocCore, a set of EPICS routines used to define
process variables and implement real-time control algorithms– iocCore uses database records to define process variables and their
behavior
• Soft IOC– An instance of iocCore running as a process on a “non-dedicated”
computer (i.e. a computer that is performing other functions as well)
• Record– The mechanism by which a Process Variable is defined in an IOC
(using iocCore)
– Dozens of record types exist, each with it’s own attributes and processing routine that describe its functionality
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 2121
What is EPICS?What is EPICS?
• Process Variable
– A Process Variable is a named piece of data with a set of attributes
– Examples of Attributes:
• Alarm Severity (e.g. NO_ALARM, MINOR, MAJOR, INVALID)
• Alarm Status (e.g. LOW, HI, LOLO, HIHI, READ_error)
• Timestamp
• Number of elements (array)
• Normal Operating Range
• Control Limits
• Engineering Unit Designation (e.g. degrees, mm, MW)
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 2222
How does it do it?How does it do it? (Getting Started with EPICS: Introductory Session I)(Getting Started with EPICS: Introductory Session I)
Power Supply
Beam Position Monitor
Vacuum Gauge
Computer Interface
Computer Interface
Computer Interface
Process Variables:
Channel Access Server
S1A:H1:CurrentAO
S1:P1:x
S1:P1:y
S1:G1:vacuum
Channel Access Client
Channel Access Client
Channel Access ClientChannel Access Client
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 2323
Where does it do it?Where does it do it? (Getting Started with EPICS: Introductory Session I)(Getting Started with EPICS: Introductory Session I)
Power Supply
Beam Position Monitor
Vacuum Gauge
Computer Interface
Computer Interface
Computer Interface
Process Variables:
Channel Access Server
S1A:H1:CurrentAO
S1:P1:x
S1:P1:y
S1:G1:vacuum
iocC
ore
Channel Access Client
Channel Access Client
Channel Access ClientChannel Access Client
Remote
Contro
l &
Monito
ring
Acces
s Sec
urity
Alarm
Det
ectio
n
Data
Trendin
g/Arc
hivin
g
Autom
atic
Sequen
cing
Alarm
Logging/R
eporti
ng
Data
Convers
ion/F
ilter
ing
Close
d-loop
Control
Close
d-loop
Control
Operat
ional
Constra
ints
Operat
ional
Constra
ints
Data
Trendin
g/Arc
hivin
g
Model
ing/
Simula
tion/A
nalys
is
Autom
atic
Sequen
cing
Configura
tion
Control
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 2424
Channel Access in One SlideChannel Access in One Slide (Getting Started with EPICS: Introductory Session I)(Getting Started with EPICS: Introductory Session I)
CA Server
CA Client
Process Variables:
Channel Access Server
S1A:H1:CurrentAO
S1:P1:x
S1:P1:y
S1:G1:vacuum
Channel Access Client
Who has a PV named “S1A:H1:CurrentAO”?
I do.
What is its value?
25.5 AMPS
Change its value to 30.5
“connection request” or “search request”
OK, it is now
30.5
30.5 is too high. It is now set to the maximum value of 27.5.
You are not authorized to
change this value
Notify me when the
value changes
It is now 20.5 AMPS
It is now 10.5 AMPS
It is now -0.0023 AMPS
“put” or
“caPut”
“get” or
“caGet”
“set a monitor”
“post an event”
or
“post a monitor”
“put complete”
or
or
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 2525
What is EPICS? What is EPICS? (Getting Started with EPICS: Introductory Session I)(Getting Started with EPICS: Introductory Session I)
Channel Access clients are programs that require access to Process Variables to carry out their purpose
The “service” that a Channel Access server provides is access to a Process Variable*
StripTool MEDM
Process
Variables
Process
Variables
CAS CAS
CACCAC
* A Process Variable (PV) is a named piece of data.
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 2626
What is EPICS? What is EPICS? (Getting Started with EPICS: Introductory Session I)(Getting Started with EPICS: Introductory Session I)
Any tool/program/application that abides by the Channel Access protocol could be described as “EPICS Compliant”.
My Accelerator Simulator
Code(PVs)
CAS
My Special Data
Collection Program
CAC
EPICS can be viewed as a “toolkit” of EPICS compliant programs. One can select the appropriate tool for their need or develop their own.
StripTool MEDM
CACCAC
iocCore(PVs)
LabView(PVs)
CAS CAC CAS CAC
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 2727
Displays and ControlsDisplays and Controls
(1-3) Examples from HADES
1
23
4
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 2828
RT
EM
S
Typical Realizations of an EPICS SystemTypical Realizations of an EPICS System (Getting Started with EPICS: Introductory Session I)(Getting Started with EPICS: Introductory Session I)
IOCIOC
IOC
IOCCAS
CAS
With Release 3.14, the operating system limitations for iocCore have been removed.
Commercial Instruments
Custom Chassis/Panels
Technical Equipment
March 3, 2008March 3, 2008 Interfacing EPICS and MonALISA - Peter Zumbruch, GSIInterfacing EPICS and MonALISA - Peter Zumbruch, GSI 2929
So What Does it Do?So What Does it Do?
• EPICS tools are available to accomplish almost any typical Distributed Control System (DCS) functionality, such as:– Remote Control & Monitoring of Technical Equipment– Data Conversion/Filtering– Access Security– Equipment Operation Constraints– Alarm Detection/Reporting/Logging – Data Trending/Archiving/Retrieval/Plotting– Automatic Sequencing – Mode & Facility Configuration Control (save/restore)– Modeling/Simulation– Data Acquisition– Data Analysis