Attribute classes

Attr

class tango.Attr

This class represents a Tango writable attribute.

get_assoc(self)str

Get the associated name.

Parameters

None

Return

(bool) the associated name

get_cl_name(self)str

Returns the class name

Parameters

None

Return

(str) the class name

New in PyTango 7.2.0

get_class_properties(self) → sequence<AttrProperty>

Get the class level attribute properties

Parameters

None

Return

(sequence<AttrProperty>) the class attribute properties

get_disp_level(self) → DispLevel

Get the attribute display level

Parameters

None

Return

(DispLevel) the attribute display level

get_format(self) → AttrDataFormat

Get the attribute format

Parameters

None

Return

(AttrDataFormat) the attribute format

get_memorized(self)bool

Determine if the attribute is memorized or not.

Parameters

None

Return

(bool) True if the attribute is memorized

get_memorized_init(self)bool

Determine if the attribute is written at startup from the memorized value if it is memorized

Parameters

None

Return

(bool) True if initialized with memorized value or not

get_name(self)str

Get the attribute name.

Parameters

None

Return

(str) the attribute name

get_polling_period(self)int

Get the polling period (mS)

Parameters

None

Return

(int) the polling period (mS)

get_type(self)int

Get the attribute data type

Parameters

None

Return

(int) the attribute data type

get_user_default_properties(self) → sequence<AttrProperty>

Get the user default attribute properties

Parameters

None

Return

(sequence<AttrProperty>) the user default attribute properties

get_writable(self) → AttrWriteType

Get the attribute write type

Parameters

None

Return

(AttrWriteType) the attribute write type

is_archive_event(self)bool

Check if the archive event is fired manually for this attribute.

Parameters

None

Return

(bool) true if a manual fire archive event is implemented.

is_assoc(self)bool

Determine if it is assoc.

Parameters

None

Return

(bool) if it is assoc

is_change_event(self)bool

Check if the change event is fired manually for this attribute.

Parameters

None

Return

(bool) true if a manual fire change event is implemented.

is_check_archive_criteria(self)bool

Check if the archive event criteria should be checked when firing the event manually.

Parameters

None

Return

(bool) true if a archive event criteria will be checked.

is_check_change_criteria(self)bool

Check if the change event criteria should be checked when firing the event manually.

Parameters

None

Return

(bool) true if a change event criteria will be checked.

is_data_ready_event(self)bool

Check if the data ready event is fired for this attribute.

Parameters

None

Return

(bool) true if firing data ready event is implemented.

New in PyTango 7.2.0

set_archive_event(self)None

Set a flag to indicate that the server fires archive events manually without the polling to be started for the attribute If the detect parameter is set to true, the criteria specified for the archive event are verified and the event is only pushed if they are fullfilled.

If detect is set to false the event is fired without checking!

Parameters
implemented

(bool) True when the server fires change events manually.

detect

(bool) Triggers the verification of the archive event properties when set to true.

Return

None

set_change_event(self, implemented, detect)None

Set a flag to indicate that the server fires change events manually without the polling to be started for the attribute. If the detect parameter is set to true, the criteria specified for the change event are verified and the event is only pushed if they are fullfilled.

If detect is set to false the event is fired without checking!

Parameters
implemented

(bool) True when the server fires change events manually.

detect

(bool) Triggers the verification of the change event properties when set to true.

Return

None

set_cl_name(self, cl)None

Sets the class name

Parameters
cl

(str) new class name

Return

None

New in PyTango 7.2.0

set_class_properties(self, props)None

Set the class level attribute properties

Parameters
props

(StdAttrPropertyVector) new class level attribute properties

Return

None

set_data_ready_event(self, implemented)None

Set a flag to indicate that the server fires data ready events.

Parameters
implemented

(bool) True when the server fires data ready events

Return

None

New in PyTango 7.2.0

set_default_properties(self)None

Set default attribute properties.

Parameters
attr_prop

(UserDefaultAttrProp) the user default property class

Return

None

set_disp_level(self, disp_lelel)None

