Скачать презентацию Experimental Physics and Industrial Control System EPICS An Скачать презентацию Experimental Physics and Industrial Control System EPICS An

2c2790fbfd4290130519c29dc481e1f4.ppt

  • Количество слайдов: 57

Experimental Physics and Industrial Control System EPICS An Introduction 1 Experimental Physics and Industrial Control System EPICS An Introduction 1

What is EPICS? n n n A distributed open architecture that supports a wide What is EPICS? n n n A distributed open architecture that supports a wide range of control system solutions from small test stands to very large integrated facilities. It is ideally suited to the ‘slow’ controls ( ~50 ms+) for large, distributed, heterogeneous control systems that require high reliability and resilience and also need to be maintained and enhanced during long operational lifetimes (20 years+). The EPICS collaboration consists of the controls groups of many research organizations that use and develop the EPICS tool-kit. 2

What is EPICS? n n EPICS is open-source software and its distribution, development and What is EPICS? n n EPICS is open-source software and its distribution, development and support depends on ‘voluntary’ effort or finance from collaboration members. EPICS provides a set of tools that reduces software application and maintenance costs by providing: Ø Configuration tools in place of programming Ø A large installed base of tested software Ø A modular design that supports incremental upgrades Ø Well defined interfaces for extensions at every level 3

Origins of EPICS n n n Los Alamos National Laboratory 1987 -1989, software for Origins of EPICS n n n Los Alamos National Laboratory 1987 -1989, software for GTACS (Ground Test Accelerator Control System) required fully automated, distributed control (Bob Dalesio, Jeff Hill et al). Argonne National Lab became involved from 1988 onwards and formed a collaboration for co-development of the control system for the new Advanced Photon Source (APS). Both labs began to develop the GTACS ideas together. By 1991 the LANL/APS collaboration renamed the resulting system as EPICS. 4

Origins of EPICS n n n Further labs (LBL and CEBAF) joined the collaboration Origins of EPICS n n n Further labs (LBL and CEBAF) joined the collaboration as well as the large Superconducting Super Collider project (abandoned 1993). Three commercial companies signed licences to adopt and develop EPICS software (then at version 3. 8). Tate Integrated Systems marketed it under the name TIS 4000 and Kinetic Systems as Intuit. EPICS shares some of its origins with Vsystem®, sold by Vista Control Systems Inc, founded by Peter Clout of LANL in 1989. 5

The EPICS Collaboration n n Now over 100 independent projects in North & South The EPICS Collaboration n n Now over 100 independent projects in North & South America, Europe, Asia and Australasia Applications in high-energy physics, fusion energy, particle physics, astronomy and industrial control. Probably strongest in synchrotrons/beamlines Independent development, co-development and incremental development of software is done by collaboration members EPICS software is available for download from many sites: usually the originator of the software maintains the source code repository. Argonne National Laboratory (ANL) maintains EPICS base software & co-ordinates releases 6

