Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Sardana device pool A strange “future” demonstration A Talk given by and at the Hamburger Tango Meeting 17/18 th September 2010 Authors: Emmanuel Taurel,

Similar presentations


Presentation on theme: "The Sardana device pool A strange “future” demonstration A Talk given by and at the Hamburger Tango Meeting 17/18 th September 2010 Authors: Emmanuel Taurel,"— Presentation transcript:

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

2 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 See how easy it is to install the whole system from scratch Prepare for installation Prepare for Installation Result Prepare for Installation Result

6 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 Use the generic configuration GUI as a mean to understand the underlying server Historical Movie from 2007

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

10 Hamburger Tango Meeting 18/9/2007 See the result of our efforts from the role of the end user of the CLI CLI demo IPython

11 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 Add more hardware to see who powerful the system already is Add more hardware Add a counter, multimeter and measurement groupAdd a counter, multimeter and measurement group

13 Hamburger Tango Meeting 18/9/2007 Add a counter controller with the low level generic configuration GUI Create counter controller

14 Hamburger Tango Meeting 18/9/2007 Add the well known 3 standard channels to compare the concepts with existing solutions Create counter channels sec mon det

15 Hamburger Tango Meeting 18/9/2007 Add an integrating electrometer to see that standard macro solution are already included Add pico ampermeter channel

16 Hamburger Tango Meeting 18/9/2007 Introduce the concept of a measurement group even with the GUI for didactic purposes Create measure ment group

17 Hamburger Tango Meeting 18/9/2007 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 interface has been replaced by a series of TANGO devices

18 Hamburger Tango Meeting 18/9/2007 Demonstrate the actions so far from the users point of view CLI demo IPython IPython with scanning and more hardware

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

20 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 Explain the edit process and show how the internal processes are hidden from the macro programmer Behind the scenes – Editing Macros POOL> wa POOL> mv th 2.3 POOL> POOL> wa POOL> mv th 2.3 POOL> Mymv Sardana Device Pool sup sdown Controller Huber Pool Device CVS Server Macro Server Door sup sdown Macro Device Door 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 Mymv

22 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 Explain the simple macro to understand further what a macro is Move 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 1 A macro is a class which inherits from Macro 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 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 Show the controller code to allow to grasp the concept of device specific plug-ins Write a controller edit a motor controller

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

27 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 Explain communication channels to access devices in a simple, configurable and controlled way Use our controller Add the communication channel to the hardwareAdd the communication channel to the hardware

29 Hamburger Tango Meeting 18/9/2007 Insist on the points before with the generic configuration GUI Creation of a commun ication channel

30 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 Show how easy it is to define the pseudo motors even in the very generic configuration GUI Create pseudo motor slit

32 Hamburger Tango Meeting 18/9/2007 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 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 PseudoMotorControllerSome information i.e. for GUI beautificationThe roles of the real and pseudo motorsA method to calculate real positions from pseudoA method to calculate pseudo positions from realSome extra properties

33 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 Make it clear that we are talking about the hidden part of the iceberg less supported by our users The most important is …

35 Hamburger Tango Meeting 18/9/2007 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 Hamburger Tango Meeting 18/9/2007 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


Download ppt "The Sardana device pool A strange “future” demonstration A Talk given by and at the Hamburger Tango Meeting 17/18 th September 2010 Authors: Emmanuel Taurel,"

Similar presentations


Ads by Google