Set the attribute display level.

Parameters
disp_level

(DispLevel) the new display level

Return

None

set_memorized(self)None

Set the attribute as memorized in database (only for scalar and writable attribute) With no argument the setpoint will be written to the attribute during initialisation!

Parameters

None

Return

None

set_memorized_init(self, write_on_init)None

Set the initialisation flag for memorized attributes true = the setpoint value will be written to the attribute on initialisation false = only the attribute setpoint is initialised. No action is taken on the attribute

Parameters
write_on_init

(bool) if true the setpoint value will be written to the attribute on initialisation

Return

None

set_polling_period(self, period)None

Set the attribute polling update period.

Parameters
period

(int) the attribute polling period (in mS)

Return

None

Attribute

class tango.Attribute

This class represents a Tango attribute.

check_alarm(self)bool

Check if the attribute read value is below/above the alarm level.

Parameters

None

Return

(bool) true if the attribute is in alarm condition.

Throws

DevFailed If no alarm level is defined.

get_assoc_ind(self)int

Get index of the associated writable attribute.

Parameters

None

Return

(int) the index in the main attribute vector of the associated writable attribute

get_assoc_name(self)str

Get name of the associated writable attribute.

Parameters

None

Return

(str) the associated writable attribute name

get_attr_serial_model(self) → AttrSerialModel

Get attribute serialization model.

Parameters

None

Return

(AttrSerialModel) The attribute serialization model

New in PyTango 7.1.0

get_data_format(self) → AttrDataFormat

Get attribute data format.

Parameters

None

Return

(AttrDataFormat) the attribute data format

get_data_size(self)None

Get attribute data size.

Parameters

None

Return

(int) the attribute data size

get_data_type(self)int

Get attribute data type.

Parameters

None

Return

(int) the attribute data type

get_date(self) → TimeVal

Get a COPY of the attribute date.

Parameters

None

Return

(TimeVal) the attribute date

get_label(self)str

Get attribute label property.

Parameters

None

Return

(str) he attribute label

get_max_dim_x(self)int

Get attribute maximum data size in x dimension.

Parameters

None

Return

(int) the attribute maximum data size in x dimension. Set to 1 for scalar attribute

get_max_dim_y(self)int

Get attribute maximum data size in y dimension.

Parameters

None

Return

(int) the attribute maximum data size in y dimension. Set to 0 for scalar attribute

get_name(self)str

Get attribute name.

Parameters

None

Return

(str) The attribute name

get_polling_period(self)int

Get attribute polling period.

Parameters

None

Return

(int) The attribute polling period in mS. Set to 0 when the attribute is not polled

get_properties(self, attr_cfg=None) → AttributeConfig

Get attribute properties.

Parameters
conf

the config object to be filled with the attribute configuration. Default is None meaning the method will create internally a new AttributeConfig_5 and return it. Can be AttributeConfig, AttributeConfig_2, AttributeConfig_3, AttributeConfig_5 or MultiAttrProp

Return

(AttributeConfig) the config object filled with attribute configuration information

New in PyTango 7.1.4

get_quality(self) → AttrQuality

Get a COPY of the attribute data quality.

Parameters

None

Return

(AttrQuality) the attribute data quality

get_writable(self) → AttrWriteType

Get the attribute writable type (RO/WO/RW).

Parameters

None

Return

(AttrWriteType) The attribute write type.

get_x(self)int

Get attribute data size in x dimension.

Parameters

None

Return

(int) the attribute data size in x dimension. Set to 1 for scalar attribute

get_y(self)int

Get attribute data size in y dimension.

Parameters

None

Return

(int) the attribute data size in y dimension. Set to 1 for scalar attribute

is_archive_event(self)bool

Check if the archive event is fired manually (without polling) for this attribute.

Parameters

None

Return

(bool) True if a manual fire archive event is implemented.

New in PyTango 7.1.0

is_change_event(self)bool

Check if the change event is fired manually (without polling) for this attribute.

Parameters

None

Return