The EPICS Collaboration n n Problem reporting and resolution via e-mail exploders (e. g. The EPICS Collaboration n n Problem reporting and resolution via e-mail exploders (e. g. ‘tech-talk’ list) Documentation available from download sites Large collaboration meetings to report new work, discuss and plan future directions, explore new applications, and explore new requirements for existing systems Current consortium meeting pattern: Twice yearly, locations usually alternate North America/Elsewhere. Next: ICALEPCS 2013, San Francisco, Oct. 2013. Smaller groups from multiple labs meet to discuss design issues on significant enhancements e. g. EPICS V 4. 7

EPICS Worldwide 8 EPICS Worldwide 8

Partial View of Collaboration Members Fermilab D 0 Experiment Oak Ridge National Laboratory (SNS) Partial View of Collaboration Members Fermilab D 0 Experiment Oak Ridge National Laboratory (SNS) Diamond Light Source Stanford Linear Accelerator Center Deutches Elektronen. Synchrotron (DESY) Los Alamos National Laboratory KEK (Koh ehnerugii Kencuesho) Lawrence Berkeley National Laboratory Argonne National Laboratory Commissariat a l’Energie Atomique (SACLAY) Berliner Elekronenspeicherring. Gesellschaft fur Synchrontronsrahlung (BESSY) Paul Scherrer Institut - SLS Jefferson Laboratory Gemini Observatory W. M. Keck Observatory Shanghai Synchrotron Radiation Facility Budker Institute of Nuclear Physics RIKEN 9

EPICS is Suitable for a Large Range of Applications PVs I/O Controllers Advanced Photon EPICS is Suitable for a Large Range of Applications PVs I/O Controllers Advanced Photon Source 300 K 170 KEK B CEBAF BESSY II Swiss Light Source 240 K 180 K 150 K 94 98 110 160 D 0 (FNL) 60 K 124 PEP II RF and Longitudinal Control 19 K 21 Low Energy Demonstrator Accelerator 15 K 18 Compass 1 K 1 Keck II 2 K 2 35 K 17 3 K 50 K ~25 K 150 K 2 180+ ~100 ~50 150 Gemini Telescopes Next Linear Collider Test Accelerator Diamond Japanese Hadron Facility PF-AR Spallation Neutron Source 10

EPICS Software Distribution The EPICS software distribution is in two parts: 1. EPICS Base. EPICS Software Distribution The EPICS software distribution is in two parts: 1. EPICS Base. This is the main core of EPICS, comprising the build system and tools, common and OS-interface libraries. It is defined, tested and released centrally (Argonne National Lab) as a single unified package with a specific release number e. g. 3. 14. 12. 3 Hardware specific software is separately distributed, supporting a wide range of devices on different I/O buses. 11

EPICS Software Distribution 2. EPICS Extensions. Is a large and more loosely defined set EPICS Software Distribution 2. EPICS Extensions. Is a large and more loosely defined set of tools (mostly run on the host side) which provide configuration, GUIs, archiving, APIs etc. Each tool is developed and distributed by individual organisations. Depending on local preferences and practice, each EPICS site will have its own set of installed extensions. No centrally organized distribution: there are diverse levels of support and compatibility. 12

EPICS Software Licensing n n n EPICS software is available under different opensource licenses EPICS Software Licensing n n n EPICS software is available under different opensource licenses depending on the originator of the software. In general, it is available free of charge with certain licensing conditions. As of February 2004 EPICS Base software became available under the ‘EPICS Open License’ from Argonne/Los Alamos. It is ‘Open Source’ and may be copied and distributed freely Almost all EPICS Host software (Extensions) is effectively ‘Open Source’ 13

What is EPICS? A Distributed Architecture EPICS CA Client CA Server CA = Channel What is EPICS? A Distributed Architecture EPICS CA Client CA Server CA = Channel Access 14

What is EPICS? A Distributed Architecture n n n EPICS is physically a flat What is EPICS? A Distributed Architecture n n n EPICS is physically a flat architecture of front-end controllers and operator workstations that communicate via TCP/IP and UDP protocols: Ø System scales simply through the addition of new computers (IOCs) Ø Physical hierarchy may be introduced through bridges, routers, or gateways Ø Network bandwidth is the primary limiting factor EPICS software architecture is client/server based - with independent data stores providing read/write access directly between any two points No central name servers: local name discovery allows automatic integration of new components 15

What is EPICS? n Channel Access clients are programs that require access to Process What is EPICS? n Channel Access clients are programs that require access to Process Variables to carry out their purpose Strip. Tool EDM CAC = CAS n The “service” that a Channel Access server provides is access to a Process Variable* CAS Process Variables * A Process Variable (PV) is a named item of data. 16

How does it do it? Channel Access Client Channel Access Server Process Variables: S How does it do it? Channel Access Client Channel Access Server Process Variables: S 1 A: H 1: Current. AO S 1: P 1: x S 1: P 1: y S 1: G 1: vacuum Computer Interface Power Supply Computer Interface Beam Position Monitor Computer Interface Vacuum Gauge 17

What is EPICS? The EPICS Toolkit The EPICS toolkit consists of a set of What is EPICS? The EPICS Toolkit The EPICS toolkit consists of a set of software components with which Application Developers can create a control system. The basic components are: • OPI Operator Interface. A Linux/Windows–based workstation/PC which can run various EPICS tools: the "clients”. • IOC Input Output Controller. A front-end controller, with various I/O modules for analog and digital signals etc, and for access to field buses such as Ethernet, GPIB or CANbus. Originally, this was a VME/VXI-based chassis, containing a Motorola 68 K/PPC processor Nowadays, an IOC can operate on almost any suitable platform. • LAN TCP/IP-based Local Area Network. The communication network which connects the IOCs and OPIs. EPICS provides a software component, Channel Access, which provides network transparent communication between every client - such as GUIs - and an arbitrary number of servers - usually IOCs. 18

EPICS Supports a Standard Control System Architecture OPI (PC/Workstation) Site LAN/WAN Operating Systems: Linux, EPICS Supports a Standard Control System Architecture OPI (PC/Workstation) Site LAN/WAN Operating Systems: Linux, Mac OS X, Unix, Windows I/O Controllers: VME, VXI PCI, Workstations OS: vx. Works, Unix, Linux, Windows, RTEMS, Mac OS X Remote and Local I/O Buses: Ethernet, PCI, CANBus, Industry Pack, VME, VXI, PCI, ISA, CAMAC, GPIB, Profibus, Bitbus, Serial, Allen-Bradley, Modbus, Yokogawa, G-3, Ethernet/IP Field I/O 19

EPICS Supports a Standard Control System Architecture n IOC IOC Commercial Instruments Custom Hardware EPICS Supports a Standard Control System Architecture n IOC IOC Commercial Instruments Custom Hardware RTEMS IOC With Release 3. 14, the operating system limitations for ioc. Core were removed. Technical Equipment 20

A typical EPICS Control System Client Software EDM CSS/BOY ALH TCL/Tk Strip. Tool Perl A typical EPICS Control System Client Software EDM CSS/BOY ALH TCL/Tk Strip. Tool Perl Scripts Many, many others IOC CAS Channel Access IOC Software Commercial Instruments Custom Hardware Technical Equipment EPICS Database Custom Sequence Programs Real-time Programs Control CA Server Process Variables 21

EPICS Attributes • Tool Based • Distributed EPICS provides a number of tools both EPICS Attributes • Tool Based • Distributed EPICS provides a number of tools both for creating and also for operating a control system. This minimizes the need for custom coding and helps ensure uniform operator interfaces. An arbitrary number of IOCs and OPIs can be supported. If a single IOC become saturated, its functions may be spread over several IOCs. • Event Driven Network loading and message latency are minimized by allowing only changes to a datum to be sent by servers to clients. 22

EPICS Attributes • Customization Users may add new components to support their applications; they EPICS Attributes • Customization Users may add new components to support their applications; they are configured using ascii tables/XML files. • Scalable Systems from a few to > 300, 000 “Process Variables" supported. • Modular Distinct interfaces at several layers allow good decoupling between clients and servers, across versions, and mixed hardware. • Portable Runs on Linux, Mac and Windows PCs 23

EPICS IOC Database The EPICS function-block database is the heart of the control system. EPICS IOC Database The EPICS function-block database is the heart of the control system. It is: • Application-specific. • Memory-resident. • What defines the control application; most other application are adjuncts to it. • Modular: built by creating and linking many function blocks ("records"), selected from a user -expandable library. • Deterministic: it runs in real-time either synchronously or asynchronously; either periodically or event-driven. • Provided with fine-grained access control based on user, location, and dynamic parameters (Channel Access security). • Able to simulate missing hardware. 24

EPICS Database Example Records in a database may be linked for purposes of data EPICS Database Example Records in a database may be linked for purposes of data and processing flow hardware VAL Ai input A constant 2 B VAL FLNK PROC calc FLNK double Data Flow double. CALC = A*B Process Flow 25

IOC Internals Overview LAN Channel Access Database Access (EPICS Core) Record Support Device/ASYN/Driver Support IOC Internals Overview LAN Channel Access Database Access (EPICS Core) Record Support Device/ASYN/Driver Support IOC Operating System (e. g. vx. Works) VME Bus 26

EPICS Record Types The following 29 standard record types were distributed in EPICS Base EPICS Record Types The following 29 standard record types were distributed in EPICS Base 3. 14. 12. I/O Signal Processing Data Storage Control Ai Ao Bi Bo Mbbi. Direct Mbbo. Direct Longin Longout Calcout Sub a. Sub Stringin Stringout Waveform Compress Histogram Sub. Array State Aai Aao Dfanout Fanout Event Select Permissive Sequence 27

EPICS Record Support • Has templates of the processing to be performed by each EPICS Record Support • Has templates of the processing to be performed by each record instance. • Processing dependent upon record type. • For I/O records, Record support calls Device support. • Record support does not know any details of Device support, only how to invoke it. Generally, Record support will perform some combination of the following: • I/O If record is an I/O type, Read or Write to hardware via Device Support. • Conversion of raw data to user defined units ( with smoothing, scaling, masking, shifting). • Alarms Check for and raise alarms (high, low). • Monitor Post monitors on data values (which causes callbacks). • Link Cause processing of related records, possibly by "pulling" or "pushing" data. 28

Record Fields A record's attributes are defined by its fields. A field name is Record Fields A record's attributes are defined by its fields. A field name is abbreviated to no more than four upper case letters. A fully qualified Process variable (PV) is written: . All record types incorporate a core set of fields which are needed for basic record processing, such as: • PROC Writing to this field causes record processing. • SCAN The record's method of scanning. • VAL The record's value. • FLNK The record's processing linkage to other records. Input records (e. g. Analogue Input) always have: • DTYP The I/O Device Type. • INP The hardware address. * If no field is given in a PV name, the. VAL field is defaulted. 29

Record Processing (Scanning) When an EPICS record is processed it is said to be Record Processing (Scanning) When an EPICS record is processed it is said to be scanned. Records are scanned in one of three ways: 1. Periodic Scan At a certain periodicity, e. g. 1 second, 0. 1 second, etc. 2. Event Scan Processed when a software or hardware event is triggered. 3. Passive Scan Executed because a related record was scanned and linked to this record, or a field was updated via a db. Put/ca. Put. Within the IOC, records and their support code are processed by a scan task (or thread). There is a separate task for each scan period and scan type. 30

Channel Access § Channel Access is the Channel Access § Channel Access is the "backbone" of EPICS. It provides connections between the internal IOC database and external systems. § Channel Access is based on a Client/Server model. Each IOC runs its own local Channel Access Server task(s). § Channel Access runs over the network using TCP/IP for data transport and UDP/IP for connection management. In addition to getting or setting the "value“ of a channel, other macro data such as a timestamp, a status and a severity can also be returned. § Channel Access was not defined via a formal protocol specification but by its implementation (Jeff Hill, LANL). 31

Channel Access Operations that a Channel Access Client can perform include: • Search the Channel Access Operations that a Channel Access Client can perform include: • Search the network for a particular Channel and connect to it. (A “Channel” requires a network link to a Channel Access server which serves the data in a record field (PV)). • Write to that Channel. • Read from that Channel. • Subscribe to callbacks from that Channel. • Disconnect from that Channel. 32

Channel Access in One Slide “connection request” or “search request” “get” or “ca. Get” Channel Access in One Slide “connection request” or “search request” “get” or “ca. Get” “set a monitor” Change its value to 30. 5 Who has a PV named “S 1 A: H 1: Current. AO”? “put” or “ca. Put” Notify me when the value changes What is its value? Channel Access Client CA Server Channel Access Server Process Variables: I do. 25. 5 AMPS “put complete” S 1 A: H 1: Current. AO S 1: P 1: x or 30. 5 is too high. It is now set to the maximum value of 27. 5. or It is now 20. 5 AMPS 10. 5 AMPS It is now 0. 0023 AMPS “post an event” or “post a monitor” You are not authorized to change this value S 1: P 1: y S 1: G 1: vacuum OK, it is now 30. 5 33

Sequencer • An EPICS facility which can be run in an IOC. • Provides Sequencer • An EPICS facility which can be run in an IOC. • Provides a Finite-State Machine paradigm for control of the database(s). • Source code is written in State Notation Language (SNL) which is compiled into C code using the EPICS State Notation Compiler (SNC). • State transitions are triggered by: elapsed time, channel value change or software event. SNL allows easy translation from State Diagrams to source code. 34

Sequencer An example program fragment: State A { when (situation X occurs){ handle situation Sequencer An example program fragment: State A { when (situation X occurs){ handle situation X; } State B; when (situation Y occurs){ handle situation Y; } State C; }. . . 35

Some Operator Interface Tools These are all host-based standalone utilities using Channel Access to Some Operator Interface Tools These are all host-based standalone utilities using Channel Access to configure or monitor the system. They are configured using interactive tools or files. EDM Extensible Display Manager GUI for control/monitoring (Diamond) MEDM Motif-based Display Manager (APS) EPICS Qt EPICS CA widgets for Qt GUI framework CSS/BOY Control System Studio (see next slide) EDD/DM Original X 11 -based Display Manager ALH Alarm Handler: graphical display of alarm tree Channel Archiver Archives and displays data Strip. Tool Plots data as a strip-chart 36

Control System Studio (CSS) n n Control System Studio (CSS). A major new development Control System Studio (CSS) n n Control System Studio (CSS). A major new development being developed and used at DESY, SNS (and elsewhere) that aims to provide a comprehensive control system application framework. Based on Java/Eclipse IDE with Rich Client Platform (RCP) components. Emphasis on interoperability, portability and standards with a unified look-and-feel New Channel Access clients are being produced with CSS including • BOY – Best OPI Yet • BEAUTY - Best Ever Archive Toolset • BEAST – Best Ever Alarm System Toolset 37

Example Screens: EDM 38 Example Screens: EDM 38

Example Screens: MEDM 39 Example Screens: MEDM 39

Example Screens: CSS/BOY 1 40 Example Screens: CSS/BOY 1 40

Example Screens: CSS/BOY 2 41 Example Screens: CSS/BOY 2 41

Example Screens: ALH 42 Example Screens: ALH 42

Example Screens: Strip. Tool 43 Example Screens: Strip. Tool 43

Configuration Tools These are all host-based standalone utilities used to define and create the Configuration Tools These are all host-based standalone utilities used to define and create the EPICS database definition DCT The original, forms based, Database Configuration Tool GDCT with an updated graphical interface Capfast A proprietary (Phase 3 Inc. ) electronics layout tool used to generate EPICS databases via hierarchical schematics VDCT Visual DCT. Java-based visual design tool TDCT Triumf Database Configuration Tool. Java-based, Capfast compatible The EPICS database definition file (. db file) has a straightforward text format and so can be generated or modified via other means including report generators, scripts, text editors and database tools. 44

Configuration Tools: GDCT 45 Configuration Tools: GDCT 45

Capfast & TDCT 46 Capfast & TDCT 46

Configuration Tools: Visual DCT Templates Record 47 Configuration Tools: Visual DCT Templates Record 47

EPICS and RDBMS For large-scale systems, management of the EPICS configuration can be handled EPICS and RDBMS For large-scale systems, management of the EPICS configuration can be handled using a RDBMS. Several labs have now made use of Oracle or Sybase for this purpose. An example is shown in the diagram, taken from SLAC, which shows their use of Oracle to generate an operational IOC database from template files (DBT) and generator files (DBG). 48

Channel Access Interfaces General-purpose programming languages as well as commercial and public-domain packages have Channel Access Interfaces General-purpose programming languages as well as commercial and public-domain packages have been enabled with a Channel Access capability, including: Ø Ø Ø C Java Perl Python Lab. VIEW Matlab Unix Shells Mathematica Tcl/Tk Active-X IDL/PV-Wave Standard Programming Languages Programming Language Scripting Language Virtual Instrument Builder Numerical Computing Scripting languages Mathematics/Modelling Interpreter with GUI Windows Active-X Presentation Graphics 49

EPICS Utilities In IOC: db. . . dbcar casr dbior as. . seq. . EPICS Utilities In IOC: db. . . dbcar casr dbior as. . seq. . . Database Utilities (get, put, dump, trace, etc. ) Database Channel Access report Channel Access Server Report Driver Reports Access Security Reports Sequencer Reports On OPI: probe caget, caput camonitor Single Channel GUI Diagnostic Channel Access utilities 50

The Future - EPICS V 4 n n EPICS “Version 4” is now under The Future - EPICS V 4 n n EPICS “Version 4” is now under development (initiated at BNL for NSLS-II). Now at “Beta 2. 0” as of January 2013. Support for: • “Structured” data in EPICS records, not just simple type or array • “Remote Procedure Call” like processing pattern. Supports passing arguments within the context of asynchronous record processing. • V 4 includes support for protocol interoperability with V 3 (This is the CAV 3 module, which can be used on the server or client side) • In short EPICS V 4 includes EPICS V 3 51

The Future - EPICS V 4 n Current modules: • pv. Data • pv. The Future - EPICS V 4 n Current modules: • pv. Data • pv. Access • pv. IOC - The description of how memory resident data is described and defined. A complete implementation is available for both Java and for C++. - The description of network support for pv. Data. A complete implementation is available for both Java and for C++. Successor to Channel Access. – The description of an IOC (Input Output Controller) that supports pv. Data. The Java version (java. IOC) has lots of functionality. The C++ version is in the early stages of development. • pv. Service - The description of a set of services based on pv. Data/pv. Access/pc. IOC. Both the Java and C++ versions are in early stages of development. (Provides RPC service, amongst others). 52

The Future - EPICS V 4 n n In an EPICS installation, it is The Future - EPICS V 4 n n In an EPICS installation, it is expected that control and hardware support would still be done with EPICS V 3 IOCs, while middle layer and service operations would be done with EPICS V 4. See http: //epics-pvdata. sourceforge. net/index. html 53

The Future - EPICS V 4 54 The Future - EPICS V 4 54

Ten good things about EPICS 1. 2. 3. 4. 5. 6. 7. 8. 9. Ten good things about EPICS 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. It’s free It’s Open Source There are lots of users running large, well-tested systems 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’s lots of free advice available via email/web A good contribution becomes internationally known By following a few simple rules, you get a lot for free 55

Growth of EPICS 1990 -2012 2003 > 150 Licensees ANL APS & LANL begin Growth of EPICS 1990 -2012 2003 > 150 Licensees ANL APS & LANL begin collaboration on EPICS SLAC DESY LANL develops Ground Test Accelerator Control System (GTACS) KEK BESSY LBL 1990 IPNS DIAMOND CLS FNAL D 0 CEBAF Oct 2007 Meeting > 130 Attendees > 30 Institutions > 75 Presentations Keck Gemini Australian Synchrotron SLS ASKAP SSRF SNS LCLS IPNS DAQ 1995 NSLS-II ITER 2000 Still the “Control System of Choice” 2010 56

EPICS Base Code Statistics The code distributed in the EPICS system has been estimated EPICS Base Code Statistics The code distributed in the EPICS system has been estimated (2004) to have an equivalent commercial cost of $US 22. 5 M 57 Continue… ‘Supported Platforms’