16th Oct 08 Tom Cobb - Python at DLS 1 Uses of Python at Diamond Light Source.

Slides:



Advertisements
Similar presentations
Control System Studio (CSS)
Advertisements

CLS Process Variable Database By: Diony Medrano. CLS PV Database - Topics Background Design Constraints Design and Implementation Benefits and Future.
1 Chapter 12 Working With Access 2000 on the Internet.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Python for S60 SmartPhones PostPC Workshop Fall 2006 Amnon Dekel.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
INTRODUCTION TO WEB DATABASE PROGRAMMING
CS5103 Software Engineering Lecture 08 Android Development II.
SNS Integrated Control System EPICS IOCs – Relational DB Connectivity Bridge A. Liyu, A. Zhukov.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Self Guided Tour for Query V8.4 Basic Features. 2 This Self Guided Tour is meant as a review only for Query V8.4 Basic Features and not as a substitute.
Imperial College Tracker Slow Control & Monitoring.
Automatic Regression Test Facility for Support Modules Jon Thompson, Diamond Light Source Vancouver, 1 May 2009.
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser Matthias Clausen, DESY XFEL Refrigerator Controls – April CSS-DCT (SNL) Training.
CHAPTER FOUR COMPUTER SOFTWARE.
Introduction to Matlab & Data Analysis
Introduction to Interactive Media Interactive Media Tools: Software.
Controls for High-Availability Magnet PS’s for ATF2 Glen White SLAC September
Debby Quock November 13, 2012 IRMIS at CLS. IRMIS Currently at CLS PV Crawler –Perl modules that parse EPICS IOC st.cmd, db, and dbd files. Information.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Introduction of Geoprocessing Topic 7a 4/10/2007.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
Jan Hatje, DESY CSS ITER March 2009: Technology and Interfaces XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser 1 CSS – Control.
Managed by UT-Battelle for the Department of Energy Kay Kasemir ORNL/SNS Oct EPICS Meeting, PAL, Korea Control System Studio Training.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
Elder Matias, Diony Medrano, Dong Liu (At Michigan State University - Nov 2011) IRMIS at CLS.
Final Review of ITER PBS 45 CODAC – PART 1 – 14 th, 15 th and 16 th of January CadarachePage 1 FINAL DESIGN REVIEW OF ITER PBS 45 CODAC – PART 1.
Verified Network Configuration. Verinec Goals Device independent network configuration Automated testing of configuration Automated distribution of configuration.
XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser Matthias Clausen, DESY XFEL Refrigerator Controls – April CSS Core Applications.
EPICS Access from Python Geoff Savage DØ Workshop Thursday June 22, 2000.
Automated Testing Presentation to EPICS Collaboration Meeting DESY Paul Gibbons PhD Diamond Light Source Ltd.
ATF2 Mover Software 19 June 2008 Janice Nelson, Doug McCormick (SLAC) Glen White (LAL/SLAC) Justin May (no longer at SLAC)
Integrating EPICS and LabVIEW on Windows using DCOM Freddie Akeroyd ISIS Computing Group.
ICALEPCS (Geneva, Switzerland, October, 2005) Visual DCT’s Latest Hits Jaka Bobnar Matej Sekoranja, Igor Verstovsek.
Managed by UT-Battelle for the Department of Energy CSS Update Matthias Clausen, Helge Rickens, Jan Hatje and DESY Delphy Armstrong, Xihui Chen,
EPICS Application Development At The Canadian Light Source Glen Wright.
A XML 1 An XML Driven Graphical User Interface and Application Management Toolkit Matthias Clausen (DESY & SLAC) Piotr Bartkiewicz (DESY & FPNT/AGH) Alexei.
Cheddar – Real Time Simulator Scheduling with task dependencies.
Reading Flash. Training target: Read the following reading materials and use the reading skills mentioned in the passages above. You may also choose some.
07/10/2007 VDCT Status Update EPICS Collaboration, October 2007 Knoxville, Tennessee
18. June 2003EPICS WS Channel Management Andreas Lüdeke Swiss Light Source / PSI 20 May 2003 EPICS Collaboration Meeting.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
EPICS to TANGO Translator Rok Šabjan on behalf of Rok Štefanič Presented at ICALEPCS, Knoxville, October.
Visual DCT upgrade Gasper Jansa, Cosylab SLAC, April 2005.
Jan Hatje, DESY CSS GSI Feb. 2009: Technology and Interfaces XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser 1 CSS – Control.
Jan Hatje, DESY CSS – Control System Studio EPICS collaboration meeting CSS – Control System Studio Update EPICS collaboration meeting 2008 Shanghai.
K. Harrison CERN, 22nd September 2004 GANGA: ADA USER INTERFACE - Ganga release status - Job-Options Editor - Python support for AJDL - Job Builder - Python.
Introduction of Geoprocessing Lecture 9 3/24/2008.
Chapter – 8 Software Tools.
EPICS and LabVIEW Tony Vento, National Instruments
Object-Oriented Application Development Using VB.NET 1 Chapter 11 Using Multiple Forms with Problem Domain Classes.
K.Vijayan : RDB for Diamond Control Systems EPICS DB in RDB K.Vijayan June 2006.
Control System Overview J. Frederick Bartlett Fermilab June 1,1999.
An Introduction to Epics/Tango Steve Hunt Alceli EPICS Meeting 2008 INFN Legnaro 15 Oct 17:15.
Software tools for digital LLRF system integration at CERN 04/11/2015 LLRF15, Software tools2 Andy Butterworth Tom Levens, Andrey Pashnin, Anthony Rey.
Linux Administration Working with the BASH Shell.
IRMIS at the CLS E. Matias Canadian Light Source November 23, 2017
JavaIOC Overview and Update
Laboratorio per dottorandi 2017 Particle Accelerators Control System
GFA Controls IT Alain Bertrand
Chapter 2: System Structures
HAPS Controls Glen White ATF2 Software Review Workshop, LAL, June 2008
COMPUTER SOFT WARE Software is a set of electronic instructions that tells the computer how to do certain tasks. A set of instructions is often called.
EPICS IOCs – Relational DB
Automation of Control System Configuration TAC 18
EPICS at Diamond Mark Heron Head of Controls Group
Presentation transcript:

