How do I start a device server?

Hello everyone!
I developed a device server and made a shared library out of it. But I don't understand how to create an instance of it. Does it require some more steps? I am completely confused as there doesn't seem to be an obvious answer in the documentation.
Edited 3 weeks ago
Hi,

You can use jive for instance, to create an instance of your device server.
Please have a look at this part of the documentation:
https://tango-controls.readthedocs.io/en/latest/tools-and-extensions/built-in/jive/servers.html#manage-servers

tango_admin tool (–add-server option) can also help you to create a device server instance.


tango_admin –help

Usage:
–help Prints this help
–ping-database [max_time (s)] Ping database
–check-device <dev> Check if the device is defined in DB
–add-server <exec/inst> <class> <dev list (comma separated)> Add a server in DB
–delete-server <exec/inst> [–with-properties] Delete a server from DB
–check-server <exec/inst> Check if a device server is defined in DB
–server-list Display list of server names
–server-instance-list <exec> Display list of server instances for the given server name
–add-property <dev> <prop_name> <prop_value (comma separated for array)> Add a device property in DB
–delete-property <dev> <prop_name> Delete a device property from DB
–tac-enabled Check if the TAC (Tango Access Control) is enabled
–ping-device <dev> [max_time (s)] Check if the device is running
–ping-network [max_time (s)] [-v] Ping network
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hi,

First of all you need an executable not a shared library.

Tango device server is a process running on a machine, while the Tango device is a thread of that process.

Once you have executable you run it as any other program e.g. in linux:

$> TANGO_HOST=somehost:10000 ./MyTangoDevice dev


Note two things: the TANGO_HOST and the parameter.

For Tango device server to start it is essential to pass at least one parameter - server instance name.

If you do it right away you will get an error message that server/device is not defined in Tango database (TANGO_HOST env variable in front of the executable)

Now you need to use Jive or Waltz to define the server in the database. For instance, using Jive follow these steps:

  1. start jive
  2. Tools -> Server Wizard
  3. enter server name (this is typically the same as class name of your device e.g. MyDevice) and server instance name (must be the same as the parameter you pass to the executable)
  4. click next
  5. click next (wizard will fail to recognize server's class, we will add it later manually)
  6. exit from wizard (click Cancel, confirm)
  7. in server tree expand newly registered server
  8. right click on the server instance -> add class
  9. in Class enter MyDevice
  10. in Device enter dev/device/0
  11. click "Register server"
  12. refresh jive, no error messages should occur

With this easy steps you should be able to start your device. There is a how-to in the documentation: How to start a device server

OR as Reynald posted you can use tango_admin –add-server if it is installed on your system:


$> tango_admin –add-server MyDevice/dev MyDevice dev/device/0
Edited 3 weeks ago
Thank you for answers! Everything is working.
 
Register or login to create to post a reply.