(bool) True if a manual fire change event is implemented.

New in PyTango 7.1.0

is_check_archive_criteria(self)bool

Check if the archive event criteria should be checked when firing the event manually.

Parameters

None

Return

(bool) True if a archive event criteria will be checked.

New in PyTango 7.1.0

is_check_change_criteria(self)bool

Check if the change event criteria should be checked when firing the event manually.

Parameters

None

Return

(bool) True if a change event criteria will be checked.

New in PyTango 7.1.0

is_data_ready_event(self)bool

Check if the data ready event is fired manually (without polling) for this attribute.

Parameters

None

Return

(bool) True if a manual fire data ready event is implemented.

New in PyTango 7.2.0

is_max_alarm(self)bool

Check if the attribute is in maximum alarm condition.

Parameters

None

Return

(bool) true if the attribute is in alarm condition (read value above the max. alarm).

is_max_warning(self)bool

Check if the attribute is in maximum warning condition.

Parameters

None

Return

(bool) true if the attribute is in warning condition (read value above the max. warning).

is_min_alarm(self)bool

Check if the attribute is in minimum alarm condition.

Parameters

None

Return

(bool) true if the attribute is in alarm condition (read value below the min. alarm).

is_min_warning(self)bool

Check if the attribute is in minimum warning condition.

Parameters

None

Return

(bool) true if the attribute is in warning condition (read value below the min. warning).

is_polled(self)bool

Check if the attribute is polled.

Parameters

None

Return

(bool) true if the attribute is polled.

is_rds_alarm(self)bool

Check if the attribute is in RDS alarm condition.

Parameters

None

Return

(bool) true if the attribute is in RDS condition (Read Different than Set).

is_write_associated(self)bool

Check if the attribute has an associated writable attribute.

Parameters

None

Return

(bool) True if there is an associated writable attribute

remove_configuration(self)None

Remove the attribute configuration from the database. This method can be used to clean-up all the configuration of an attribute to come back to its default values or the remove all configuration of a dynamic attribute before deleting it.

The method removes all configured attribute properties and removes the attribute from the list of polled attributes.

Parameters

None

Return

None

New in PyTango 7.1.0

set_archive_event(self, implemented, detect=True)None

Set a flag to indicate that the server fires archive events manually, without the polling to be started for the attribute If the detect parameter is set to true, the criteria specified for the archive event are verified and the event is only pushed if they are fullfilled.

Parameters
implemented

(bool) True when the server fires archive events manually.

detect

(bool) (optional, default is True) Triggers the verification of the archive event properties when set to true.

Return

None

New in PyTango 7.1.0

set_assoc_ind(self, index)None

Set index of the associated writable attribute.

Parameters
index

(int) The new index in the main attribute vector of the associated writable attribute

Return

None

set_attr_serial_model(self, ser_model) → void

Set attribute serialization model. This method allows the user to choose the attribute serialization model.

Parameters
ser_model

(AttrSerialModel) The new serialisation model. The serialization model must be one of ATTR_BY_KERNEL, ATTR_BY_USER or ATTR_NO_SYNC

Return

None

New in PyTango 7.1.0

set_change_event(self, implemented, detect=True)None

Set a flag to indicate that the server fires change events manually, without the polling to be started for the attribute. If the detect parameter is set to true, the criteria specified for the change event are verified and the event is only pushed if they are fullfilled. If detect is set to false the event is fired without any value checking!

Parameters
implemented

(bool) True when the server fires change events manually.

detect

(bool) (optional, default is True) Triggers the verification of the change event properties when set to true.

Return

None

New in PyTango 7.1.0

set_data_ready_event(self, implemented)None

Set a flag to indicate that the server fires data ready events.

Parameters
implemented

(bool) True when the server fires data ready events manually.

Return

None

New in PyTango 7.2.0

set_date(self, new_date)None

Set attribute date.

Parameters
new_date

(TimeVal) the attribute date

Return

None

set_properties(self, attr_cfg, dev)None

Set attribute properties.

