Attribute configuration for dynamic (non-class) attributes

Hi,

A few weeks ago, I made a this post regarding dynamic attributes for dynamically created device instances. As a solution to my problem in that post, the dynamically created attributes are now local to the device instance and are removed from the device class attribute list upon creating of the dynamic attribute.

I have now ran into a problem with making attribute configuration for these dynamically added local attributes. In specific, I would like to set a minimum and maximum alarm value for some dynamically created attribute called BC1ChargeLoss. This attribute is local to this instance of this device, and not part of the device class. However, when I try to do this in Jive, I get the following error message:


Desc -> Attribute BC1ChargeLoss not found in class attribute(s)
Reason -> API_AttrOptProp
Origin -> MultiClassAttribute::get_attr

I take this to mean that attribute config is only available for class-level attributes. Is there any way I can work around this? Any help is much appreciated.
Hi Rutger,

perhaps could an AttributeProxy come to the rescue? An attribute's configuration of a running device can be retrieved and modified through such an AttributeProxy.

# Python code
from tango import AttributeProxy
ap = AttributeProxy('new_installation/unbelievable_device/great_instance/fantastic_attribute')
config = ap.get_config()
config.alarms.delta_t = '175'
ap.set_config(config)

Hth.

Cheers,
Thomas
Hi Thomas,

Thanks for your reply. I tried this, but unfortunately I get the same error that the attribute is not found in the class attributes. I think the whole concept of attribute configs might only be available for class attributes maybe.
Edited 3 months ago
 
Register or login to create to post a reply.