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. |
|
|
---|---|
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.
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:
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:
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:
|
|
|
---|---|
Thank you for answers! Everything is working. |
|
|
---|---|
Hi, I was wondering if you could let me know how to I create an executable for the device server. I'm going through the documentation but I haven't found anything explaining how to do so. Thanks |
|
|
---|---|
Hi Eva, What kind of device server executable would you like to create? Do you have already the device server code? Do you want to create a new one? Do you want to work with a pyTango device server (in Python), a C++ device server or a java device server? Kind regards, Reynald Evaki
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. |
|
|
---|---|
Hello Reynald, I am trying to follow the PyTango tutorial PowerSupply and I have the device server code for it. I have registered the device in Jive and I try to start it via cmd I get this: (.venv) C:\PythonProj\TTtest>python power_supply.py test Unknown exception while trying to fill database cache… Ready to accept request In Astor the server is not running and when I click on Start the Server I get this error (also shown in the attachments): PowerSupply : not found in 'StartDsPath' property: - C:\DeviceServers\bin In Jive when I try to test the drive I get the error also shown in the attachments From what I have read I need an executable at the StartDSPath? Thanks, Eva |
|
|
---|---|
I think this other post will help you: https://www.tango-controls.org/community/forum/c/development/python/python-and-astor/?page=1#post-142 Hoping this helps. Reynald
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. |
|
|
---|---|
I've read this but I don't understand it.. At the previous post it says create a file with no extension: You have to create a file without extension PythonDS which contains : #!/usr/bin/env python # PythonDS device server launch script from PythonDS import main if __name__ == '__main__': main() and later on thay say to create a .bat file: For your example : PSDS.bat containing: python c:/MyPath/PSDS.py %1 %2 Sorry, I am new to this and it is just confusing. Shouldn't I create an .exe file? and what should it contain? |
|
|
---|---|
Evaki This was for the case when you are on Linux. Evaki The second one (.bat file) is for the case when you are on Windows.
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. |