[solved] how to declare/delete/modify free properties non interactively?

Hello,
I would like to modify, create or delete a free property in a non interactive way.

I tried with tango_admin without success, it is probably normal since the help of tango_admin does not seems to allow this use.

Thank you.
- Philippe
Edited 6 years ago
Hello Philippe
Free properties, by definition, are not related to a device (admin or not).
You must use Database class methods.

Regards
Pascal
If you want to get/set properties from linux shell you can use PyTango:

> MY_VALUE=hostname

> python -c "import PyTango;PyTango.Database().put_property('MyFreeProperty',{'HostName':'$MY_VALUE'})"

> YOUR_VALUE=$(python -c "import PyTango;print(PyTango.Database().get_property('MyFreeProperty','HostName').values()[0][0])"

> echo $YOUR_VALUE
  hostname

Fandango includes the "tango_property" script that simplifies a bit the second step (it tries to hint whether you search for device/dserver/starter/class/free properties in this order):


> tango_property MyFreeProperty HostName
  hostname
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Edited 6 years ago
Hello,
thanks to both of you for your answers. :)

edit: for other readers, you need to add a closing parenthesis to the following line:

YOUR_VALUE=$(python -c "import PyTango;print(PyTango.Database().get_property('MyFreeProperty','HostName').values()[0][0])")
and it works juste fine!
- Philippe
Edited 6 years ago
 
Register or login to create to post a reply.