DeviceProxy

class tango.DeviceProxy

DeviceProxy is the high level Tango object which provides the client with an easy-to-use interface to TANGO devices. DeviceProxy provides interfaces to all TANGO Device interfaces.The DeviceProxy manages timeouts, stateless connections and reconnection if the device server is restarted. To create a DeviceProxy, a Tango Device name must be set in the object constructor.

Example :
dev = tango.DeviceProxy(“sys/tg_test/1”)

DeviceProxy(dev_name, green_mode=None, wait=True, timeout=True) -> DeviceProxy DeviceProxy(self, dev_name, need_check_acc, green_mode=None, wait=True, timeout=True) -> DeviceProxy

Creates a new DeviceProxy.

Parameters:
  • dev_name (str) – the device name or alias
  • need_check_acc (bool) – in first version of the function it defaults to True. Determines if at creation time of DeviceProxy it should check for channel access (rarely used)
  • green_mode (GreenMode) – determines the mode of execution of the device (including. the way it is created). Defaults to the current global green_mode (check get_green_mode() and set_green_mode())
  • wait (bool) – whether or not to wait for result. If green_mode Ignored when green_mode is Synchronous (always waits).
  • timeout (float) – The number of seconds to wait for the result. If None, then there is no limit on the wait time. Ignored when green_mode is Synchronous or wait is False.
Returns:

if green_mode is Synchronous or wait is True:

DeviceProxy

elif green_mode is Futures:

concurrent.futures.Future

elif green_mode is Gevent:

gevent.event.AsynchResult

Throws:
  • : class:~tango.DevFailed if green_mode is Synchronous or wait is True and there is an error creating the device.
  • : class:concurrent.futures.TimeoutError if green_mode is Futures, wait is False, timeout is not None and the time to create the device has expired.
  • : class:gevent.timeout.Timeout if green_mode is Gevent, wait is False, timeout is not None and the time to create the device has expired.

New in version 8.1.0: green_mode parameter. wait parameter. timeout parameter.

delete_property(self, value)

Delete a the given of properties for this device. This method accepts the following types as value parameter:

  1. string [in] - single property to be deleted
  2. tango.DbDatum [in] - single property data to be deleted
  3. tango.DbData [in] - several property data to be deleted
  4. sequence<string> [in]- several property data to be deleted
  5. sequence<DbDatum> [in] - several property data to be deleted
  6. dict<str, obj> [in] - keys are property names to be deleted (values are ignored)
  7. dict<str, DbDatum> [in] - several DbDatum.name are property names to be deleted (keys are ignored)
Parameters:
value:

can be one of the following:

  1. string [in] - single property data to be deleted
  2. tango.DbDatum [in] - single property data to be deleted
  3. tango.DbData [in] - several property data to be deleted
  4. sequence<string> [in]- several property data to be deleted
  5. sequence<DbDatum> [in] - several property data to be deleted
  6. dict<str, obj> [in] - keys are property names to be deleted (values are ignored)
  7. dict<str, DbDatum> [in] - several DbDatum.name are property names to be deleted (keys are ignored)
Return:

None

Throws:

ConnectionFailed, CommunicationFailed DevFailed from device (DB_SQLError)

get_attribute_config(self, name) → AttributeInfoEx
Return the attribute configuration for a single attribute.
Parameters:
name:(str) attribute name
Return:

(AttributeInfoEx) Object containing the attribute information

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

Deprecated: use get_attribute_config_ex instead

get_attribute_config( self, names) -> AttributeInfoList

Return the attribute configuration for the list of specified attributes. To get all the attributes pass a sequence containing the constant tango.:class:constants.AllAttr
Parameters:
names:(sequence<str>) attribute names
Return:

(AttributeInfoList) Object containing the attributes information

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

Deprecated: use get_attribute_config_ex instead

get_attribute_config_ex(self, name) → AttributeInfoListEx :
Return the extended attribute configuration for a single attribute.
Parameters:
name:(str) attribute name
Return:

(AttributeInfoEx) Object containing the attribute information

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

get_attribute_config( self, names) -> AttributeInfoListEx :

Return the extended attribute configuration for the list of specified attributes. To get all the attributes pass a sequence containing the constant tango.:class:constants.AllAttr
Parameters:
names:(sequence<str>) attribute names
Return:

