Found on http://www.semanticmetadata.net/category/comic/ - PowerPoint PPT Presentation

1 / 47
About This Presentation
Title:

Found on http://www.semanticmetadata.net/category/comic/

Description:

Title: PowerPoint Presentation Last modified by: zimoch_e Created Date: 1/1/1601 12:00:00 AM Document presentation format: Bildschirmpr sentation – PowerPoint PPT presentation

Number of Views:126
Avg rating:3.0/5.0
Slides: 48
Provided by: psi138
Category:

less

Transcript and Presenter's Notes

Title: Found on http://www.semanticmetadata.net/category/comic/


1
Found on http//www.semanticmetadata.net/category/
comic/
2
Introduction to EPICS
3
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
  • More people to thank for support
  • Timo Korhonen, Detlef Vermeulen, Dirk Zimoch

4
Contents
  • Morning Introduction to EPICS Lecture
  • What is EPICS?
  • Examples from the EPICS tool box
  • What are Records?
  • How to set up an IOC?
  • Conclusion
  • Afternoon Hands-on training
  • Implementation of a Cooling System (IOC)
  • Some simple clients (medm)
  • Some more exercises

5
What is EPICS?
EPICS is an abbreviation for Experimental
Physics and Industrial Control System
  • EPICS is
  • A collaboration
  • A software tool kit
  • A control systemarchitecture
  • 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

6
Who uses EPICS?
  • Some members of the collaboration (very
    incomplete!)
  • ANL (APS Accelerator, APS Beamlines, IPNS),
    Chicago, USA
  • LANL, Los Alamos, USA
  • ORNL (SNS), Oak Ridge, USA
  • SLAC (SSRL, LCLS), Standford, USA
  • JLAB (CEBAF), Newport, USA
  • DESY, Hamburg, Deutschland
  • BESSY, Berlin, Deutschland
  • Gemini 8m-Telescope, Hawaii, USA
  • PSI (SLS, SwissFEL), Villigen, Switzerland
  • KEK, Tsukuba, Japan
  • DIAMOND Light Source (Rutherford Appleton
    Laboratory), Oxfordshire, England
  • Australian Synchrotron, Melbourne, Australia
  • Iter (Test Fusion Power Plant), South France
  • ESS (European Spallation Source), Lund, Sweden

7
History
  • In 1989 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 and webpage http//www.aps.an
    l.gov/epics/
  • Two collaboration meetings every year (spring and
    autum)in turns in America, Asia, and Europa
  • Collaborative efforts vary
  • Assistance in finding bugs
  • Add manpower Share tools, schemes, and advice

GTA Ground Test Accelerator APS Advanced Photon
Source
8
Are there alternatives to EPICS?
  • System Name
  • EPICS
  • TANGO
  • DOOCS
  • Tine
  • PVSS(Cern)

Collaborations Used at more than one Lab
Single Site Systems Developed and used in one Lab
Commercial System
9
The architecture of EPICS
Network based Client/Server Model (hence the
EPICS logo)
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

10
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
11
Some Details of Channel Access
1. Query Broadcast (UDP)
CA Client
2. Reply direct connection (UDP)
3. All further queries and replies work directly
(Point-To-Point) (TCP)
Network
CA Server 1
CA Server 2
CA Server 3
12
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
post an event or post a monitor
S1AH1CurrentAO S1P1x S1P1y S1G1vacuum
30.5 is too high. It is now set to the maximum
value of 27.5.
For all fuctionality see http//www.aps.anl.gov/e
pics/docs/ca.php for EPICS R3.14 Channel Access
Reference Manual
or
You are not authorized to change this value
or
13
Contents
  • Morning Introduction to EPICS Lecture
  • What is EPICS?
  • Examples from the EPICS tool box
  • What are Records?
  • How to set up an IOC?
  • Conclusion
  • Afternoon Hands-on training
  • Implementation of a Cooling System (IOC)
  • Some simple clients (medm)
  • Some more exercises

14
Examples from the EPICS software tool box
CA Client
CA Client
Client Programs alarmhandler Striptool,
medm, many more (user programs)
Control Room
Cannel Access (UDP/TCP)
CA Server
IOC
CA Server
Server Programs (user programs) iocCore Records
4th Layer Hardware maybe controllers and PLCs
15
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) 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 (otherwise called softIOC)
  • An IOC runs a record database, which defines what
    this IOC is doing

We will come back to details of EPICS Records
later
16
Some EPICS Client Programs
  • (from the EPICS Website very incomplete,
    selection is no assessment)
  • ALH Alarm Handler
  • BURT Backup and Restore Tool
  • CASR Host-based Save/Restore
  • CAU Channel Access Utility
  • Channel Archiver (SNS)
  • CSS and BOY Control System Studio and Best
    OPI,Yet
  • Channel Watcher (SLAC)
  • EDM Extensible Display Manager (ORNL)
  • JoiMint Java Operator Interface and Management
    INtegration Toolkit (DESY)
  • Knobs Knob Manager and KnobConfig, an Interface
    to SunDials
  • MEDM Motif Editor und Display Manager
  • StripTool Strip-chart Plotting Tool
  • and many more
  • Command line tools (caget, caput, )

