Register¶
-
class
ingenialink.ipb.register.
IPBRegister
(identifier, units, cyclic, dtype, access, address, phy=<REG_PHY.NONE: 0>, subnode=1, storage=None, reg_range=None, labels=None, enums=None, cat_id=None, scat_id=None, internal_use=0, c_reg=None)[source]¶ IPB Register.
- Parameters
identifier (str) – Identifier.
units (str) – Units.
cyclic (str) – Cyclic typed register.
dtype (REG_DTYPE) – Data type.
access (REG_ACCESS) – Access type.
address (int) – Address.
phy (REG_PHY, optional) – Physical units.
subnode (int) – Subnode
storage (any, optional) – Storage.
reg_range (tuple, optional) – Range (min, max).
labels (dict, optional) – Register labels.
enums (dict, optional) – Enumeration values.
cat_id (str, optional) – Category ID.
scat_id (str, optional) – Sub-category ID.
internal_use (int, optional) – Internal use.
- Raises
TypeError – If any of the parameters has invalid type.
-
property
access
¶ Access type of the register.
- Type
REG_ACCESS
-
property
address
¶ Obtain register address.
- Type
int
-
property
cat_id
¶ Category ID
- Type
str
-
property
cyclic
¶ Defines if the register is cyclic.
- Type
str
-
property
dtype
¶ Data type of the register.
- Type
REG_DTYPE
-
property
enums
¶ Containing all the enums for the register.
- Type
dict
-
property
enums_count
¶ The number of the enums in the register.
- Type
int
-
property
identifier
¶ Register identifier.
- Type
str
-
property
internal_use
¶ Defines if the register is only for internal uses.
- Type
int
-
property
labels
¶ Containing the labels of the register.
- Type
dict
-
property
phy
¶ Physical units of the register.
- Type
REG_PHY
-
property
range
¶ Containing the minimum and the maximum values of the register.
- Type
tuple
-
property
scat_id
¶ Sub-Category ID
- Type
str
-
property
storage
¶ Defines if the register needs to be stored.
- Type
any
-
property
storage_valid
¶ Defines if the register storage is valid.
- Type
bool
-
property
subnode
¶ Target subnode of the register.
- Type
int
-
property
units
¶ Units of the register.
- Type
str
-
class
ingenialink.ipb.register.
LabelsDictionary
(labels=None)[source]¶ Labels dictionary.
- Parameters
labels (dict, optional) – Labels.
- Raises
ILCreationError – If the dictionary could not be created.
-
clear
() → None. Remove all items from D.¶
-
get
(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
-
items
() → a set-like object providing a view on D’s items¶
-
keys
() → a set-like object providing a view on D’s keys¶
-
pop
(k[, d]) → v, remove specified key and return the corresponding value.¶ If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), remove and return some (key, value) pair¶ as a 2-tuple; but raise KeyError if D is empty.
-
setdefault
(k[, d]) → D.get(k,d), also set D[k]=d if k not in D¶
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F.¶ If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → an object providing a view on D’s values¶
-
ingenialink.ipb.register.
get_enums
(enums, enums_count)[source]¶ Obtain enumerations list of the register.
- Returns
Enumerations of the register.
- Return type
array
-
ingenialink.ipb.register.
get_range
(reg_range, dtype)[source]¶ Obtains register range.
- Returns
Register range (min, max), None if undefined.
- Return type
tuple
-
ingenialink.ipb.register.
get_storage
(storage, storage_valid, dtype)[source]¶ Obtain register storage.
- Returns
Register storage.
- Return type
int