I have the following in another thread, but I now believe the issue was not my device inheritance, but an API problem.
Assuming a hierarchy, where the parent class is called STATION, and within this station are a multitude of equivalent devices of the class SUBSTATION.
I am using Tango grouping to be able to communicate with all substations from my main station class. Adding/removing SUBSTATION devices to the STATION is not a problem. I now want to run a particular command on all SUBSTATION within my STATION, with something like:
replies = self.station_devices.command_inout(fnName, fnInput)
I am following the API here.
However I get the following error:
PyTango.DevFailed: DevFailed[
DevError[
desc = ArgumentError: Python argument types in
__Group.command_inout_asynch(__Group, str, str)
did not match C++ signature:
command_inout_asynch(Tango::Group {lvalue} self, std::string cmd_name, std::vector<Tango::DeviceData, std::allocator<Tango::DeviceData> > param, bool forget=False, bool forward=True)
command_inout_asynch(Tango::Group {lvalue} self, std::string cmd_name, Tango::DeviceData param, bool forget=False, bool forward=True)
command_inout_asynch(Tango::Group {lvalue} self, std::string cmd_name, bool forget=False, bool forward=True)
It seems Tango is expecting a certain type for “param”, however the API doc says this “param” could be of any type.
Upon some investigation, I can see that group.py contains the method:
def command_inout(self, cmd_name, param=None, forward=True):
if param is None:
idx = self.command_inout_asynch(cmd_name, forget=False, forward=forward)
else:
idx = self.command_inout_asynch(cmd_name, param, forget=False, forward=forward)
return self.command_inout_reply(idx)
The command_inout_asynch is called from the __Group class (the actual C++ Tango), where the method signature is as follows:
def command_inout_asynch(self, cmd_name, forget=False, forward=True, reserved=-1)
It seems to me that calling commands for a group will currently only work in PyTango if no input parameters are required. The equivalent call for calling group commands with input parameters (translated to DeviceData in the C++ layer) is not yet implemented.
Any help appreciated.
Cheers,
Andrea