17
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
18
Client Program medm
19
Client Program StripTool
20
Client Program Alarmhandler
Tree structure of Records
Guidance
Panel with more Information
  • Records have predefined alarm states (SEVR)
  • NO_ALARM
  • MINOR
  • MAJOR
  • INVALID
  • not connectedto the client (no Record state)

everything ok warning alert (non controls
problem) CA server ok, hardware error No server!
21
Contents
  • Morning Introduction to EPICS Lecture
  • What is EPICS?
  • Examples from the EPICS tool box
  • What are Records?
  • How to set up an IOC?
  • Conclusion
  • Afternoon Hands-on training
  • Implementation of a Cooling System (IOC)
  • Some simple clients (medm)
  • Some more exercises

22
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

XYZ1234 Employee James Bond Badge Number
007 Address Whitehall, London Salary
70070.07
unique name
fields
Data
23
Make a Record from a Measured Value
Configured by

developer
with a unique name ARIDI-PCTCURRENT
record (ai, "ARIDI-PCTCURRENT")
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 bis
400
field (DTYP, "HY8401") field (INP, "C3 S0 _at_")
with graphical limits 0 bis 370

with a description Beam current in SR
VAL SEVR TIME
24
Records and Channel Access Process Variables
  • 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
A Process variable name
ARIDI-PCTCURRENT
EGU
.
A record name
A dot to join them
A field name
  • No dots allowed in Record names!
  • 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

25
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

incomplete list!
  • 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

26
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

27
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) html http//www.aps.anl.gov
    /epics/EpicsDocumentation/AppDevManuals/RecordRef/
    Recordref-1.htmlpdf http//www.aps.anl.gov/epics
    /EpicsDocumentation/AppDevManuals/RecordRef/Record
    ref.pdf
  • More Records exist.For example Motor Record
    (part of synApps package)http//www.aps.anl.gov/
    bcda/synApps/index.php

28
Example Measure a Value
CA Client medm
medm sets a CA monitor
Operator
IOC
Record Support
record 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)
29
Contents
  • Morning Introduction to EPICS Lecture
  • What is EPICS?
  • Examples from the EPICS tool box
  • What are Records?
  • How to set up an IOC?
  • Conclusion
  • Afternoon Hands-on training
  • Implementation of a Cooling System (IOC)
  • Some simple clients (medm)
  • Some more exercises

30
IOC Overview What has to be done?
configureswhat theIOC does
EPICS base some functions dbLoadDatabase
dbLoadTemplate iocInit
iocCore
comes withEPICS base or drivers
driver (optional)
seq (snl code) (optional)
your own C-code (optional)
xxxApp
31
Steps towards your IOC (1/4)
On MS Windowsyou need cygwin in addition
  • What you need before you start
  • Build tools gcc, make, tar, gzip
  • Perl scripting language
  • Development package of readline
  • Development packages of X11 and Motif
  • A text editor (e.g. nedit, kwrite, emacs)
  • Browse EPICS home http//aps.anl.gov/epics
  • Get latest Base
  • Get Extensions Config files 3.14, medm

for EPICS extensions like medm
the latest is not always best have a look at
techTalk, read Known Problems and Release
Notes
We use baseR3.14.12-1 today
read Installation Instructions (Read Me) as
well
32
Steps towards your IOC (2/4)
  • Extract Base and Extension packages
  • tar xvfz baseR3.14.12-1.tar.gz
  • tar xvfz extensionsTop_20070703.tar.gz
  • tar xvfz medm3_1_5.tar.gz C extensions/src
  • Build Base
  • export EPICS_HOST_ARCHlinux-x86
  • cd base-3.14.12-1
  • make
  • export PATH/base-3.14.12-1/bin/linux-x86PATH
  • Test the installation
  • softIoc

vxWorks-ppc604 win32 cygwin-x86
33
Steps towards your IOC (3/4)
  • Build Extensions (here medm)
  • cd extensions/configure
  • Edit the RELEASE file
  • nedit RELEASE
  • Set correct path to EPICS Base, e.g.
  • EPICS_BASE/home/epics/base-3.14.12-1
  • make
  • cd ../src/medm3_1_5
  • make
  • export PATH/extensions/bin/linux-x86PATH
  • Test the installation
  • medm

