1 / 36

The Sardana device pool

The Sardana device pool. A strange “future” demonstration. Authors: Emmanuel Taurel, Alejandro Homs, Vicente Rey, Pep Ribas, and more. A Talk given by and at the Hamburger Tango Meeting 17/18 th September 2010. Jörg Klora. Tiago Coutinho.

gali
Download Presentation

The Sardana device pool

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. The Sardana device pool A strange “future” demonstration Authors: Emmanuel Taurel, Alejandro Homs, Vicente Rey, Pep Ribas, and more A Talk given by and at the Hamburger Tango Meeting 17/18th September 2010 Jörg Klora Tiago Coutinho

  2. Get an overview about the flow of the demonstration to come Our Sardana “Demonstration” • Get the sardana system and install it on this PC • Add some hardware: • Two motors • A counter, multimeter, and a communication channel • Pseudo motor gap and offset • Use the CLI (and understand the role of the macro server) • Write your own macro • Look at a motor controller code • Understand pseudo motor code

  3. Introduce the different roles of the users of the sardana pool Installation • Back to the future • Main Screen • Back to the future • Main Screen

  4. Understand the different roles to not confuse the changing viewpoints throughout the demonstration POINTS • Different roles: • Developer of the core system (few) • Developer of add-ons (many) • Software support • Expert users • End user

  5. See how easy it is to install the whole system from scratch Prepare for installation • Prepare for Installation • Result • Prepare for Installation • Result

  6. Make the points about the need for easy installation POINTS • Special care for easy installation on a single PC or in a complicated beamline scenario • All necessary packages will be downloaded – otherwise there are too many dependencies!

  7. Start to add hardware to an empty system to see the system from the point of view of the technician Add two motors • Add motors

  8. Use the generic configuration GUI as a mean to understand the underlying server Historical Moviefrom2007

  9. Explain the details of the configuration GUI and the server to clearly see the difference Behind the scenes POOL> wa POOL> mv th 2.3 POOL> Pool Device Sardana Device Pool sup sdown Controller Huber Controller Huber

  10. See the result of our efforts from the role of the end user of the CLI CLI demo IPython

  11. Make the points to clearly explain what the functionallity of the Sardana pool is POINTS • Standard tango device are created • Different hardware will always produce the same standard motor device • A specific client has only knowledge about the simple motor devices not the pool device • Multi clients because of use of events (as far as possible with current version of TANGO!!) • The motor interface is for high level access – think of it as the user commands (mv, set, setdial …) in SPEC

  12. Add more hardware to see who powerful the system already is Add more hardware • Add a counter, multimeter and measurement group

  13. Add a counter controller with the low level generic configuration GUI Create counter controller

  14. Add the well known 3 standard channels to compare the concepts with existing solutions Create counter channelssecmondet

  15. Add an integrating electrometer to see that standard macro solution are already included Addpicoampermeterchannel

  16. Introduce the concept of a measurement group even with the GUI for didactic purposes Create measurementgroup

  17. Further explain the pool POINTS • High performance core (C++ , python) • The pool knows about motors, counters, and lots of other devices and provides a simple, standard and unique interface to them • The pool synchronizes the measurement, minimizes hardware access and allows different users to use the hardware together • The pool is a client software where the standard <ASCII> interface has been replaced by a series of TANGO devices

  18. Demonstrate the actions so far from the users point of view CLI demo IPython with scanning and more hardware

  19. Explain the macro server and its relation to a command line interface Behind the scenes – CLI and Macros POOL> wa POOL> mv th 2.3 POOL> Pool Device Pool Device Macro Device Pool Device Sardana Device Pool Macro Server sup Door sup Macro mymv sdown Controller Jorg sdown Mymv

  20. Write a simple macro to understand the concept of a macro and the distinction to python functions Write a macro • Create new macro file

  21. Explain the edit process and show how the internal processes are hidden from the macro programmer Behind the scenes – Editing Macros Mymv Mymv CVS Server Macro Device Macro Server POOL> wa POOL> mv th 2.3 POOL> Door Door Pool Device Sardana Device Pool sup sup sdown Controller Huber sdown Step 1 When a client starts it gets the macro list with its arguments from the server Step 2 A new macro file is created from the template Step 3 The macro is sent to the CVS Server and the Macro Server is informed Step 4 The macro file is loaded from the CVS Server and into memory Step 5 An event is sent with the new macro list

  22. Make the points about the macro server and the edit process POINTS • Macros are global to all clients of the macro server • The internal structure is hidden from the user (i.e. CVS) • Macros are commands in the CLI (i.e. wa mv) • The current threading model is that macros are serialized • Every client uses at least one “mostly private” door

  23. Explain the simple macro to understand further what a macro is Move macro POINT 1 A macro is a class which inherits from Macro class mymv(Macro): """Move motor to position""" param_def = [ ['motor', Type.Motor, None, 'Motor to move'], ['pos', Type.Float, None, 'Position to move to'] ] def run(self, motor, pos): motor.startMove(pos) motor.waitMove() POINT 2 A macro has a description of itself and its parameters POINT 3 A macro has a method run which will be started in a separate thread

  24. Hint on many more advanced points in the macro server we have no time to treat here Macros • A macro is a class which inherits from Macro • A macro has a description of itself and its parameters • A macro has a method run which will be started in a separate thread • The macro server knows also about: • Macros i.e. macros call macros • Parameters i.e. add new type of parameters • Output through logging framework i.e. wa • Dataflow with different file formats and online plotting

  25. Show the controller code to allow to grasp the concept of device specific plug-ins Write a controller • edit a motor controller

  26. Insist on the very well defined structure of a controller and the supervisor role of the pool Controller Code Features (i.e. backlash) …. Extra Parameters Extra Attributes start_one prestart_one Serial line channel state_one start_all abort_one

  27. Repeat the important points of the controller and try to make the distinction to device servers POINTS • Controllers are easy to write and include only code specific the device (i.e. no backlash capacity in the controller and the pool will simulate this feature) • One can not write an “incompatible” controller • Maximum performance through minimum number of hardware calls (i.e. if move multiple exists it will be used) • Controllers can talk to the hardware by communication channels or device servers

  28. Explain communication channels to access devices in a simple, configurable and controlled way Use our controller • Add the communication channel to the hardware

  29. Insist on the points before with the generic configuration GUI Creation of a communication channel

  30. Explain pseudo motor as advanced plug-ins for this common functionality Pseudo Motors • are an example of specialized plug-ins (pseudo counters, constraints, file formats, logging destinations, …..)

  31. Show how easy it is to define the pseudo motors even in the very generic configuration GUI Create pseudo motorslit

  32. Explain in detail the pseudo motor code to proof how simple it is to add to the system Pseudo controller code from PseudoMotorController import PseudoMotorController class Slit(PseudoMotorController): """A Slit pseudo motor system “”” gender , model, organisation = "Pseudo motor“, "Slit“, "CELLS - ALBA" image, logo = "slit.png“, "ALBA_logo.png" pseudo_motor_roles = ("Gap", "Offset") motor_roles = (“top blade", "bottom blade") class_prop = { ‘resolution' : { 'Description' : ‘The encoder resolution', 'Type' : 'PyTango.DevFloat, ‘DefaultValue' : 1.0 }, } def calc_physical(self,index,pseudo_pos): half_gap = pseudo_pos[0]/2.0 if index == 0: return pseudo_pos[1] - half_gap else: return pseudo_pos[1] + half_gap def calc_pseudo(self,index,physical_pos): if index == 0: return physical_pos[1] - physical_pos[0] else: return (physical_pos[0] + physical_pos[1])/2.0 A class inheriting from PseudoMotorController Some information i.e. for GUI beautification The roles of the real and pseudo motors A method to calculate real positions from pseudo A method to calculate pseudo positions from real Some extra properties from PseudoMotorController import PseudoMotorController class Slit(PseudoMotorController): """A Slit pseudo motor system “”” gender , model, organisation = "Pseudo motor“, "Slit“, "CELLS - ALBA" image, logo = "slit.png“, "ALBA_logo.png" pseudo_motor_roles = ("Gap", "Offset") motor_roles = ("top blade", "bottom blade") class_prop = { ‘resolution' : { 'Description' : ‘The encoder resolution', 'Type' : 'PyTango.DevFloat, ‘DefaultValue' : 1.0 }, } def calc_physical(self,index,pseudo_pos): half_gap = pseudo_pos[0]/2.0 if index == 0: return pseudo_pos[1] - half_gap else: return pseudo_pos[1] + half_gap def calc_pseudo(self,index,physical_pos): if index == 0: return physical_pos[1] - physical_pos[0] else: return (physical_pos[0] + physical_pos[1])/2.0

  33. Further insist on the points of specific plug-ins POINTS • Pseudo motors are generic to the system and not inside a specific client • Very simple to write all the details are taken care of by the pool (events when finished, update intervals, ….) • Specific plug-ins for specific purpose ..

  34. Make it clear that we are talking about the hidden part of the iceberg less supported by our users The most important is …

  35. Give a short overview about the current status Old Problems (from 2007) • Still too unstable (pre alpha) • Some features missing MCA, CCD, hkl • Ease of installation and use not there yet • Older problems: • TANGO Events are too specific and not adapted for these type of IPC • Tango Servers in Python were not possible

  36. Resume in "one" sentence and cry for help Conclusion • Machine and Experiments need a generic client (i.e currently SPEC and Middle Layer) • The device pool aims to be this tool – A generic client in the center of data acquisition and control • The client can be “easily” adapted to other synchrotrons with all kind of plug-ins • PLEASE HELP

More Related