SAD and Python with EPICS - PowerPoint PPT Presentation

About This Presentation
Title:

SAD and Python with EPICS

Description:

Electric conference room for SAD (in Japanese). SAD script ... Usage of special characters are common to most of programing language. Extending Python ... – PowerPoint PPT presentation

Number of Views:29
Avg rating:3.0/5.0
Slides: 36
Provided by: aps45
Learn more at: https://epics.anl.gov
Category:

less

Transcript and Presenter's Notes

Title: SAD and Python with EPICS


1
SAD and Python with EPICS
  • at IHEP,Beijing, 2002.8.21
  • Noboru Yamamoto
  • KEK, JAPAN

2
(No Transcript)
3
(No Transcript)
4
(No Transcript)
5
(No Transcript)
6
(No Transcript)
7
(No Transcript)
8
(No Transcript)
9
Simple, well understood behavior
10
(No Transcript)
11
(No Transcript)
12
(No Transcript)
13
High Level Applications in KEKB
  • Applications and Operator displays in KEKB
    Application Launcher
  • SAD is widely used for high level applications.
  • medm/dm2k is used for simple displays.
  • Python is also used for application development.

14
SAD applications
  • Operator Interface
  • Optics measurement
  • Optics calculation and Optics
  • Collision Monitors ...
  • Slow Feedback (with OPI)
  • iBumpa system keeps beams in collision
  • Closed orbit correction

)It is preferable to separate FB loop and its
user interface into different processes.
15
KEKB Launcher
  • Program written in SAD/KEKB Frame
  • Starting point of KEKB operation
  • User can register a new command on the fly.
  • simple load balancing between servers.
  • User can select a host to execute a command.

) Application reads a configuration file ,
kbl.conf, at start up and on request by operator.
16
Applications in KBL
17
A sample SAD/KBFrame application
18
Applications using Python and Pmw
19
SAD and Python compared
  • Python
  • General Purpose Object Oriented dynamic language
  • Developed by Open source project
  • Simple and Clean syntax
  • Support CA and Tk widget
  • RDBMS interface
  • Variety of extension modules
  • SAD
  • Accelerator modeling
  • Developed at KEK
  • Mathematica like scripting
  • support CA and Tk widget
  • Modules for KEKB operation

20
(No Transcript)
21
(No Transcript)
22
SAD installation
  • SAD Source Download Page
  • http//acc-physics.kek.jp/SAD/SADDownloadPage.html
  • You need ID and password to download the source
    code. Contact susumu.kamada_at_kek.jp for your ID
    and password.
  • You also need Tcl/Tk source code and a patch
    specific to SAD/Tkinter.
  • Electric conference room for SAD (in Japanese).

23
SAD script
  • SAD Scripts follows Mathematica(R) syntax.No
    statements, just functions.
  • Every Elements has a form
  • Headarg1, arg2,...
  • eg. Ifcond, st1, st2
  • Some Element has a special notation
  • Plus 1, 2 lt-gt 12
  • Lista,b,c lt-gt a, b, c
  • Name of element/function is same as that of
    Mathematica.

24
(No Transcript)
25
(No Transcript)
26
KEKB Frame
  • Framework, i.e. a collection of programs/scripts,
    to support development of GUI Application
  • Standard Menu
  • Help menu including Process Info
  • status bar including print button
  • Build upon Tkinter Widget Set

27
(No Transcript)
28
Extending SAD
  • SAD modules can be used to extend SAD script
    functionality, i.e. add a new function to SAD
    script.
  • SAD modules is a library written in SAD script.
  • Fortran and C is used to develop SAD program
    itself.
  • Fortran or C can be used add a new functionality
    to SAD script.

29
Python installation
  • Python Web site http//www.python.org/
  • Source code and binary(Windows, Mac, rpm)
  • gnuziptar configure make from tar.gz file.
  • Use of Pmw(Python mega widget) together with
    Tkinter is recommended
  • Use of Gtk(PyGtk) is another possibility.
  • Get CA interface from ANL EPICS web site or KEKB
    web site (or Both)

30
Python syntax
  • Python uses indentation to specify a block
    structure of a program e.g.if cond
    statements_1else statements_2other_statemen
    ts
  • Usage of special characters are common to most of
    programing language.

31
(No Transcript)
32
(No Transcript)
33
(No Transcript)
34
Extending Python
  • Python modules add new functions and/or classes
    to Python language.
  • There already exists a rich set of Python
    modules.
  • C or C can be also used to develop new modules
    ( C-modules).
  • Tools such as SWIG can be used to develop a C-
    module.

35
Embedding Python
  • Python can be used as an extension language of
    the existing program.
  • It adds flexibility and extendability to the
    program.
  • For example, PostgreSQL, a free RDBMS, can use
    Python to define a stored procedure or define a
    new object.
Write a Comment
User Comments (0)
About PowerShow.com