1 / 15

Online model in Python

Online model in Python. David Kelliher ASTeC /STFC/RAL 3 rd December 2009. Contents. Installation of EPICS and setting up a minimal server for EMMA Python Channel Access client Operation Interface and Virtual Accelerator. Machida 18/06/09. EPICS IOCs. Minimal EPICS server for EMMA.

harmon
Download Presentation

Online model in Python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Online model in Python David Kelliher ASTeC/STFC/RAL 3rd December 2009

  2. Contents • Installation of EPICS and setting up a minimal server for EMMA • Python Channel Access client • Operation Interface and Virtual Accelerator

  3. Machida 18/06/09

  4. EPICS IOCs

  5. Minimal EPICS server for EMMA • Includes quadrupole position and power supply current, and BPM readouts. • Sufficient information to do tune measurements, horizontal orbit distortion and correction. + Kinetic energy, injection x,x’, number of turns

  6. Operation Interface

  7. Operational Interface • Communicates with the EPICS IOC using Channel Access (CA) Client (ca.Get, ca.Put, ca.monitor etc). • Can run in VA or RA mode. It should also be possible to run the online model directly. • Interface being written in Python using Tkinter. • Python CA Clients already exist.

  8. Python channel access • A number of implementations can be found online include caPython, epicsPV, EpicsCA and PythonCA. • Using PythonCAdeveloped by Noburu Yamamoto at KEK. • Python/C API used as wrapper. Compatible with latest stable release EPICS-3.14.10. • Download PythonCa-1.20.2 tarball from www-acc.kek.jp.

  9. Testing PythonCA • Set EPICS_CA_ADDR_LIST to IP of computer on which EPICS server is running. • Run caRepeater in background • In test directory, after editing the channel names, can now try python testPython.py

  10. Python connection to EMMA EPICS server #!usr/bin/env/python #import PythonCA channel access module import ca #send a magnet position to server ca.Put(“emmaserverHost:E01-MAGN-POSN-01”, 0.03) #get BPM1 reading from cell 22 ca.Get(“emmaserverHost:E22-DIA-EBPM-01”)

  11. Tkinterinterface

  12. Tkinter orbit correction

  13. Virtual Accelerator

  14. Virtual Accelerator • Tracking code that simulates the real machine • Zgoubi with python interface (PyZgoubi) implemented. • Beacon switch in the EPICs server could be switched on by Operation Interface. Alerted by ca.Monitor(), VA reads data it needs from server and sends results back (BPM data etc). Operation interface gets results from server and performs analysis.

  15. Conclusions • EPICS server with minimal records to simulate EMMA has been set up. • PythonCA client installed and tested • Operation Interface can now communicate with EPICS server • Virtual Accelerator set up using PyZgoubi, controlled by EPICS server

More Related