tool for updating a TANGO attr. in function of several TANGO values

Hi tangoers,
we wondered if there is any mean to change a TANGO attribute according to the values of several other TANGO attributes.
We could use a GUI or a DS to do this.

However, during commissionning, some scientists would like to test some computing before putting this into DS.
I would like to avoid to launch a GUI to just compute a basic.

One answer could be to develop a python script and adding it to crontab.
This way, the TANGO value would be updated regularly according to other TANGO values.
I would like to know if there is any other mean like a TANGO tool other than a DS, in order to avoid to reinvent the wheel.

Regards.
- Philippe
Hi Philippe,

At ALBA we have developed several devices with these capability (SimulatorDS, PyStateComposer, PyAttributeProcessor).

As example, you can try the SimulatorDS device:

https://github.com/tango-controls/SimulatorDS

It allows to declare new attributes using the DynamicAttributes property. Just write your formulas and execute the updateDynamicAttributes() command with no need of restarting the device (unless you change the type returned).

These new attributes can be based on mathematical formulas or operations between attributes of other devices, like:

SUM_OF_ATTRIBUTES = ATTR('a/tango/device/value') + ATTR('another/tango/device/value')

The device is very versatile, you can find some more examples of DynamicAttributes Syntax here:

https://github.com/tango-controls/SimulatorDS/blob/master/doc/recipes.rst

https://github.com/tango-controls/fandango/blob/documentation/doc/recipes/DynamicDS_and_Simulators.rst

Sergi Rubio


PD: PyAttributeProcessor and PyStateComposer will do also the job, but we are actually merging it into a new class; so better use SimulatorDS as it is already in production with latest Tango release.
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Edited 7 years ago
Thank you Sergi, I will take a look at these DS. :)
- Philippe
 
Register or login to create to post a reply.