![]() |
ChimeraTK-ControlSystemAdapter-TangoAdapter 02.00.02
|
The ChimeraTK-ControlSystemAdapter-TangoAdapter implements the ChimeraTK Control System Adapter for Tango
Prerequisites:
To integrate the application into Tango, it has to be linked against the ChimeraTK-ControlSystemAdapter-TangoAdapter library. Simply use the find_package() Feature from CMake. The package provides imported targets, so all you have to do is to use target_link_library(${PROJECT_NAME} PRIVATE ChimeraTK::ChimeraTK-ControlSystemAdapter-TangoAdapter).
As is common with Tango device servers, it is possible to configure certain aspects of the server through properties
To run the the same device server executable with different configurations, use the WorkingFolder property. It should contain a path either relative to the location of the executable or a fully qualified path on the filesystem.
If no property is provided, the working folder will be the folder that contains the device server executable.
By default, the Tango adapter will export all available variables in the variable household of the application to Tango as attributes. ApplicationCore's hierarchical names are translated as follows:
The top level Application module is separated from the rest of the hierarchy with an underscore. The rest of the hierarchy is appended translating "/" to ".". For example, /ControlUnit/AverageCurrent/heatingCurrentAveraged becomes ControlUnit_AverageCurrent.heatingCurrentAveraged.
More complex mapping and filtering of process variables is supported as well through a configuration file.
The configuration file for the extended attribute mapping configuration is called applicationName-AttributeMapper.xml. applicationName must be replaced with the name of your application.
In the example above we declare a deviceServer with two deviceClasses and three deviceInstances.
There can only be one deviceServer per configuration. The number of device classes and device instances, however, is not limited.
The deviceClass has a mandatory name attribute and contains any number of deviceInstances. Variables inside the device instance can either be mass-imported by using the import tag, where the naming translation as described above is applied.
A device class can have an optional title and description. Those override the device properties usually provided by the C++ code. If not given, title defaults to the class name and description to "ChimeraTK-based DeviceServer".
It is also possible to map individual variables to attributes using the <attribute> tag. The <attribute> tag has a mandatory source attribute describing the path to the process variable. Using the optional name attribute, the attribute name can be specified.
One can also override the description and egu of the process variable using the <description> and <egu> child tags of <attribute>.
The optional <eventing> child tag enables Tango event generation for the attribute. Its content is one of off (the default), dataReady or change. dataReady emits a DATA_READY event and change a CHANGE event, both on every update of the attribute's process variable. The two kinds differ in their payload, not in when they fire: a CHANGE event carries the value and its quality, a DATA_READY event only the event counter. Eventing is only allowed for readable scalar and spectrum attributes. An unknown value and a write-only attribute are rejected when the mapper file is read. Image attributes are not implemented.
By default a device starts up in state ON and with the status "Application is running.". An application can take control of both by naming a readable process variable in the optional stateSource and statusSource attributes of the deviceInstance tag.
stateSource has to be an integral process variable, typically a ChimeraTK::StatusAccessor. Its value is mapped to the Tango device state: 0 becomes ON, 1 becomes FAULT, 2 becomes OFF and 3 becomes ALARM. Any other value results in state UNKNOWN and a warning is logged.
statusSource has to be a string process variable. Its value is used as the status of the device.
State and status are updated whenever the application publishes a new value. This includes the value which is already available when the device is created, so a device starts up in the state and with the status published by the application instead of the defaults above. A source which is not in the variable household of the application, or which is not readable, makes the start-up fail.