TMC Common TangoClient

Tango Client Code

class tmc.common.tango_client.TangoClient(fqdn, logger=None)

Class for TangoClient API

get_device_fqdn()

Returns the Fully Qualified Device Name (FQDN) of the Tango device server.

send_command(command_name, command_data=None)

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

Params

command_name: string. Name of the command

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

Returns

The result of the command. The type depends on the command. It may be None.

Throws

DevFailed in case of error.

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

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

Params

command_name: string. Name of the command

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

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)

This method reads the value of the given attribute.

Param

attribute_name: string. Name of the attribute

Returns

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, value)

This method writes the value to the given attribute.

Params

attribute_name: string. Name of the attribute

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

Returns

None

Throws

AttributeError in case of error.

subscribe_attribute(attr_name, callback_method)

Subscribes to the change event on the given attribute.

Params

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

callback_method: Name of callback method.

Returns

int. event_id returned by the Tango device server.

unsubscribe_attribute(event_id)

Unsubscribes a client from receiving the event specified by event_id.

Param

event_id: int. Event id of the subscription

Returns

None.