This is something you often have to do with EPICS
components
34
Steps towards your IOC (4/4)
  • Make environment variables permanent
  • Edit /.basrc and add variables
  • export EPICS_HOST_ARCHlinux-x86
  • export EPICS_BASE/home/epics/base-3.14.12-1
  • export EPICS_EXTENSIONS/home/epics/extensions
  • export PATHEPICS_BASE/bin/EPICS_HOST_ARCH\EP
    ICS_EXTENSIONS/bin/EPICS_HOST_ARCHPATH
  • EPICS can also be installed centrally (and maybe
    should)
  • e.g. /opt/epics/base-3.14.12 and
    /opt/epics/extensions
  • or /usr/local/epics/

35
How does an st.cmd file look like (on Linux)?
more IOC functions in EPICS Application
Developer's Guide http//www.aps.anl.gov/epics/ba
se/R3-14/12-docs/AppDevGuide.pdf
trainingIOC should be meaningful (not
exampleIOC or myIOC)
36
How to create a record 1 db file
Record Type
Record Name
Driverinformation
periodicRecordprocessing
Records can be created in any editor Graphical
creation with VDCT (not used at PSI)
37
How to create a record 2 substitutions and
templates
  • 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 motors db file gets lengthy
  • If the device not only needs one record but
    more(BPM with at least x, y, and intensity)db
    file gets even more lengthy and confusing spell
    maintenance nightmare
  • Solution provided by EPICSsubstitution (with
    macro definition) and template files

38
How to create a record 2 substitutions and
templates
there is no standard fileextension for
substitution andtemplate files in EPICS! At
PSI xxx.subs and yyy.template
DEVICE MTRT1 (DEVICE)-TEMPREAD MTRT1-TEMPREA
D
39
IOC System in real step by step
  • Prepare Application (make EPICS base driver)
  • Write startup script (st.cmd file)
  • Write records (db file or substitution template
    files)
  • Save to boot directory
  • Set boot parameters of VME computer
  • Reboot
  • Load and start operating system (vxWorks)
  • Load and start st.cmd
  • Load dbd files
  • Configure hardware
  • Load records
  • Start IOC (iocInit) and create records
  • Test functionality
  • Debug files and go to step 6

IOC Development configure text files (no code,
no make)
40
Contents
  • Morning Introduction to EPICS Lecture
  • What is EPICS?
  • Examples from the EPICS tool box
  • What are Records?
  • How to set up an IOC?
  • Conclusion
  • Afternoon Hands-on training
  • Implementation of a Cooling System (IOC)
  • Some simple clients (medm)
  • Some more exercises

41
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(it is scalable)

11. It is fun (but maybe do not tell this to your
management)
42
Where to learn more?
  • EPICS home pagehttp//www.aps.anl.gov/epics/
  • Tech Talk listen (and learn)http//www.aps.anl.g
    ov/epics/tech-talk/index.php
  • Getting Started with EPICS lecture
    serieshttp//www.aps.anl.gov/epics/docs/GSWE.php
  • Collaboration Meeting (twice a year)http//www.ap
    s.anl.gov/epics/meetings.php

43
Contents
  • Morning Introduction to EPICS Lecture
  • What is EPICS?
  • Examples from the EPICS tool box
  • What are Records?
  • How to set up an IOC?
  • Conclusion
  • Afternoon Hands-on training
  • Implementation of a Cooling System (IOC)
  • Some simple clients (medm)
  • Some more exercises

44
Example Cooling System
IOC
ADC
Database
Analog In
MTTR1-LITEMP1
VAL
INP
Binary I/O
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 45
degrees centigrade.
Calculation
Binary out
EGU deg C
MTRT1-LICALC
MTRT1-LICOOL-SW
INPA
INPB
VAL
DOL
OUT
ADC
C 10
Chiller
Analog In
CALC ( (AB)/2 ) gt C
SCAN 10 second
MTRT1-LITEMP2
INP
VAL
EGU deg C
45
  • files prepared in directoryTraining/vxWorks
  • Installation directory/home/ioc/MTEST-VME-T1
  • Installationcopy (cp) st.cmd and db filecp
    st.cmd /home/ioc/MTEST-VME-T1cp COOLER.db
    /home/ioc/MTEST-VME-T1

46
medm say it with Pictures
MTRT1-LI-COOLTEMP1
47
IOC System in real step by step
  • Prepare Application (make EPICS base driver)
  • Write startup script (st.cmd file)
  • Write records (db file or substitution template
    files)
  • Save to boot directory /home/ioc/ltIOC-NAMEgt
  • Set boot parameters of VME computer
  • Reboot type reboot in minicom window
  • Load and start operating system
  • Load and start st.cmd
  • Load dbd files
  • Configure hardware
  • Load records
  • Start IOC (iocInit) and create records
  • Test functionality
  • Debug files and go to step 6

?
?
?
Write a Comment
User Comments (0)
About PowerShow.com