Querying the list of attributes for a device

Is there a way to query the list of attributes having been defined for a specific device? What I'd need, is a function similar to

get_device_property_list(…)


function, which can return the names of all the properties registered for a specific device.

I am looking for a solution that also works when the device server is not running (to define a device proxy is not sufficient, because it needs the device server running).

I would like to query certain parameters of an attribute, but in order to do this I need to know the attribute names first.

Thanks for your help in advance

Tamás Gaizer
ELI-ALPS
Hi Tamas,

I know only DeviceProxy.get_attribute_list() and it requires the device server to be running.
With the Tango feature of "dynamic attributes" I see it difficult to obtain the list of attributes differently.
I also remember some discussion about notifying clients with something like "Interface changed" events, but I'm not sure if it is implemented already…

Hope it helps,
Zibi
Hi,

The interface change events are implemented since Tango 9.1.0 as stated in the TANGO_CHANGES file.

Cheers,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hi Zibi,
the "change interface" event is implemented in Tango 9. So far it is still missing in PyTango9. Do you need it urgently?
You are right that it is not possible to have a list of (dynamic) attributes from a device server if it is not running.
Cheers
Andy
Hi Tamas,
I did not see your initial post (problem with replying too fast). No there is not a way of querying the list of attributes for a device when it is not running. This information is not stored in the database. On top of this you have the dynamic attributes. If you need this type of request it would have to be added. We have discussed in the past such a feature but it is quite tricky because it can create incoherences due to having settings in two places (device server and database). In the end we did not do it. It would have to be studied again to see what the implications are.
What is your use case? How urgent is this need?
Cheers
Andy
Hi Tamás,

Actually, I think you could use the DbGetDeviceAttributeList command from the database server device to get what you need.
This command takes a DevVarStringArray as input.
Str[0] = Device name
Str[1] = Wildcard

So if you invoke it with Str[1]="*", you should get all the attributes defined for this device.
I don't know how this behaves with dynamic attributes but it works even if the device is not running.

Hoping this helps, smile

Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hey Reynald,

Aha - I learned something ! I wonder if all attributes are in the database? If they are why does Jive not display them? A quick test with Jive on TangoTest shows the list of attributes is not complete when trying to browse and the device server is not running. Is this for another reason?

Andy
Right you are, Andy! smile

It seems this does not list all the attributes… Probably only those who have or had attributes properties defined at some point.
I guess jive is using this command and only gets what is listed in the database.

Cheers,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.

Dear Zibi, Reynald and Andy,

Many thanks for your fast and valuable comments.

Special thanks to Reynald, the proposed solution is really working and must be perfect for me. In fact, my objective is to make a backup of those attributes that have some properties set (min / max value, polling, etc.), so the list returned by DbGetDeviceAttributeList seems to be exactly what I need.

Thanks again for all of you.

Tamás

Edited 7 years ago
 
Register or login to create to post a reply.