Tango development guidelines within the bliss project.
Writing tango (server and/or client) can be done for the following (non exclusive) purposes:
provide remote access to the bliss system in spec
provide remote access within bliss to some specific functionality
As an example of use-case 1 you have need to access from spec the bliss motion (system). For this purpose, a device server type (BlissAxisManager) has been written which exposes the motion functionality to spec. When writing a tango server to be accessed from spec you need to be aware of some constraints:
spec does not support tango events
spec does not support tango pipes
spec has limited support for complex tango attribute types like long-string or double-string arrays
spec does not support tango encoded data type
If an attribute uses a special encoding (ex a string attribute being filled with JSON data),
decoding needs to be done with specific macros
As an example of use-case 2 you have the case of the ct2 (P201/C208) PCI card. An instance of bliss might be running on the Industrial PC where the card is installed but the bliss session that controls the experiment might run in the
beamline control workstation. The bliss session accesses the card through a tango client object that mimics the API of the local P201 card API used by the tango server that runs on the Industrial PC.
tango server executables:
should be placed in the tango/ directory
preferably a python executable without extension (using python shebang: #!/usr/bin/env python)
tango server code
should be placed in bliss/tango/servers
should have the suffix _ds.py
logic should be implemented in bliss; tango classes should have a minimum of logic
if tango class is developed to provide access to spec:
provide minimum attributes & commands to make it happen
write a macro in spec/
if tango class is developed to provide bliss with remote access to
bliss class (ex: PCI card):
server API (+ optional tango client class) should be developed
in the sense of providing the same API as original bliss class.
write a device class BiologicPotentiostat exposing bliss biologic potentiostat.
Also provide an executable capable of running a DS with class BiologicPotentiostat