(AttributeInfoList) Object containing the attributes information

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

get_command_config(self) → CommandInfoList
Return the command configuration for all commands.
Return:(CommandInfoList) Object containing the commands information
Throws:ConnectionFailed, CommunicationFailed, DevFailed from device

get_command_config( self, name) -> CommandInfo

Return the command configuration for a single command.
Parameters:
name:(str) command name
Return:

(CommandInfo) Object containing the command information

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

get_command_config( self, names) -> CommandInfoList

Return the command configuration for the list of specified commands.
Parameters:
names:(sequence<str>) command names
Return:

(CommandInfoList) Object containing the commands information

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

get_events(event_id, callback=None, extract_as=Numpy) → None

The method extracts all waiting events from the event reception buffer.

If callback is not None, it is executed for every event. During event subscription the client must have chosen the pull model for this event. The callback will receive a parameter of type EventData, AttrConfEventData or DataReadyEventData depending on the type of the event (event_type parameter of subscribe_event).

If callback is None, the method extracts all waiting events from the event reception buffer. The returned event_list is a vector of EventData, AttrConfEventData or DataReadyEventData pointers, just the same data the callback would have received.

Parameters:
event_id:(int) is the event identifier returned by the DeviceProxy.subscribe_event() method.
callback:(callable) Any callable object or any object with a “push_event” method.
extract_as:(ExtractAs)
Return:

None

Throws:

EventSystemFailed

See Also:

subscribe_event

New in PyTango 7.0.0

get_green_mode()

Returns the green mode in use by this DeviceProxy.

Returns:the green mode in use by this DeviceProxy.
Return type:GreenMode

New in PyTango 8.1.0

get_pipe_config(self) → PipeInfoList
Return the pipe configuration for all pipes.
Return:(PipeInfoList) Object containing the pipes information
Throws:ConnectionFailed, CommunicationFailed, DevFailed from device

get_pipe_config( self, name) -> PipeInfo

Return the pipe configuration for a single pipe.
Parameters:
name:(str) pipe name
Return:

(PipeInfo) Object containing the pipe information

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

get_pipe_config( self, names) -> PipeInfoList

Return the pipe configuration for the list of specified pipes. To get all the pipes pass a sequence containing the constant tango.:class:constants.AllPipe
Parameters:
names:(sequence<str>) pipe names
Return:

(PipeInfoList) Object containing the pipes information

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

New in PyTango 9.2.0

get_property(propname, value=None) → tango.DbData

Get a (list) property(ies) for a device.

This method accepts the following types as propname parameter: 1. string [in] - single property data to be fetched 2. sequence<string> [in] - several property data to be fetched 3. tango.DbDatum [in] - single property data to be fetched 4. tango.DbData [in,out] - several property data to be fetched. 5. sequence<DbDatum> - several property data to be feteched

Note: for cases 3, 4 and 5 the ‘value’ parameter if given, is IGNORED.

If value is given it must be a tango.DbData that will be filled with the property values