This method sets the attribute properties value with the content of the fileds in the AttributeConfig/ AttributeConfig_3 object

Parameters
conf

(AttributeConfig or AttributeConfig_3) the config object.

dev

(DeviceImpl) the device (not used, maintained for backward compatibility)

New in PyTango 7.1.4

set_quality(self, quality, send_event=False)None

Set attribute data quality.

Parameters
quality

(AttrQuality) the new attribute data quality

send_event

(bool) true if a change event should be sent. Default is false.

Return

None

set_value(self, data, dim_x=1, dim_y=0) → None <= DEPRECATED

set_value (self, data) -> None

set_value (self, str_data, data) -> None

Set internal attribute value. This method stores the attribute read value inside the object. This method also stores the date when it is called and initializes the attribute quality factor.

Parameters
data

the data to be set. Data must be compatible with the attribute type and format. In the DEPRECATED form for SPECTRUM and IMAGE attributes, data can be any type of FLAT sequence of elements compatible with the attribute type. In the new form (without dim_x or dim_y) data should be any sequence for SPECTRUM and a SEQUENCE of equal-length SEQUENCES for IMAGE attributes. The recommended sequence is a C continuous and aligned numpy array, as it can be optimized.

str_data

(str) special variation for DevEncoded data type. In this case ‘data’ must be a str or an object with the buffer interface.

dim_x

(int) [DEPRECATED] the attribute x length. Default value is 1

dim_y

(int) [DEPRECATED] the attribute y length. Default value is 0

Return

None

set_value_date_quality(self, data, time_stamp, quality, dim_x=1, dim_y=0) → None <= DEPRECATED

set_value_date_quality (self, data, time_stamp, quality) -> None

set_value_date_quality (self, str_data, data, time_stamp, quality) -> None

Set internal attribute value, date and quality factor. This method stores the attribute read value, the date and the attribute quality factor inside the object.

Parameters
data

the data to be set. Data must be compatible with the attribute type and format. In the DEPRECATED form for SPECTRUM and IMAGE attributes, data can be any type of FLAT sequence of elements compatible with the attribute type. In the new form (without dim_x or dim_y) data should be any sequence for SPECTRUM and a SEQUENCE of equal-length SEQUENCES for IMAGE attributes. The recommended sequence is a C continuous and aligned numpy array, as it can be optimized.

str_data

(str) special variation for DevEncoded data type. In this case ‘data’ must be a str or an object with the buffer interface.

dim_x

(int) [DEPRECATED] the attribute x length. Default value is 1

dim_y

(int) [DEPRECATED] the attribute y length. Default value is 0

time_stamp

(double) the time stamp

quality

(AttrQuality) the attribute quality factor

Return

None

WAttribute

class tango.WAttribute

This class represents a Tango writable attribute.

get_max_value(self) → obj

Get attribute maximum value or throws an exception if the attribute does not have a maximum value.

Parameters

None

Return

(obj) an object with the python maximum value

get_min_value(self) → obj

Get attribute minimum value or throws an exception if the attribute does not have a minimum value.

Parameters

None

Return

(obj) an object with the python minimum value

get_write_value(self, lst) → None <= DEPRECATED

get_write_value (self, extract_as=ExtractAs.Numpy) -> obj

Retrieve the new value for writable attribute.

Parameters
extract_as

(ExtractAs)

lst

[out] (list) a list object that will be filled with the attribute write value (DEPRECATED)

Return

(obj) the attribute write value.

get_write_value_length(self)int

Retrieve the new value length (data number) for writable attribute.

Parameters

None

Return

(int) the new value data length

is_max_value(self)bool

Check if the attribute has a maximum value.

Parameters

None

Return

(bool) true if the attribute has a maximum value defined

is_min_value(self)bool

Check if the attribute has a minimum value.

Parameters

None

Return

(bool) true if the attribute has a minimum value defined

set_max_value(self, data)None

Set attribute maximum value.

Parameters
data

the attribute maximum value. python data type must be compatible with the attribute data format and type.

