Dear all,
this is a question of the category best practice. I wrote a DS for the
GalilDMC controllers. This devices come with digital and analogue
IO-ports. The exact types and numbers depend on the ordered device
configuration.
The DS consists of three DS subclasses: GalilDMCControl, GalilDMCMotor
and GalilDMCPort. Control provides the connection to the controller.
Motor provides all possible kinds of motor axes (servo, stepper, ...).
They are chosen via a property and bring a lot of dynamic attributes,
needed for this exact motor type.
Now I implemented the Port DS in the same style: One DS wich has the
dynamic attribute Value. The type of the port is chosen via a property,
the type of the attribute changes accordingly. This works, but only as
long as you use the same port type for all Tango devices of that class.
As soon as you add a digital input to some existing outputs you will
receive the following error on start up:
Tango exception
Severity = ERROR
Error reason = API_AttrNotFound
Desc : Device p11/register/eh.6.i.09 -> Attribute Value already exists
for your device class but with other definition
(data type, data format or data write type)
Origin : Device_Impl::add_attribute
Received a CORBA_Exception
Exiting
Now this makes kind of sense. An attribute definition in the data base
is unique. I simply haven't thought about this before. But how to
rewrite the server now? Is there a more elegant way then to make it four
servers, one for each type?
Best,
Jan
--
---------------------------------------------
Jan Meyer
Beamline Support P11
Deutsches Elektronen-Synchrotron
Notkestr. 85
47c / L136
22607 Hamburg
Germany
phone:
+49-40-8998-5773
e-mail:
jan....@desy.de
--------------------------------------------