Dictionary

class ingenialink.dictionary.CanOpenObject(uid: str | None, object_type: CanOpenObjectType, registers: list[CanopenRegister])[source]

CanOpenObject.

class ingenialink.dictionary.CanOpenObjectType(value)[source]

CanOpen Object Type.

ARRAY = 3

ARRAY object type

RECORD = 2

RECORD object type

VAR = 1

VAR object type

class ingenialink.dictionary.Dictionary(dictionary_path: str, interface: 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.

abstract classmethod get_description(dictionary_path: str, interface: Interface) DictionaryDescriptor[source]

Quick function to get target dictionary description.

Parameters:
  • dictionary_path – target dictionary path

  • interface – device interface

Returns:

Target dictionary description

get_object(uid: str, subnode: int) CanOpenObject[source]

Return object by an UID and subnode.

Parameters:
  • uid – object UID

  • subnode – object subnode

Returns:

CanOpen Object

Raises:

KeyError – Object does not exist

get_safety_module(module_ident: int | str) DictionarySafetyModule[source]

Get safety module by module_ident.

Parameters:

module_ident – safety module module ident (int/hex).

Returns:

Safety module object description.

Raises:
  • NotImplementedError – Device is not safe.

  • KeyError – Safety module does not exist.

get_safety_rpdo(uid: str) 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) 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, 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: DictionaryCategories

Instance of all the categories in the dictionary.

coco_product_code: int | None = None

CoCo product code declared in the dictionary. Only used when a COM-KIT and a CORE dictionary are merged.

errors: dict[int, DictionaryError]

Instance of all the errors in the dictionary.

firmware_version: str | None = None

Firmware version declared in the dictionary.

image: str | None = None

Drive’s encoded image.

interface: Interface

Interface declared in the dictionary.

property is_coco_dictionary: bool

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

items: dict[int, dict[str, CanOpenObject]]

Registers group by subnode and UID

part_number: str | None = None

Part number declared in the dictionary.

path

Path of the dictionary.

product_code: int | None = None

Product code declared in the dictionary.

revision_number: int | None = None

Revision number declared in the dictionary.

safety_modules: dict[int, DictionarySafetyModule]

Safety modules (MDP).

safety_rpdos: dict[str, DictionarySafetyPDO]

Safety RPDOs by UID

safety_tpdos: dict[str, DictionarySafetyPDO]

Safety TPDOs by UID

subnodes: dict[int, SubnodeType]

Number of subnodes in the dictionary.

version: str

Version of the dictionary.

class ingenialink.dictionary.DictionaryCategories(list_xdf_categories: list[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.

load_cat_ids() None[source]

Load category IDs from dictionary.

property category_ids: list[str]

Category IDs.

class ingenialink.dictionary.DictionaryDescriptor(firmware_version: str | None = None, product_code: int | None = None, part_number: str | None = None, revision_number: int | None = None)[source]

Class to store a dictionary error.

firmware_version: str | None = None

Firmware version declared in the dictionary.

part_number: str | None = None

Part number declared in the dictionary.

product_code: int | None = None

Product code declared in the dictionary.

revision_number: int | None = None

Revision number declared in the dictionary.

class ingenialink.dictionary.DictionaryError(id: int, affected_module: str, error_type: str, description: str | None)[source]

Class to store a dictionary error.

affected_module: str

The module affected by the error.

description: str | None

The error description.

error_type: str

The error type.

id: int

The error ID.

class ingenialink.dictionary.DictionarySafetyModule(uses_sra: bool, module_ident: int, application_parameters: list[ApplicationParameter])[source]

Safety module (MDP) dictionary descriptor.

class ApplicationParameter(uid: str)[source]

FSoE application parameter descriptor.

class ingenialink.dictionary.DictionarySafetyPDO(index: int, entries: list[PDORegister])[source]

Safety PDOs dictionary descriptor.

class PDORegister(register: CanopenRegister | None, size: int)[source]

PDO register descriptor.

class ingenialink.dictionary.DictionaryV2(dictionary_path: str)[source]

Class to represent a Dictionary V2.

classmethod get_description(dictionary_path: str, interface: Interface) DictionaryDescriptor[source]

Quick function to get target dictionary description.

Parameters:
  • dictionary_path – target dictionary path

  • interface – device interface

Returns:

Target dictionary description

read_dictionary() None[source]

Reads the dictionary file and initializes all its components.

class ingenialink.dictionary.DictionaryV3(dictionary_path: str, interface: Interface)[source]

Class to represent a Dictionary V3.

classmethod get_description(dictionary_path: str, interface: Interface) DictionaryDescriptor[source]

Quick function to get target dictionary description.

Parameters:
  • dictionary_path – target dictionary path

  • interface – device interface

Returns:

Target dictionary description

read_dictionary() None[source]

Reads the dictionary file and initializes all its components.

class ingenialink.dictionary.Interface(value)[source]

Connection Interfaces.

CAN = 1

CANopen

ECAT = 3

EtherCAT

ETH = 2

Ethernet

EoE = 4

Ethernet over EtherCAT

VIRTUAL = 5

Virtual Drive

class ingenialink.dictionary.SubnodeType(value)[source]

Subnode types.

COMMUNICATION = 1

Communication

MOTION = 2

Motion

SAFETY = 3

Safety

class ingenialink.dictionary.XMLBase[source]

Base class to manipulate XML files.