Return

None

set_min_value(self, data)None

Set attribute minimum value.

Parameters
data

the attribute minimum value. python data type must be compatible with the attribute data format and type.

Return

None

MultiAttribute

class tango.MultiAttribute

There is one instance of this class for each device. This class is mainly an aggregate of Attribute or WAttribute objects. It eases management of multiple attributes

check_alarm(self)bool

check_alarm (self, attr_name) -> bool

check_alarm (self, ind) -> bool

  • The 1st version of the method checks alarm on all attribute(s) with an alarm defined.

  • The 2nd version of the method checks alarm for one attribute with a given name.

  • The 3rd version of the method checks alarm for one attribute from its index in the main attributes vector.

Parameters
attr_name

(str) attribute name

ind

(int) the attribute index

Return

(bool) True if at least one attribute is in alarm condition

Throws

DevFailed If at least one attribute does not have any alarm level defined

New in PyTango 7.0.0

get_attr_by_ind(self, ind) → Attribute

Get Attribute object from its index. This method returns an Attribute object from the index in the main attribute vector.

Parameters
ind

(int) the attribute index

Return

(Attribute) the attribute object

get_attr_by_name(self, attr_name) → Attribute

Get Attribute object from its name. This method returns an Attribute object with a name passed as parameter. The equality on attribute name is case independant.

Parameters
attr_name

(str) attribute name

Return

(Attribute) the attribute object

Throws

DevFailed If the attribute is not defined.

get_attr_ind_by_name(self, attr_name)int

Get Attribute index into the main attribute vector from its name. This method returns the index in the Attribute vector (stored in the MultiAttribute object) of an attribute with a given name. The name equality is case independant.

Parameters
attr_name

(str) attribute name

Return

(int) the attribute index

Throws

DevFailed If the attribute is not found in the vector.

New in PyTango 7.0.0

get_attr_nb(self)int

Get attribute number.

Parameters

None

Return

(int) the number of attributes

New in PyTango 7.0.0

get_attribute_list(self) → seq<Attribute>

Get the list of attribute objects.

Return

(seq) list of attribute objects

New in PyTango 7.2.1

get_w_attr_by_ind(self, ind) → WAttribute

Get a writable attribute object from its index. This method returns an WAttribute object from the index in the main attribute vector.

Parameters
ind

(int) the attribute index

Return

(WAttribute) the attribute object

get_w_attr_by_name(self, attr_name) → WAttribute

Get a writable attribute object from its name. This method returns an WAttribute object with a name passed as parameter. The equality on attribute name is case independant.

Parameters
attr_name

(str) attribute name

Return

(WAttribute) the attribute object

Throws

DevFailed If the attribute is not defined.

read_alarm(self, status)None

Add alarm message to device status. This method add alarm mesage to the string passed as parameter. A message is added for each attribute which is in alarm condition

Parameters
status

(str) a string (should be the device status)

Return

None

New in PyTango 7.0.0

UserDefaultAttrProp

class tango.UserDefaultAttrProp

User class to set attribute default properties. This class is used to set attribute default properties. Three levels of attributes properties setting are implemented within Tango. The highest property setting level is the database. Then the user default (set using this UserDefaultAttrProp class) and finally a Tango library default value

set_abs_change(self, def_abs_change) → None <= DEPRECATED

Set default change event abs_change property.

Parameters
def_abs_change

(str) the user default change event abs_change property

Return

None

Deprecated since PyTango 8.0. Please use set_event_abs_change instead.

set_archive_abs_change(self, def_archive_abs_change) → None <= DEPRECATED

Set default archive event abs_change property.

Parameters
def_archive_abs_change

(str) the user default archive event abs_change property

Return

None

Deprecated since PyTango 8.0. Please use set_archive_event_abs_change instead.

set_archive_event_abs_change(self, def_archive_abs_change)None

Set default archive event abs_change property.

Parameters
def_archive_abs_change

(str) the user default archive event abs_change property

Return

None

New in PyTango 8.0