16th Oct 08 Tom Cobb - Python at DLS 1 Uses of Python at Diamond Light Source

16th Oct 08 Tom Cobb - Python at DLS 2 Content Python in IOCs –Simulations for Asyn Drivers Python in Client Applications –CA Bindings –PyQt GUI Design Python in the Build System –EDM Screen Builder –Dependency Checker –Future Developments

16th Oct 08 Tom Cobb - Python at DLS 3 Simulations for Asyn Drivers Most useful simulations written at the lowest possible level Aim - Writing a simulation in a high level language like Python Problem - Driver level typically written in C Solutions: –Attach Python simulated device to real Asyn port –Create simulated Asyn port that communicates with the Python simulation process Driver Support Asyn Port Device Support Record Support EPICS Database Real Device Client Tools Driver Support Asyn Port Device Support Record Support EPICS Database Simulated Device Client Tools Asyn Port Device Support Record Support EPICS Database Simulated Driver Support Client Tools

16th Oct 08 Tom Cobb - Python at DLS 4 Python Serial or TCP/IP Device Uses Linux pseudo serial ports or Python TCPServer Subclass serial_device and implement reply method Supports terminators, unsolicited messages, scheduled functions from dls.serial_sim import serial_device class my_serial(serial_device): # set a terminator Terminator = “\r\n” # and internal value val = 1 def reply(self, command): # return reply to if command==“?”: return self.val else: self.val=command return "OK"

16th Oct 08 Tom Cobb - Python at DLS 5 Asyn Device Support in Python Python wrapper for Asyn Port Subclass pyDrv and implement write and read Supports type conversion, registration of multiple Asyn interfaces, callbacks, scheduled functions from pyDrv import pyDrv class my_asyn(pyDrv): # supported list of asyn cmds commands = ["A","B","C","D"] # internal dictionary of values vals = {"A":1,"B":"BE","C":3.4, "D":[1,2]} def write(self,cmd,signal,val): # write to dict self.vals[cmd] = val def read(self,cmd,signal): # return value from dict return self.vals[cmd]

16th Oct 08 Tom Cobb - Python at DLS 6 Running Python in a Linux IOC Use “Python” function to start the interpreter and run snippets of Python code The above excerpt from st.cmd creates instances of the code from the last two slides Python("from my import my_serial,my_asyn") # start a virtual serial port Python("a = my_serial()") Python("a.start_serial('env_a')") # name of port stored in environment var drvAsynSerialPortConfig('port_a','$env_a') Python("b = my_asyn('port_b')")

16th Oct 08 Tom Cobb - Python at DLS 7 Python CA Bindings Python wrapper for libca.so using ctypes Type returned from caget() is converted to a Python type with extra fields Extensively used in GUI design caput(pvs, values, repeat_value=False, timeout=5, wait=False, throw=True) caget(pvs, timeout=5, datatype=None, format=FORMAT_RAW, count=0, throw=True) camonitor(pvs, callback, events=DBE_VALUE, datatype=None, format=FORMAT_RAW, count=0, all_updates=False, notify_disconnect=False)

16th Oct 08 Tom Cobb - Python at DLS 8 Front End GUI – SVG Graphics

16th Oct 08 Tom Cobb - Python at DLS 9 Operators make use of the CA bindings to make their own GUI panels Some also display Archiver data

16th Oct 08 Tom Cobb - Python at DLS 10

16th Oct 08 Tom Cobb - Python at DLS 11

16th Oct 08 Tom Cobb - Python at DLS 12 Build system Substitution files and EDM screens generated from spreadsheet source

16th Oct 08 Tom Cobb - Python at DLS 13 Python EDM screen builder Write and read EDM screens Attributes accessible in a dictionary-like manner Used to create summary screens, autofill the synoptic, and optimise screens from dls.edm import EdmObject # make a blank screen screen = EdmObject(“Screen”) # make a rectangle object rectangle = EdmObject(“Rectangle”) # change its height rectangle[“h”] = 80 # add it to the screen screen.addObject(rectangle) # make another rectangle r2 = rectangle.copy() r2[“y”] = 60 screen.addObject(r2) # write the screen out text = screen.read() open(“/tmp/e.edl”,“w”).write(text)

16th Oct 08 Tom Cobb - Python at DLS 14 Dependency Checker Parses RELEASE tree Shows updates, clashes, SVN logs Creates a consistent updated tree Allows editing and dependency checking of the updated trees Changes written back to RELEASE

16th Oct 08 Tom Cobb - Python at DLS 15 Future Plans? Replace spreadsheet with XML source Suitable editor for this XML source Python “builder” objects that know how to create substitution files, startup scripts, summary screens Use the XML source to create instance of these objects that define an IOC