Skip to content

Add docs on how to access Tango in macros and controllers

Zbigniew Reszela requested to merge github/fork/reszelaz/doc_access_tango into develop

This documentation was requested by one of our scientists at ALBA. When migrating user macros to Python 3 we discovered that user macros were using several different ways of accessing to Tango devices.

I tried to summarize what possibilities we have and give a simple rule of thumb on which one to use.

There is one more way which I have not documented yet. The Macro.getDevice() which currently does not give any benefit over taurus.Device(). But with the recent investigation of @tiagocoutinho on how Tango (and CORBA) optimizes socket connection from the client to the server I think we could change this method and make it maintain the reference to the taurus.Device. It is similarly done for the internal Sardana elements getters e.g. getMotor. @tiagocoutinho, if I understood well the connection is closed after some inactivity period. This way the only penalty of such a change would be the memory footprint of a tango.DeviceProxy and taurus.Device objects. What about the ZMQ socket for the configuration events?

Also I have not added to the Accessing Tango from your controllers the possibility to use sardana.pool.poolutil.PoolUtil singleton. I think it has not real benefit over maintaining a reference to the tango.DeviceProxy in the controller itself. Unless we change the PoolUtil and maintain a gloabl proxy instead of one per controller instance.

Merge request reports