Dictionary¶
-
class
ingenialink.dictionary.Dictionary(dictionary_path: str, interface: ingenialink.dictionary.Interface)[source]¶ Ingenia dictionary Abstract Base Class.
- Parameters
dictionary_path – Dictionary file path.
interface – communication interface.
- Raises
ILDictionaryParseError – If the dictionary could not be created.
-
child_registers(uid: str, subnode: int) → List[ingenialink.register.Register][source]¶ Return group registers by an UID
- Parameters
uid – registers group UID
subnode – registers group subnode
- Returns
All registers in the group
- Raises
KeyError – Registers group does not exist
-
get_safety_rpdo(uid: str) → ingenialink.dictionary.DictionarySafetyPDO[source]¶ Get Safe RPDO by uid
- Parameters
uid – Safe RPDO uid
- Returns
PDO object description
- Raises
NotImplementedError – Device is not safe
KeyError – Safe RPDO not exist
-
get_safety_tpdo(uid: str) → ingenialink.dictionary.DictionarySafetyPDO[source]¶ Get Safe TPDO by uid
- Parameters
uid – Safe TPDO uid
- Returns
PDO object description
- Raises
NotImplementedError – Device is not safe
KeyError – Safe TPDO not exist
-
abstract
read_dictionary() → None[source]¶ Reads the dictionary file and initializes all its components.
-
registers(subnode: int) → Dict[str, ingenialink.register.Register][source]¶ Gets the register dictionary to the targeted subnode.
- Parameters
subnode – Identifier for the subnode.
- Returns
Dictionary of all the registers for a subnode.
-
categories: ingenialink.dictionary.DictionaryCategories¶ Instance of all the categories in the dictionary.
-
errors: ingenialink.dictionary.DictionaryErrors¶ Instance of all the errors in the dictionary.
-
firmware_version: Optional[str]¶ Firmware version declared in the dictionary.
-
image: Optional[str] = None¶ Drive’s encoded image.
-
interface: ingenialink.dictionary.Interface¶ Interface declared in the dictionary.
-
property
is_coco_dictionary¶ Check if dictionary is a CoCo dictionary
- Returns
True if the dictionary is a CoCo dictionary. False otherwise.
-
is_safe: bool = False¶ True if has SafetyPDOs element, else False
-
part_number: Optional[str]¶ Part number declared in the dictionary.
-
path¶ Path of the dictionary.
-
product_code: int¶ Product code declared in the dictionary.
-
registers_group: Dict[int, Dict[str, List[ingenialink.register.Register]]]¶ Registers group by subnode and UID
-
revision_number: int¶ Revision number declared in the dictionary.
-
safety_rpdos: Dict[str, ingenialink.dictionary.DictionarySafetyPDO]¶ Safety RPDOs by UID
-
safety_tpdos: Dict[str, ingenialink.dictionary.DictionarySafetyPDO]¶ Safety TPDOs by UID
-
subnodes: Dict[int, ingenialink.dictionary.SubnodeType]¶ Number of subnodes in the dictionary.
-
version: str¶ Version of the dictionary.
-
class
ingenialink.dictionary.DictionaryCategories(list_xdf_categories: List[xml.etree.ElementTree.Element])[source]¶ Contains all categories from a Dictionary.
- Parameters
list_xdf_categories – List of Elements from xdf file
-
labels(cat_id: str) → Dict[str, str][source]¶ Obtain labels for a certain category ID.
Args: cat_id: Category ID
- Returns
Labels dictionary.
-
property
category_ids¶ Category IDs.
-
class
ingenialink.dictionary.DictionaryErrors(list_xdf_errors: List[xml.etree.ElementTree.Element])[source]¶ Errors for the dictionary.
- Parameters
list_xdf_errors – List of Elements from xdf file
-
property
errors¶ Get the errors dictionary.
- Returns
Errors dictionary.
-
class
ingenialink.dictionary.DictionarySafetyPDO(index: int, entries: List[ingenialink.dictionary.DictionarySafetyPDO.PDORegister])[source]¶ Safety PDOs dictionary descriptor
-
class
PDORegister(register: Optional[ingenialink.canopen.register.CanopenRegister], size: int)[source]¶ PDO register descriptor
-
class
-
class
ingenialink.dictionary.DictionaryV2(dictionary_path: str, interface: ingenialink.dictionary.Interface)[source]¶
-
class
ingenialink.dictionary.DictionaryV3(dictionary_path: str, interface: ingenialink.dictionary.Interface)[source]¶