Dictionary

class ingenialink.ethercat.dictionary.EthercatDictionary(*args: Any, **kwargs: Any)[source]

Base class for EtherCAT dictionaries.

all_objs() Iterator[CanOpenObject]

Iterator for all items.

Yields:

CanOpenObject

all_registers() Iterator[Register]

Iterator for all registers.

Yields:

Register

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

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 | None = None) CanOpenObject

Return object by an UID and subnode.

Parameters:
  • uid – object UID

  • subnode – object subnode

Returns:

CanOpen Object

Raises:

KeyError – Object does not exist

get_object_by_index(index: int) CanOpenObject

Get an object by its index.

Parameters:

index – The index of the object.

Returns:

The object with the given index.

Return type:

CanOpenObject

get_register(uid: str, axis: int | None = None) Register

Gets the targeted register.

Parameters:
  • uid – register uid.

  • axis – axis. Should be specified if multiaxis, None otherwise.

Raises:
  • KeyError – if the specified axis does not exist.

  • KeyError – if the register is not present in the specified axis.

  • ValueError – if the register is not found in any axis, if axis is not provided.

  • ValueError – if the register is found in multiple axis, if axis is provided.

Returns:

register.

get_register_by_index_subindex(index: int, subindex: int) CanopenRegister

Get a register by its index and subindex.

Parameters:
  • index – The index of the register.

  • subindex – The subindex of the register.

Returns:

The register with the given index and subindex.

Return type:

CanopenRegister

get_safety_module(module_ident: int | str) DictionarySafetyModule

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

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

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

Reads the dictionary file and initializes all its components.

registers(subnode: int) dict[str, Register]

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 = 3

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.ethercat.dictionary.EthercatDictionaryV2(*args: Any, **kwargs: Any)[source]

Contains all registers and information of a EtherCAT dictionary.

Parameters:

dictionary_path – Path to the Ingenia dictionary.

all_objs() Iterator[CanOpenObject]

Iterator for all items.

Yields:

CanOpenObject

all_registers() Iterator[Register]

Iterator for all registers.

Yields:

Register

classmethod get_description(dictionary_path: str, interface: Interface) DictionaryDescriptor

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 | None = None) CanOpenObject

Return object by an UID and subnode.

Parameters:
  • uid – object UID

  • subnode – object subnode

Returns:

CanOpen Object

Raises:

KeyError – Object does not exist

get_object_by_index(index: int) CanOpenObject

Get an object by its index.

Parameters:

index – The index of the object.

Returns:

The object with the given index.

Return type:

CanOpenObject

get_register(uid: str, axis: int | None = None) Register

Gets the targeted register.

Parameters:
  • uid – register uid.

  • axis – axis. Should be specified if multiaxis, None otherwise.

Raises:
  • KeyError – if the specified axis does not exist.

  • KeyError – if the register is not present in the specified axis.

  • ValueError – if the register is not found in any axis, if axis is not provided.

  • ValueError – if the register is found in multiple axis, if axis is provided.

Returns:

register.

get_register_by_index_subindex(index: int, subindex: int) CanopenRegister

Get a register by its index and subindex.

Parameters:
  • index – The index of the register.

  • subindex – The subindex of the register.

Returns:

The register with the given index and subindex.

Return type:

CanopenRegister

get_safety_module(module_ident: int | str) DictionarySafetyModule

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

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

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

read_dictionary() None

Reads the dictionary file and initializes all its components.

registers(subnode: int) dict[str, Register]

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 = 3

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.ethercat.dictionary.EthercatDictionaryV3(*args: Any, **kwargs: Any)[source]

Contains all registers and information of a EtherCAT dictionary.

Parameters:

dictionary_path – Path to the Ingenia dictionary.

all_objs() Iterator[CanOpenObject]

Iterator for all items.

Yields:

CanOpenObject

all_registers() Iterator[Register]

Iterator for all registers.

Yields:

Register

classmethod get_description(dictionary_path: str, interface: Interface) DictionaryDescriptor

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 | None = None) CanOpenObject

Return object by an UID and subnode.

Parameters:
  • uid – object UID

  • subnode – object subnode

Returns:

CanOpen Object

Raises:

KeyError – Object does not exist

get_object_by_index(index: int) CanOpenObject

Get an object by its index.

Parameters:

index – The index of the object.

Returns:

The object with the given index.

Return type:

CanOpenObject

get_register(uid: str, axis: int | None = None) Register

Gets the targeted register.

Parameters:
  • uid – register uid.

  • axis – axis. Should be specified if multiaxis, None otherwise.

Raises:
  • KeyError – if the specified axis does not exist.

  • KeyError – if the register is not present in the specified axis.

  • ValueError – if the register is not found in any axis, if axis is not provided.

  • ValueError – if the register is found in multiple axis, if axis is provided.

Returns:

register.

get_register_by_index_subindex(index: int, subindex: int) CanopenRegister

Get a register by its index and subindex.

Parameters:
  • index – The index of the register.

  • subindex – The subindex of the register.

Returns:

The register with the given index and subindex.

Return type:

CanopenRegister

get_safety_module(module_ident: int | str) DictionarySafetyModule

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

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

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

read_dictionary() None

Reads the dictionary file and initializes all its components.

registers(subnode: int) dict[str, Register]

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 = 3

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.