How to try Tango Controls

Intended audience: all, developers

There are several ways to try the Tango Controls System.

For the first quick look, you can download and run the TangoBox Virtual Machine. Also, it is a possibility to build the system from source code.

If you have installed and configured Tango, you can skip to: Play with Tango Controls.

Installation notes on Linux base distribution OS

SHORTCUTS

  1. Using Ansible

  2. Installation on Debian

  3. Installation on RedHat(CentOS)

If you want to use Debian/Ubuntu or Docker solution to try Tango you can skip this article and go to:

Tango requires:

  • omniORB - CORBA implementation

  • zeroMQ - event system

You can install this library from source: omniORB, zeroMQ or by your package-management tools like yum or apt-get.

Note

Remember that Tango needs the header files (.h) in the compilation process so is a need to install developers version of these libraries.

Also, many elements of the Tango ecosystem and the Control System itself requires the MariaDB or MySQL database. You can easily install it using apt or yum:

apt install mysql-server/mariadb-server

or

yum install mysql-server/mariadb-server

Download the source of the Tango Control System

wget -L https://gitlab.com/api/v4/projects/24125890/packages/generic/TangoSourceDistribution/9.3.5/tango-9.3.5.tar.gz
tar xzf tango-9.3.5.tar.gz

In this directory, a good practice is to create the build folder, to don’t mix a configuration/compile file with the source.

cd tango-9.3.5
mkdir build

Compile and installation notes

To fully configure TANGO installation you can tell where is the omniORB, ZMQ library and where you want to install Tango Controls System. Also, you need to configure the connection with the database and show where is the mysqlclient-lib.

../configure                                 \
     --prefix=/usr/install_dir_linux         \
     --with-omni=/usr/update                 \
     --with-zmq=/usr/update                  \
     --with-mysqlclient-lib=/usr/lib64/mysql

If the configuration of the system ends successfully, you should see this output:

../../_images/tango-configuration-successful

If the value of the database server and database schema create is no, this means that during the configuration process the connection with the database can’t be established. In this case, check if the path to the mysqlclient-lib is correct. The second reason can be the database credentials. Because the default value for the mysql-user and mysql-password is blank. For setup the proper database configuration can be used the –with-mysql-admin and –with-mysql-admin-pass flag adding to the configure command. Also is a possibility to add the –with-mysql-ho flag to set up the different host with the database to connect.

Now compile and install TANGO by the command:

make all
make install

Running the Tango System

It is essential to correctly run the Tango elements, to better maintain and automate the process starting the necessary part of the Tango Control System. For this purpose, it is recommended to create the system services.

In the case when the system is installed from a .deb package or is running in a docker container the package or the image provides services. However, in the approach described in the above paragraph creating the services and daemon have to be done manually.

So the process of starting the two main server-side elements of the tango environment (Tango Database and Tango Starter) can be optimized.

For creating the Tango DB services make in your /lib/systemd/system directory, file named tango-db.service, containing tango_db.service.

In this service system start the mariadb database process, so for the mysql database this requirement must be changed:

Requires=mysqld.service
After=mysqld.service

There are two main environment files used in this service. One containing the Tango Host address in file /etc/tangorc:

TANGO_HOST=address:port

The second file is providing the database credentials. Tango automatically creates it in the /etc/sysconfig/tango-db. This file contains the database setting e.q:

MYSQL_USER=tango
MYSQL_PASSWORD=tango

To proper setup the Tango Starter daemon, create the file in the /etc/init.d/tango-starter, containing tango_starter. Starter daemon similar like the Tango DB service uses the TANGO_HOST variables to create a connection with a database. The second setting equals the system user, used to start the daemon. The variables informing about this user are configured in the /etc/sysconfig/tango-starter file:

TANGO_USER=tangosys

When all configuration is done, finally system is ready to start the Tango Control System main elements:

systemctl start tango-db
systemctl start tango-starter

The systemctl start command run the process once. If these services should automatically start on the boot of the machine, it needs to run the enable command for these processes:

systemctl enable tango-db
systemctl enable tango-starter

See more: Tango with systemd integration

Installation on CentOS

CentOS base on RPM Package Manager and used YUM as the primary tool to packages management and update the libraries by the system command line interfaces. Thanks MAX IV Laboratory that provides the public RPM repository with Tango packages now process of installation the Tango Control System can also be simplified. It is enough that it is added to the system as a new repository:

yum-config-manager --add-repo http://pubrepo.maxiv.lu.se/rpm/el7/x86_64/

This command creates a new repository and file in /etc/yum.repos.d containing all necessary information about it. Now you can install Tango Starter or Tango Database by the command:

yum install tango-starter/tango-db

Play with Tango Controls

Tango eco-system provides a lot of management application and framework to visualization the data. This chapter provides a quick overview of a basic use case for Tango Control.

The new host is adding automatically by tango-starter daemon, but we can do this manually using the Astor. This application is used to configuring the Control System and its components. Moreover, it provides a quick view of the statuses of all device servers in the Tango. If you want to add the new host manually see: Add a new controlled host. For more information about Astor application see: Astor (TANGO Manager).

TangoTest this is a device class provides all types of attribute available in Tango Devices which can be used for the testing process. In help with Astor the process of starting this device server is simplified. After opening the control panel for specific hosts (in Astor application), we can start a new device server which will be automatically run. Like in this screenshot:

../../_images/astor-tangotest.png

See more: Start a new server with Astor.

When the TangoTest device is working, we can run the atkpanel in jive application and see the attribute, properties, all configuration of the selected device. For this purpose, we can run the jive application (by typing the command jive) and chose in the GUI options Monitor Device on the Tango Device, like in this screenshot:

../../_images/jive-tangotest.png

In atkpanel users can execute the command directly to the selected TangoTest device. List of useful command for this device:

  • SwitchStates - changes states of the device (form RUN states to FAULT or FAULT to RUN)

  • DevType - this is a DevType command example

  • State - return the states of the device

  • CrashFromX - simulate the crash of the device

Jive is an application design to browse and edit the static TANGO database, configure event and test devices. Full documentation for this application you can see here: Jive

In the atkpanel the attribute shows mainly the real-time values. So to better visualization of changes the selected values, the user can use Taurus framework widgets.

TangoTest attribute is generate using trigonometric functions, so it is easy to check if the device works correctly. The TaurusTrend for TangoTest attribute should look like in the screen below:

../../_images/taurus-trend-example.png

To run TaurusTrend uses a command:

taurustrend sys/tg_test/1/double_scalar_rww

To see custom Taurus device panel (similar like atkpanel) run the different command:

taurusdevicepanel sys/tg_test/1/double_scalar_rww

To storage the longtime history of changes of the attributes, you can use the Tango Archiving System.