C++ Device without POGO

Hi all,
I’m trying to understand the basics of writing a Tango device with C++. I know that I can just run POGO, select the right options, and have it generate a class for me, but then I haven’t learnt anything.

Is there any documentation on writing the equivalent of a “hello world” device by hand in C++? Maybe something that stores a float that can be changed by the user.

Thanks!

Stephen

Hi Stephen,

I would say that using POGO to write a TANGO C++ device server is the way to go right now for all C++ device servers.
The C++ API is not as simple as the Python HL one.
It’s very easy to write device servers without POGO in Python HL but the current C++ API is currently much more complex.

The idea behind using POGO is that the device server programmer focuses only on the parts of the code really relevant for his use case (all the parts with comments similar to // add your own code here): what to do during the initialization phase or when an attribute is read or written, what to do when a command is executed (, …), without taking care of all the TANGO specific code needed to declare, create the commands. attributes, devices (…) which is generated for you by POGO.

One of the advantages of using POGO is that if the cppTango/POGO maintainers decide to change the way to create, manage devices/attributes/commands in the future, we could just use POGO to regenerate the code and this would be transparent for the user.

If you want some examples of Device servers which were not generated by POGO, you can have a look at the servers used in the cppTango tests: tests/device_server/generic · main · tango-controls / cppTango · GitLab or tests/catch2/utils · main · tango-controls / cppTango · GitLab but still I encourage you to rather use POGO for the C++ device servers creation and update.

You can refer to this section of the documentation to get more info on how you can edit the relevant code in the generated POGO code: Write your first C++ TANGO device class — Tango Controls 10.0.0 documentation

Hoping this helps,
Reynald