set_archive_event_period(self, def_archive_period)None

Set default archive event period property.

Parameters
def_archive_period

(str) t

Return

None

New in PyTango 8.0

set_archive_event_rel_change(self, def_archive_rel_change)None

Set default archive event rel_change property.

Parameters
def_archive_rel_change

(str) the user default archive event rel_change property

Return

None

New in PyTango 8.0

set_archive_period(self, def_archive_period) → None <= DEPRECATED

Set default archive event period property.

Parameters
def_archive_period

(str) t

Return

None

Deprecated since PyTango 8.0. Please use set_archive_event_period instead.

set_archive_rel_change(self, def_archive_rel_change) → None <= DEPRECATED

Set default archive event rel_change property.

Parameters
def_archive_rel_change

(str) the user default archive event rel_change property

Return

None

Deprecated since PyTango 8.0. Please use set_archive_event_rel_change instead.

set_delta_t(self, def_delta_t)None

Set default RDS alarm delta_t property.

Parameters
def_delta_t

(str) the user default RDS alarm delta_t property

Return

None

set_delta_val(self, def_delta_val)None

Set default RDS alarm delta_val property.

Parameters
def_delta_val

(str) the user default RDS alarm delta_val property

Return

None

set_description(self, def_description)None

Set default description property.

Parameters
def_description

(str) the user default description property

Return

None

set_display_unit(self, def_display_unit)None

Set default display unit property.

Parameters
def_display_unit

(str) the user default display unit property

Return

None

set_enum_labels(self, enum_labels)None

Set default enumeration labels.

Parameters
enum_labels

(seq) list of enumeration labels

New in PyTango 9.2.0

set_event_abs_change(self, def_abs_change)None

Set default change event abs_change property.

Parameters
def_abs_change

(str) the user default change event abs_change property

Return

None

New in PyTango 8.0

set_event_period(self, def_period)None

Set default periodic event period property.

Parameters
def_period

(str) the user default periodic event period property

Return

None

New in PyTango 8.0

set_event_rel_change(self, def_rel_change)None

Set default change event rel_change property.

Parameters
def_rel_change

(str) the user default change event rel_change property

Return

None

New in PyTango 8.0

set_format(self, def_format)None

Set default format property.

Parameters
def_format

(str) the user default format property

Return

None

set_label(self, def_label)None

Set default label property.

Parameters
def_label

(str) the user default label property

Return

None

set_max_alarm(self, def_max_alarm)None

Set default max_alarm property.

Parameters
def_max_alarm

(str) the user default max_alarm property

Return

None

set_max_value(self, def_max_value)None

Set default max_value property.

Parameters
def_max_value

(str) the user default max_value property

Return

None

set_max_warning(self, def_max_warning)None

Set default max_warning property.

Parameters
def_max_warning

(str) the user default max_warning property

Return

None

set_min_alarm(self, def_min_alarm)None

Set default min_alarm property.

Parameters
def_min_alarm

(str) the user default min_alarm property

Return

None

set_min_value(self, def_min_value)None

Set default min_value property.

Parameters
def_min_value

(str) the user default min_value property

Return

None

set_min_warning(self, def_min_warning)None

Set default min_warning property.

Parameters
def_min_warning

(str) the user default min_warning property

Return

None

set_period(self, def_period) → None <= DEPRECATED

Set default periodic event period property.

Parameters
def_period

(str) the user default periodic event period property

Return

None

Deprecated since PyTango 8.0. Please use set_event_period instead.

set_rel_change(self, def_rel_change) → None <= DEPRECATED

Set default change event rel_change property.

Parameters
def_rel_change

(str) the user default change event rel_change property

Return

None

Deprecated since PyTango 8.0. Please use set_event_rel_change instead.

set_standard_unit(self, def_standard_unit)None

Set default standard unit property.

Parameters
def_standard_unit

(str) the user default standard unit property

Return

None

set_unit(self, def_unit)None

Set default unit property.

Parameters
def_unit

(str) te user default unit property

Return

None