Running Sardana as a tango server

Note

if you have Tango <= 7.2.6 without all patches applied, Sardana server will not work due to a known bug. Please follow the instructions from Running Pool and MacroServer tango servers separately instead.

Sardana is based on a client-server architecture. On the server part, sardana can be setup with many different configurations. Advanced details on sardana server configuration can be found here <LINK>.

This chapter describes how to run sardana server with it’s simplest configuration. The only decision you have to make is which name you will give to your system. From here on lab-01 will be used as the system name. Please replace this name with your own system name whenever apropriate.

The sardana server is called (guess what) Sardana. To start the server just type in the command line:

homer@pc001:~$ Sardana lab-01

The first time the server is executed, it will inform you that server lab-01 is not registered and it will offer to register it. Just answer ‘y’. This will register a new instance of Sardana called lab-01 and the server will be started. You should get an output like this:

homer@pc001:~$ Sardana lab-01
lab-01 does not exist. Do you wish create a new one (Y/n) ? y
DServer/Sardana/Lab-01 has no event channel defined in the database - creating it

That’t it! You now have a running sardana server. Not very impressive, is it? The Running the client chapter describes how to start up a CLI application called spock which connects to the sardana server you have just started through an object of type Door called Door_lab-01_1.

You can therefore skip the next chapter and go directly to Running the client.

Running Pool and MacroServer tango servers separately

Note

You should only read this chapter if you have Tango <= 7.2.6 without all patches applied. If you do, please follow in instructions from Running Sardana as a tango server instead.

It is possible to separate sardana server into two different servers (in the first sardana versions, this was actually the only way start the sardana system). These servers are called Pool and MacroServer. The Pool server takes care of hardware communication and MacroServer executes procedures (macros) using a connection to Pool(s) server(s).

To start the Pool server just type in the command line:

homer@pc001:~$ Pool lab-01

The first time the server is executed, it will inform you that server lab-01 is not registered and it will offer to register it. Just answer ‘y’. This will register a new instance of Pool called lab-01 and the server will be started. You should get an output like this:

homer@pc001:~$ Pool lab-01
lab-01 does not exist. Do you wish create a new one (Y/n) ? y
DServer/Pool/Lab-01 has no event channel defined in the database - creating it

Next, start the MacroServer server in the command line:

homer@pc001:~$ MacroServer lab-01

The first time the server is executed, it will inform you that server lab-01 is not registered and it will offer to register it. Just answer ‘y’. Next, it will ask you to which Pool(s) you want your MacroServer to communicate with. Select the previously created Pool from the list, press Return once and Return again to finish with Pool selection. This will register a new instance of MacroServer called lab-01 and the server will be started. You should get an output like this:

homer@pc001:~$ MacroServer lab-01
lab-01 does not exist. Do you wish create a new one (Y/n) ?
Pool_lab-01_1 (a.k.a. Pool/lab-01/1) (running)
Please select pool to connect to (return to finish): Pool_lab-01_1
Please select pool to connect to (return to finish):
DServer/MacroServer/lab-01 has no event channel defined in the database - creating it