Memorised Dynamic Attribute

Hi Team,

In Java Device Server, when I create memorized scalar dynamic attribute with "write hardware at init" feature, there is a strange behavior observed.

Scenario 1: When memorized dynamic attributes are created in "initDevice()" method they behave correctly.

Scenario 2: When memorized dynamic attributes are created as a part of TANGO command implementation they are not memorized.

TANGO version: 9.2.2
TANGO Jar version: 9.3.4 & 10.0.0
OS: Linux (Ubuntu 16.04)

Need help …
Regards,
TCS_GMRT
Hi
I am not sure that dynamic attributes must be memorized.
Dynamic attributes are (by definition) dynamic and their lifetime is the lifetime of the server.
They are not supposed to be present at next server startup.

Regards
Pascal
Not sure about this… my interpretation for dynamic attributes is not that much dynamic.
Meaning dynamic stuff gets created at runtime, but the device is supposed to provide the
same set of Attributes when restarted.
Not sure I understand scenario 2, anyway. What does "as part of TANGO comand implementation"
means?
Cheers,
Lorenzo
lorenzo
Not sure about this… my interpretation for dynamic attributes is not that much dynamic.
Meaning dynamic stuff gets created at runtime, but the device is supposed to provide the
same set of Attributes when restarted.
I don't have the same interpretation. The device can indeed provide the same set of attributes when restarted but this is not mandatory, it depends on how the user creates the dynamic attributes.
I agree with Pascal when he writes:
Pascal
Dynamic attributes are (by definition) dynamic and their lifetime is the lifetime of the server.

I find this part a bit confusing though:
Pascal
They are not supposed to be present at next server startup.
I think what Pascal means is: if the device server is restarted and the user wants to still have the same dynamic attributes as the previous time, the same dynamic attributes must be created again.

If you create the dynamic attributes in a command, this means that these attributes do not exist until the command is executed.
The memorized value is applied by Tango at device server startup, after the init_device() has been called but in your scenario 2, it will be applied before the command creating the dynamic attributes is invoked. So when Tango tries to write your dynamic attributes with the memorized value, it cannot do it since the attribute does not exist yet.

So, if I understood well, what you would like to achieve is the following:
When a user invokes a special command, it creates dynamic attributes.
If the device server is restarted, the same dynamic attributes should be created and their memorized value should be written.

So you need to find a way to create again the same dynamic attributes during the initialization phase.
So I would suggest to use a property or any ways you can think of to memorize the minimum information needed to recreate the same dynamic attributes during the device server startup phase.

I hope this helps,
Reynald
I hope it is clear.
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.
 
Register or login to create to post a reply.