TMC Common TangoClient

Tango Client Code

class ska_tmc_common.tango_client.TangoClient(fqdn: str, logger: Optional[<Mock id='140237828786000'>] = None)

Class for TangoClient API

get_device_fqdn() → str

Returns the Fully Qualified Device Name

(FQDN) of the Tango device server.

send_command(command_name: str, command_data=None)

This method invokes command on the device server in synchronous mode.

:param

command_name: string. Name of the command

:param

command_data: (optional) void. Parameter with the command.

:return

Returns the command Result.

:throws

DevFailed in case of error.

send_command_async(command_name: str, command_data=None, callback_method=None)

This method invokes command on the device server in asynchronous mode.

:param

command_name: string. Name of the command

:param

command_data: (optional) void. Parameter with the command.

:param

callback_method: (optional) Callback function

that should be executed after completion

of the command execution.

:returns

int.

Command identifier returned by

the Tango device server.

:throws

DevFailed in case of error.

get_attribute(attribute_name: str)

This method reads the value of the given attribute.

:param

attribute_name: string. Name of the attribute

:return

Returns the DeviceAttribute object with several fields. The attribute value is present in the value field of the object. value: Normal scalar value or NumPy array of values.

:throws

AttributeError in case of error.

set_attribute(attribute_name: str, value)

This method writes the value to the given attribute.

:param

attribute_name: string. Name of the attribute

:param

value: The value to be set. For non SCALAR attributes, it may be any sequence of sequences.

:return

None

:throw

AttributeError in case of error.

subscribe_attribute(attr_name: str, callback_method: Callable)

Subscribes to the change event on the given attribute.

:param

attr_name: string. Name of the attribute to subscribe change event.

:param

callback_method: Name of callback method.

:return

int. event_id returned by the Tango device server.

unsubscribe_attribute(event_id: int)

Unsubscribes a client from receiving the event specified by event_id.

:param

event_id: int. Event id of the subscription

:return

None.