Parameters:
propname:(any) property(ies) name(s)
value:(DbData) (optional, default is None meaning that the method will create internally a tango.DbData and return it filled with the property values
Return:

(DbData) object containing the property(ies) value(s). If a tango.DbData is given as parameter, it returns the same object otherwise a new tango.DbData is returned

Throws:

NonDbDevice, ConnectionFailed (with database), CommunicationFailed (with database), DevFailed from database device

get_property_list(self, filter, array=None) → obj
Get the list of property names for the device. The parameter filter allows the user to filter the returned name list. The wildcard character is ‘*’. Only one wildcard character is allowed in the filter parameter.
Parameters:
filter[in]:(str) the filter wildcard
array[out]:(sequence obj or None) (optional, default is None) an array to be filled with the property names. If None a new list will be created internally with the values.
Return:

the given array filled with the property names (or a new list if array is None)

Throws:

NonDbDevice, WrongNameSyntax, ConnectionFailed (with database), CommunicationFailed (with database) DevFailed from database device

New in PyTango 7.0.0

ping(self) → int
A method which sends a ping to the device
Parameters:None
Return:(int) time elapsed in microseconds
Throws:exception if device is not alive
put_property(self, value) → None
Insert or update a list of properties for this device. This method accepts the following types as value parameter: 1. tango.DbDatum - single property data to be inserted 2. tango.DbData - several property data to be inserted 3. sequence<DbDatum> - several property data to be inserted 4. dict<str, DbDatum> - keys are property names and value has data to be inserted 5. dict<str, seq<str>> - keys are property names and value has data to be inserted 6. dict<str, obj> - keys are property names and str(obj) is property value
Parameters:
value:can be one of the following: 1. tango.DbDatum - single property data to be inserted 2. tango.DbData - several property data to be inserted 3. sequence<DbDatum> - several property data to be inserted 4. dict<str, DbDatum> - keys are property names and value has data to be inserted 5. dict<str, seq<str>> - keys are property names and value has data to be inserted 6. dict<str, obj> - keys are property names and str(obj) is property value
Return:

None

Throws:

ConnectionFailed, CommunicationFailed DevFailed from device (DB_SQLError)

read_attribute(self, attr_name, extract_as=ExtractAs.Numpy, green_mode=None, wait=True, timeout=None) → DeviceAttribute
Read a single attribute.
Parameters:
attr_name:(str) The name of the attribute to read.
extract_as:(ExtractAs) Defaults to numpy.
green_mode:(GreenMode) Defaults to the current DeviceProxy GreenMode. (see get_green_mode() and set_green_mode()).
wait:(bool) whether or not to wait for result. If green_mode is Synchronous, this parameter is ignored as it always waits for the result. Ignored when green_mode is Synchronous (always waits).
timeout:(float) The number of seconds to wait for the result. If None, then there is no limit on the wait time. Ignored when green_mode is Synchronous or wait is False.
Return:

(DeviceAttribute)

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device TimeoutError (green_mode == Futures) If the future didn’t finish executing before the given timeout. Timeout (green_mode == Gevent) If the async result didn’t finish executing before the given timeout.

Changed in version 7.1.4: For DevEncoded attributes, before it was returning a DeviceAttribute.value as a tuple (format<str>, data<str>) no matter what was the extract_as value was. Since 7.1.4, it returns a (format<str>, data<buffer>) unless extract_as is String, in which case it returns (format<str>, data<str>).

Changed in version 8.0.0: For DevEncoded attributes, now returns a DeviceAttribute.value as a tuple (format<str>, data<bytes>) unless extract_as is String, in which case it returns (format<str>, data<str>). Carefull, if using python >= 3 data<str> is decoded using default python utf-8 encoding. This means that PyTango assumes tango DS was written encapsulating string into utf-8 which is the default python encoding.

New in version 8.1.0: green_mode parameter. wait parameter. timeout parameter.

read_attribute_asynch(self, attr_name) → int

read_attribute_asynch ( self, attr_name, callback) -> None

Shortcut to self.read_attributes_asynch([attr_name], cb)

New in PyTango 7.0.0

read_attribute_reply(self, id, extract_as) → int

read_attribute_reply ( self, id, timeout, extract_as) -> None

Shortcut to self.read_attributes_reply()[0]

New in PyTango 7.0.0

read_attributes(self, attr_names, extract_as=ExtractAs.Numpy, green_mode=None, wait=True, timeout=None) → sequence<DeviceAttribute>
Read the list of specified attributes.
Parameters:
attr_names:(sequence<str>) A list of attributes to read.
extract_as:(ExtractAs) Defaults to numpy.
green_mode:(GreenMode) Defaults to the current DeviceProxy GreenMode. (see get_green_mode() and set_green_mode()).
wait:(bool) whether or not to wait for result. If green_mode is Synchronous, this parameter is ignored as it always waits for the result. Ignored when green_mode is Synchronous (always waits).
timeout:(float) The number of seconds to wait for the result. If None, then there is no limit on the wait time. Ignored when green_mode is Synchronous or wait is False.
Return:

(sequence<DeviceAttribute>)

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device TimeoutError (green_mode == Futures) If the future didn’t finish executing before the given timeout. Timeout (green_mode == Gevent) If the async result didn’t finish executing before the given timeout.

New in version 8.1.0: green_mode parameter. wait parameter. timeout parameter.

read_attributes_asynch(self, attr_names) → int
Read asynchronously (polling model) the list of specified attributes.
Parameters:
attr_names:(sequence<str>) A list of attributes to read. It should be a StdStringVector or a sequence of str.
Return:

an asynchronous call identifier which is needed to get attributes value.

Throws:

ConnectionFailed

New in PyTango 7.0.0

read_attributes_asynch ( self, attr_names, callback, extract_as=Numpy) -> None

Read asynchronously (push model) an attribute list.
Parameters:
attr_names:(sequence<str>) A list of attributes to read. See read_attributes.
callback:(callable) This callback object should be an instance of a user class with an attr_read() method. It can also be any callable object.
extract_as:(ExtractAs) Defaults to numpy.
Return:

None

Throws:

ConnectionFailed

New in PyTango 7.0.0

Important

by default, TANGO is initialized with the polling model. If you want to use the push model (the one with the callback parameter), you need to change the global TANGO model to PUSH_CALLBACK. You can do this with the tango.ApiUtil.set_asynch_cb_sub_model()

read_pipe(self, pipe_name, extract_as=ExtractAs.Numpy, green_mode=None, wait=True, timeout=None) → tuple

Read a single pipe. The result is a blob: a tuple with two elements: blob name (string) and blob data (sequence). The blob data consists of a sequence where each element is a dictionary with the following keys:

  • name: blob element name
  • dtype: tango data type
  • value: blob element data (str for DevString, etc)

In case dtype is DevPipeBlob, value is again a blob.

Parameters:
pipe_name:(str) The name of the pipe to read.
extract_as:(ExtractAs) Defaults to numpy.
green_mode:(GreenMode) Defaults to the current DeviceProxy GreenMode. (see get_green_mode() and set_green_mode()).
wait:(bool) whether or not to wait for result. If green_mode is Synchronous, this parameter is ignored as it always waits for the result. Ignored when green_mode is Synchronous (always waits).
timeout:(float) The number of seconds to wait for the result. If None, then there is no limit on the wait time. Ignored when green_mode is Synchronous or wait is False.
Return:

tuple<str, sequence>

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device TimeoutError (green_mode == Futures) If the future didn’t finish executing before the given timeout. Timeout (green_mode == Gevent) If the async result didn’t finish executing before the given timeout.

New in PyTango 9.2.0

set_attribute_config(self, attr_info) → None
Change the attribute configuration for the specified attribute
Parameters:
attr_info:(AttributeInfo) attribute information
Return:

None

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

set_attribute_config( self, attr_info_ex) -> None

Change the extended attribute configuration for the specified attribute
Parameters:
attr_info_ex:(AttributeInfoEx) extended attribute information
Return:

None

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

set_attribute_config( self, attr_info) -> None

Change the attributes configuration for the specified attributes
Parameters:
attr_info:(sequence<AttributeInfo>) attributes information
Return:

None

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

set_attribute_config( self, attr_info_ex) -> None

Change the extended attributes configuration for the specified attributes
Parameters:
attr_info_ex:(sequence<AttributeInfoListEx>) extended attributes information
Return:

None

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

set_green_mode(green_mode=None)

Sets the green mode to be used by this DeviceProxy Setting it to None means use the global PyTango green mode (see tango.get_green_mode()).

Parameters:green_mode (GreenMode) – the new green mode

New in PyTango 8.1.0

set_pipe_config(self, pipe_info) → None
Change the pipe configuration for the specified pipe
Parameters:
pipe_info:(PipeInfo) pipe information
Return:

None

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

set_pipe_config( self, pipe_info) -> None

Change the pipes configuration for the specified pipes
Parameters:
pipe_info:(sequence<PipeInfo>) pipes information
Return:

None

Throws:

ConnectionFailed, CommunicationFailed, DevFailed from device

state(self) → DevState
A method which returns the state of the device.
Parameters:

None

Return:

(DevState) constant

Example:
dev_st = dev.state()
if dev_st == DevState.ON : ...
status(self) → str
A method which returns the status of the device as a string.
Parameters:None
Return:(str) describing the device status
subscribe_event(self, attr_name, event, callback, filters=[], stateless=False, extract_as=Numpy) → int
The client call to subscribe for event reception in the push model. The client implements a callback method which is triggered when the event is received. Filtering is done based on the reason specified and the event type. For example when reading the state and the reason specified is “change” the event will be fired only when the state changes. Events consist of an attribute name and the event reason. A standard set of reasons are implemented by the system, additional device specific reasons can be implemented by device servers programmers.
Parameters:
attr_name:(str) The device attribute name which will be sent as an event e.g. “current”.
event_type:(EventType) Is the event reason and must be on the enumerated values: * EventType.CHANGE_EVENT * EventType.PERIODIC_EVENT * EventType.ARCHIVE_EVENT * EventType.ATTR_CONF_EVENT * EventType.DATA_READY_EVENT * EventType.USER_EVENT
callback:(callable) Is any callable object or an object with a callable “push_event” method.
filters:(sequence<str>) A variable list of name,value pairs which define additional filters for events.
stateless:(bool) When the this flag is set to false, an exception will be thrown when the event subscription encounters a problem. With the stateless flag set to true, the event subscription will always succeed, even if the corresponding device server is not running. The keep alive thread will try every 10 seconds to subscribe for the specified event. At every subscription retry, a callback is executed which contains the corresponding exception
extract_as:(ExtractAs)
Return:

An event id which has to be specified when unsubscribing from this event.

Throws:

EventSystemFailed

subscribe_event(self, attr_name, event, queuesize, filters=[], stateless=False ) -> int

The client call to subscribe for event reception in the pull model. Instead of a callback method the client has to specify the size of the event reception buffer. The event reception buffer is implemented as a round robin buffer. This way the client can set-up different ways to receive events:

  • Event reception buffer size = 1 : The client is interested only in the value of the last event received. All other events that have been received since the last reading are discarded.
  • Event reception buffer size > 1 : The client has chosen to keep an event history of a given size. When more events arrive since the last reading, older events will be discarded.
  • Event reception buffer size = ALL_EVENTS : The client buffers all received events. The buffer size is unlimited and only restricted by the available memory for the client.

All other parameters are similar to the descriptions given in the other subscribe_event() version.

unsubscribe_event(self, event_id) → None
Unsubscribes a client from receiving the event specified by event_id.
Parameters:
event_id:(int) is the event identifier returned by the DeviceProxy::subscribe_event(). Unlike in TangoC++ we chech that the event_id has been subscribed in this DeviceProxy.
Return:

None

Throws:

EventSystemFailed

write_attribute(self, attr_name, value, green_mode=None, wait=True, timeout=None) → None

write_attribute (self, attr_info, value, green_mode=None, wait=True, timeout=None) -> None

Write a single attribute.
Parameters:
attr_name:(str) The name of the attribute to write.
attr_info:(AttributeInfo)
value:The value. For non SCALAR attributes it may be any sequence of sequences.
green_mode:(GreenMode) Defaults to the current DeviceProxy GreenMode. (see get_green_mode() and set_green_mode()).
wait:(bool) whether or not to wait for result. If green_mode is Synchronous, this parameter is ignored as it always waits for the result. Ignored when green_mode is Synchronous (always waits).
timeout:(float) The number of seconds to wait for the result. If None, then there is no limit on the wait time. Ignored when green_mode is Synchronous or wait is False.
Throws:

ConnectionFailed, CommunicationFailed, DeviceUnlocked, DevFailed from device TimeoutError (green_mode == Futures) If the future didn’t finish executing before the given timeout. Timeout (green_mode == Gevent) If the async result didn’t finish executing before the given timeout.

New in version 8.1.0: green_mode parameter. wait parameter. timeout parameter.

write_attribute_asynch(attr_name, value, cb=None)

write_attributes_asynch( self, values) -> int write_attributes_asynch( self, values, callback) -> None

Shortcut to self.write_attributes_asynch([attr_name, value], cb)

New in PyTango 7.0.0

write_attribute_reply(self, id) → None
Check if the answer of an asynchronous write_attribute is arrived (polling model). If the reply is arrived and if it is a valid reply, the call returned. If the reply is an exception, it is re-thrown by this call. An exception is also thrown in case of the reply is not yet arrived.
Parameters:
id:(int) the asynchronous call identifier.
Return:

None

Throws:

AsynCall, AsynReplyNotArrived, CommunicationFailed, DevFailed from device.

New in PyTango 7.0.0

write_attribute_reply (self, id, timeout) -> None

Check if the answer of an asynchronous write_attribute is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, the call returned. If the reply is an exception, it is re-thrown by this call. If the reply is not yet arrived, the call will wait (blocking the process) for the time specified in timeout. If after timeout milliseconds, the reply is still not there, an exception is thrown. If timeout is set to 0, the call waits until the reply arrived.
Parameters:
id:(int) the asynchronous call identifier.
timeout:(int) the timeout
Return:

None

Throws:

AsynCall, AsynReplyNotArrived, CommunicationFailed, DevFailed from device.

New in PyTango 7.0.0

write_attributes(self, name_val, green_mode=None, wait=True, timeout=None) → None
Write the specified attributes.
Parameters:
name_val:A list of pairs (attr_name, value). See write_attribute
green_mode:(GreenMode) Defaults to the current DeviceProxy GreenMode. (see get_green_mode() and set_green_mode()).
wait:(bool) whether or not to wait for result. If green_mode is Synchronous, this parameter is ignored as it always waits for the result. Ignored when green_mode is Synchronous (always waits).
timeout:(float) The number of seconds to wait for the result. If None, then there is no limit on the wait time. Ignored when green_mode is Synchronous or wait is False.
Throws:

ConnectionFailed, CommunicationFailed, DeviceUnlocked, DevFailed or NamedDevFailedList from device TimeoutError (green_mode == Futures) If the future didn’t finish executing before the given timeout. Timeout (green_mode == Gevent) If the async result didn’t finish executing before the given timeout.

New in version 8.1.0: green_mode parameter. wait parameter. timeout parameter.

write_attributes_asynch(self, values) → int
Write asynchronously (polling model) the specified attributes.
Parameters:
values:(any) See write_attributes.
Return:

An asynchronous call identifier which is needed to get the server reply

Throws:

ConnectionFailed

New in PyTango 7.0.0

write_attributes_asynch ( self, values, callback) -> None

Write asynchronously (callback model) a single attribute.
Parameters:
values:(any) See write_attributes.
callback:(callable) This callback object should be an instance of a user class with an attr_written() method . It can also be any callable object.
Return:

None

Throws:

ConnectionFailed

New in PyTango 7.0.0

Important

by default, TANGO is initialized with the polling model. If you want to use the push model (the one with the callback parameter), you need to change the global TANGO model to PUSH_CALLBACK. You can do this with the tango.ApiUtil.set_asynch_cb_sub_model()

write_pipe(*args, **kwargs)

TODO

write_read_attribute(self, attr_name, value, extract_as=ExtractAs.Numpy, green_mode=None, wait=True, timeout=None) → DeviceAttribute
Write then read a single attribute in a single network call. By default (serialisation by device), the execution of this call in the server can’t be interrupted by other clients.
Parameters:see write_attribute(attr_name, value)
Return:A tango.DeviceAttribute object.
Throws:ConnectionFailed, CommunicationFailed, DeviceUnlocked, DevFailed from device, WrongData TimeoutError (green_mode == Futures) If the future didn’t finish executing before the given timeout. Timeout (green_mode == Gevent) If the async result didn’t finish executing before the given timeout.

New in PyTango 7.0.0

New in version 8.1.0: green_mode parameter. wait parameter. timeout parameter.

write_read_attributes(self, name_val, attr_names, extract_as=ExtractAs.Numpy, green_mode=None, wait=True, timeout=None) → DeviceAttribute
Write then read attribute(s) in a single network call. By default (serialisation by device), the execution of this call in the server can’t be interrupted by other clients. On the server side, attribute(s) are first written and if no exception has been thrown during the write phase, attributes will be read.
Parameters:
name_val:A list of pairs (attr_name, value). See write_attribute
attr_names:(sequence<str>) A list of attributes to read.
extract_as:(ExtractAs) Defaults to numpy.
green_mode:(GreenMode) Defaults to the current DeviceProxy GreenMode. (see get_green_mode() and set_green_mode()).
wait:(bool) whether or not to wait for result. If green_mode is Synchronous, this parameter is ignored as it always waits for the result. Ignored when green_mode is Synchronous (always waits).
timeout:(float) The number of seconds to wait for the result. If None, then there is no limit on the wait time. Ignored when green_mode is Synchronous or wait is False.
Return:

(sequence<DeviceAttribute>)

Throws:

ConnectionFailed, CommunicationFailed, DeviceUnlocked, DevFailed from device, WrongData TimeoutError (green_mode == Futures) If the future didn’t finish executing before the given timeout. Timeout (green_mode == Gevent) If the async result didn’t finish executing before the given timeout.

New in PyTango 9.2.0