3. voraus_ecat package

The Python client API for the voraus auxiliary EtherCAT master.

class voraus_ecat.EtherCAT(inputs, outputs, instant_communication=False, virtual=False)

Bases: EtherCAT[InputsT, OutputsT], Generic[InputsT, OutputsT]

Initializes the EtherCAT bus client.

Parameters:
  • inputs (TypeVar(InputsT, bound= ProcessData)) – The process image inputs.

  • outputs (TypeVar(OutputsT, bound= ProcessData)) – The process image outputs.

  • instant_communication (bool) – Enables the instant communication mode. Defaults to False.

  • virtual (bool) – Enables PDO input writing if the master is in virtual mode. Defaults to False.

connection(url, skip_virtual_pdo_init=False, skip_master_version_check=False)

Creates an OPC UA connection to the EtherCAT master.

Parameters:
  • url (str) – The URL of the EtherCAT master.

  • skip_virtual_pdo_init (bool) – Skip the PDO initialization during virtual mode.

  • skip_master_version_check (bool) – Skip checking the master version for compatibility with this client.

Yields:

None.

Raises:
  • EtherCATError – If master is in ‘FAILED SETUP’ state

  • MasterVersionError – If the master version is incompatible with this client

  • TimeoutError – If master is stuck in SETUP state

Return type:

Generator[None, None, None]

continue_with_error()

Forces the master application to continue operation if it is in state ERROR_TRANSITION or ERROR.

Return type:

None

get_master_version()

Fetches the version of the EtherCAT master application.

Return type:

Version

Returns:

The parsed semantic version of the EtherCAT master application.

Raises:

ValueError – If the master reports a string that is not a valid semantic version.

get_state()

Gets the EtherCAT state of the master.

Return type:

State

Returns:

The EtherCAT state of the master.

get_system_info()

Fetches current state and error information from the EtherCAT master application.

Return type:

SystemInfo

Returns:

State and error information from the EtherCAT master application.

property inputs: InputsT

Returns the inputs.

Returns:

The inputs.

property outputs: OutputsT

Returns the outputs.

Returns:

The outputs.

read_pdo_inputs(*pdos)

Reads the PDO inputs from the OPC UA server if instant communication mode is disabled.

Parameters:

*pdos (PDO) – Optional PDOs to read. If not specified, all PDO inputs are read.

Raises:
  • RuntimeError – If instant communication mode is enabled.

  • PDOError – If any specified PDO is not registered or if reading a value failed.

Return type:

None

read_pdo_outputs(*pdos)

Reads the PDO outputs from the OPC UA server if instant communication mode is disabled.

Parameters:

*pdos (PDO) – Optional PDOs to read. If not specified, all PDO outputs are read.

Raises:
  • RuntimeError – If instant communication mode is enabled.

  • PDOError – If any specified PDO is not registered or if reading a value failed.

Return type:

None

read_pdos(*pdos)

Reads the PDO values from the OPC UA server if instant communication mode is disabled.

This method reads all PDO input and output values from the EtherCAT master, or only the specified PDOs if provided.

Parameters:

*pdos (PDO) – Optional PDOs to read. If not specified, all PDO inputs and outputs are read.

Raises:
  • RuntimeError – If instant communication mode is enabled.

  • PDOError – If any specified PDO is not registered or if reading a value failed.

Return type:

None

restart()

Restarts the master application if it is in error state.

Return type:

None

property sdo: SDO

Get the SDO interface for reading and writing SDO objects.

Returns:

The SDO interface.

set_op_state(timeout=10.0)

Sets the state of the EtherCAT master to OP (operational).

Parameters:

timeout (float) – The timeout in seconds. Defaults to 10.0.

Return type:

None

set_state(state, timeout=10)

Sets the state of the EtherCAT master.

Parameters:
  • state (int | State) – The requested state.

  • timeout (float) – The timeout in seconds. Defaults to 10.

Raises:

TimeoutError – If the state is not reached within timeout.

Return type:

None

wait_for_state(state, timeout=-1.0)

Waits until the master application is in the specified state.

Parameters:
  • state (SystemState) – The state to wait for.

  • timeout (float) – The timeout in seconds. Defaults to -1.0 (infinite)

Raises:

TimeoutError – If the state is not reached within timeout.

Return type:

None

write_pdos()

Writes the (changed) PDO outputs to the OPC UA server if instant communication mode is disabled.

Raises:

RuntimeError – If instant communication mode is enabled.

Return type:

None

class voraus_ecat.PDO(name)

Bases: PDO[PDOT], Generic[PDOT]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

get()

Reads and decodes the value of the descriptor.

Note

This value represents the last value received by the EtherCAT master using voraus_ecat.EtherCAT.read_pdos() or if instant communication mode is enabled, the value will be requested from the OPC UA server.

If you need to access the last pending value (which has not been sent yet) use voraus_ecat.PDO.get_pending().

Raises:
  • RuntimeError – If you try to read the output value in cyclic mode without calling the read method before.

  • PDOError – If reading the value failed (e.g. if the master is not in the required state).

Return type:

TypeVar(PDOT)

Returns:

The value of the input.

get_pending()

Reads the last value, which has not been sent to the EtherCAT master yet.

This method should be used if you want to manipulate a value multiple times before it gets written to the EtherCAT master using voraus_ecat.EtherCAT.write_pdos(). This is helpful when working with bit masks for multiple outputs mapped to one integer PDO.

Note

This method is not available in instant communication mode.

This method is available for outputs and, in virtual mode, also for inputs.

If you need to access the last received value to ensure a PDO has been set properly use voraus_ecat.PDO.get().

The methods voraus_ecat.EtherCAT.read_pdos() and voraus_ecat.EtherCAT.read_pdo_outputs() will not update the value stored by voraus_ecat.PDO.set(). After calling the method voraus_ecat.EtherCAT.write_pdos(), this method will return the last value read by voraus_ecat.EtherCAT.read_pdos().

Raises:

RuntimeError – If the EtherCAT client runs in instant communication mode.

Return type:

TypeVar(PDOT)

Returns:

The pending value of the pdo.

property is_virtual: bool

Whether the PDO is in virtual mode or not.

Returns:

True if the PDO is in virtual mode.

property node: SyncNode

Returns the node of the descriptor PDO.

Returns:

The OPC UA node.

set(value)

Encodes and writes the value of the descriptor.

If instant communication mode is enabled, the value will be sent via OPC UA instantly.

Parameters:

value (TypeVar(PDOT)) – The value to set.

Raises:

ValueError – If you try to write an input value.

Return type:

None

class voraus_ecat.ProcessData

Bases: ProcessData

Initializes the EtherCAT process data inputs or outputs.

class voraus_ecat.SDO(node_coe)

Bases: SDO

Initializes the SDO helper.

Parameters:

node_coe (ProtectedOptional[SyncNode]) – OPC UA CoE node accessor.

poll_read(request_id)

Polls an asynchronous SDO upload operation (upload = read from slave).

Parameters:

request_id (int) – Request ID returned by start_read.

Return type:

SDOReadPollResult

Returns:

The polled read operation state.

Raises:

SDOError – If polling the SDO read operation failed.

poll_write(request_id)

Polls an asynchronous SDO download operation (download = write to slave).

Parameters:

request_id (int) – Request ID returned by start_write.

Return type:

SDOWritePollResult

Returns:

The polled write operation state.

Raises:

SDOError – If polling the SDO write operation failed.

read_bytes(slave_index, descriptor, size, timeout_ms=500)

Reads SDO data from the slave synchronously on top of start/poll operations (“SDO upload”).

Parameters:
  • slave_index (int) – Slave index.

  • descriptor (SDODescriptor) – SDO descriptor containing index and subindex.

  • size (int) – Number of bytes to read.

  • timeout_ms (int) – Timeout in milliseconds. Defaults to 500 ms.

Return type:

bytes

Returns:

The read byte payload (little-endian).

Raises:

SDOError – If the SDO read operation fails.

start_read(slave_index, descriptor, size, timeout_ms=500)

Starts an asynchronous SDO upload operation (upload = read from slave).

Parameters:
  • slave_index (int) – Slave index.

  • descriptor (SDODescriptor) – SDO descriptor containing index and subindex.

  • size (int) – Number of bytes to read.

  • timeout_ms (int) – Timeout in milliseconds. Defaults to 500 ms.

Return type:

int

Returns:

The request ID for polling the operation status.

Raises:

SDOError – If the SDO read start operation failed.

start_write(slave_index, descriptor, data, timeout_ms=500)

Starts an asynchronous SDO download operation (download = write to slave).

Parameters:
  • slave_index (int) – Slave index.

  • descriptor (SDODescriptor) – SDO descriptor containing index and subindex.

  • data (bytes) – Raw payload bytes (little-endian).

  • timeout_ms (int) – Timeout in milliseconds. Defaults to 500 ms.

Return type:

int

Returns:

The request ID for polling the operation status.

Raises:

SDOError – If the SDO write start operation failed.

write_bytes(slave_index, descriptor, data, timeout_ms=500)

Writes SDO data to the slave synchronously on top of start/poll operations (“SDO download”).

Parameters:
  • slave_index (int) – Slave index.

  • descriptor (SDODescriptor) – SDO descriptor containing index and subindex.

  • data (bytes) – Raw payload bytes (little-endian).

  • timeout_ms (int) – Timeout in milliseconds. Defaults to 500 ms.

Raises:

SDOError – If the SDO write operation fails.

Return type:

None

class voraus_ecat.SDODescriptor(index, sub_index)

Bases: object

Describes an SDO location.

index

SDO index.

sub_index

SDO subindex.

index: int
sub_index: int
class voraus_ecat.SDOReadPollResult(done: bool, success: bool, data: bytes, abort_code: int)

Bases: NamedTuple

Create new instance of SDOReadPollResult(done, success, data, abort_code)

abort_code: int

Alias for field number 3

data: bytes

Alias for field number 2

done: bool

Alias for field number 0

success: bool

Alias for field number 1

class voraus_ecat.SDOWritePollResult(done: bool, success: bool, abort_code: int)

Bases: NamedTuple

Create new instance of SDOWritePollResult(done, success, abort_code)

abort_code: int

Alias for field number 2

done: bool

Alias for field number 0

success: bool

Alias for field number 1

class voraus_ecat.State(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

Represents the EtherCAT states.

INIT = 1
OP = 8
PRE_OP = 2
SAFE_OP = 4
class voraus_ecat.SystemInfo(state=SystemState.SETUP, error_number=0, error_message='')

Bases: object

Contains Information about the current state of the EtherCAT master application.

error_message: str = ''
error_number: int = 0
state: SystemState = 0
class voraus_ecat.SystemState(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

Represents the EtherCAT Application states.

ACTIVE = 4
ERROR = 6
ERR_TRANS = 5
FAILED_SETUP = 1
FINAL = 10
READY = 2
SETUP = 0
SHUTDOWN = 9
STARTING = 3
STOPPED = 8
STOPPING = 7
class voraus_ecat.Version(major, minor=0, patch=0, prerelease=None, build=None)

Bases: object

A semver compatible version class.

See specification at https://semver.org.

Parameters:
  • major (SupportsInt) – version when you make incompatible API changes.

  • minor (SupportsInt) – version when you add functionality in a backwards-compatible manner.

  • patch (SupportsInt) – version when you make backwards-compatible bug fixes.

  • prerelease (Union[str, bytes, int, None]) – an optional prerelease string

  • build (Union[str, bytes, int, None]) – an optional build string

NAMES: ClassVar[Tuple[str, ...]] = ('major', 'minor', 'patch', 'prerelease', 'build')

The names of the different parts of a version

property build: str | None

The build part of a version (read-only).

bump_build(token='build')

Raise the build part of the version, return a new object but leave self untouched.

Parameters:

token (Optional[str]) – defaults to 'build'

Return type:

Version

Returns:

new Version object with the raised build part. The original object is not modified.

>>> ver = semver.parse("3.4.5-rc.1+build.9")
>>> ver.bump_build()
Version(major=3, minor=4, patch=5, prerelease='rc.1', build='build.10')
bump_major()

Raise the major part of the version, return a new object but leave self untouched.

Return type:

Version

Returns:

new object with the raised major part

>>> ver = semver.parse("3.4.5")
>>> ver.bump_major()
Version(major=4, minor=0, patch=0, prerelease=None, build=None)
bump_minor()

Raise the minor part of the version, return a new object but leave self untouched.

Return type:

Version

Returns:

new object with the raised minor part

>>> ver = semver.parse("3.4.5")
>>> ver.bump_minor()
Version(major=3, minor=5, patch=0, prerelease=None, build=None)
bump_patch()

Raise the patch part of the version, return a new object but leave self untouched.

Return type:

Version

Returns:

new object with the raised patch part

>>> ver = semver.parse("3.4.5")
>>> ver.bump_patch()
Version(major=3, minor=4, patch=6, prerelease=None, build=None)
bump_prerelease(token='rc')

Raise the prerelease part of the version, return a new object but leave self untouched.

Parameters:

token (Optional[str]) – defaults to 'rc'

Return type:

Version

Returns:

new Version object with the raised prerelease part. The original object is not modified.

>>> ver = semver.parse("3.4.5")
>>> ver.bump_prerelease().prerelease
'rc.2'
>>> ver.bump_prerelease('').prerelease
'1'
>>> ver.bump_prerelease(None).prerelease
'rc.1'
compare(other)

Compare self with other.

Parameters:

other (Union[Version, Dict[str, Union[int, str, None]], Collection[Union[int, str, None]], str]) – the second version

Return type:

int

Returns:

The return value is negative if ver1 < ver2, zero if ver1 == ver2 and strictly positive if ver1 > ver2

>>> Version.parse("1.0.0").compare("2.0.0")
-1
>>> Version.parse("2.0.0").compare("1.0.0")
1
>>> Version.parse("2.0.0").compare("2.0.0")
0
finalize_version()

Remove any prerelease and build metadata from the version.

Return type:

Version

Returns:

a new instance with the finalized version string

>>> str(semver.Version.parse('1.2.3-rc.5').finalize_version())
'1.2.3'
is_compatible(other)

Check if current version is compatible with other version.

The result is True, if either of the following is true:

  • both versions are equal, or

  • both majors are equal and higher than 0. Same for both minors. Both pre-releases are equal, or

  • both majors are equal and higher than 0. The minor of b’s minor version is higher then a’s. Both pre-releases are equal.

The algorithm does not check patches.

Added in version 3.0.0.

Parameters:

other (Version) – the version to check for compatibility

Return type:

bool

Returns:

True, if other is compatible with the old version, otherwise False

>>> Version(1, 1, 0).is_compatible(Version(1, 0, 0))
False
>>> Version(1, 0, 0).is_compatible(Version(1, 1, 0))
True
classmethod is_valid(version)

Check if the string is a valid semver version.

Added in version 2.9.1.

Changed in version 3.0.0: Renamed from isvalid()

Parameters:

version (str) – the version string to check

Return type:

bool

Returns:

True if the version string is a valid semver version, False otherwise.

property major: int

The major part of a version (read-only).

match(match_expr)

Compare self to match a match expression.

Parameters:

match_expr (str) – optional operator and version; valid operators are < smaller than > greater than >= greator or equal than <= smaller or equal than == equal != not equal

Return type:

bool

Returns:

True if the expression matches the version, otherwise False

>>> semver.Version.parse("2.0.0").match(">=1.0.0")
True
>>> semver.Version.parse("1.0.0").match(">1.0.0")
False
>>> semver.Version.parse("4.0.4").match("4.0.4")
True
property minor: int

The minor part of a version (read-only).

next_version(part, prerelease_token='rc')

Determines next version, preserving natural order.

Added in version 2.10.0.

This function is taking prereleases into account. The “major”, “minor”, and “patch” raises the respective parts like the bump_* functions. The real difference is using the “prerelease” part. It gives you the next patch version of the prerelease, for example:

>>> str(semver.parse("0.1.4").next_version("prerelease"))
'0.1.5-rc.1'
Parameters:
  • part (str) – One of “major”, “minor”, “patch”, or “prerelease”

  • prerelease_token (str) – prefix string of prerelease, defaults to ‘rc’

Return type:

Version

Returns:

new object with the appropriate part raised

classmethod parse(version, optional_minor_and_patch=False)

Parse version string to a Version instance.

Changed in version 2.11.0: Changed method from static to classmethod to allow subclasses.

Changed in version 3.0.0: Added optional parameter optional_minor_and_patch to allow optional minor and patch parts.

Parameters:
  • version (Union[str, bytes]) – version string

  • optional_minor_and_patch (bool) – if set to true, the version string to parse can contain optional minor and patch parts. Optional parts are set to zero. By default (False), the version string to parse has to follow the semver specification.

Return type:

TypeVar(T, bound= Version)

Returns:

a new Version instance

Raises:
  • ValueError – if version is invalid

  • TypeError – if version contains the wrong type

>>> semver.Version.parse('3.4.5-pre.2+build.4')
Version(major=3, minor=4, patch=5, prerelease='pre.2', build='build.4')
property patch: int

The patch part of a version (read-only).

property prerelease: str | None

The prerelease part of a version (read-only).

replace(**parts)

Replace one or more parts of a version and return a new Version object, but leave self untouched.

Added in version 2.9.0: Added Version.replace()

Parameters:

parts (Union[int, str, None]) – the parts to be updated. Valid keys are: major, minor, patch, prerelease, or build

Return type:

Version

Returns:

the new Version object with the changed parts

Raises:

TypeError – if parts contain invalid keys

to_dict()

Convert the Version object to an dict.

Added in version 2.10.0: Renamed Version._asdict() to Version.to_dict() to make this function available in the public API.

Return type:

Dict[str, Union[int, str, None]]

Returns:

an dict with the keys in the order major, minor, patch, prerelease, and build.

>>> semver.Version(3, 2, 1).to_dict()
{'major': 3, 'minor': 2, 'patch': 1, 'prerelease': None, 'build': None}
to_tuple()

Convert the Version object to a tuple.

Added in version 2.10.0: Renamed Version._astuple() to Version.to_tuple() to make this function available in the public API.

Return type:

Tuple[int, int, int, Optional[str], Optional[str]]

Returns:

a tuple with all the parts

>>> semver.Version(5, 3, 1).to_tuple()
(5, 3, 1, None, None)

3.1. Submodules

3.2. voraus_ecat.exceptions module

Contains custom exceptions used by this package.

exception voraus_ecat.exceptions.EtherCATError(system_info)

Bases: Exception

Initializes the exception.

exception voraus_ecat.exceptions.MasterVersionError(master_version, min_compatible_version)

Bases: Exception

Initializes the exception.

exception voraus_ecat.exceptions.PDOError(message)

Bases: Exception

Initializes the exception.

exception voraus_ecat.exceptions.SDOError(message)

Bases: Exception

Initializes the exception.

3.3. voraus_ecat.pdo module

The public-facing interface for PDOs.

class voraus_ecat.pdo.ArrayOfDInt(name)

Bases: _ArrayOfDInt, PDO[list[int]]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (list[int]) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.ArrayOfInt(name)

Bases: _ArrayOfInt, PDO[list[int]]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (list[int]) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.ArrayOfSInt(name)

Bases: _ArrayOfSInt, PDO[list[int]]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (list[int]) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.ArrayOfUDint(name)

Bases: _ArrayOfUDint, PDO[list[int]]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (list[int]) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit1(name)

Bases: _Bit1, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit10(name)

Bases: _Bit10, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit11(name)

Bases: _Bit11, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit12(name)

Bases: _Bit12, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit13(name)

Bases: _Bit13, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit14(name)

Bases: _Bit14, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit15(name)

Bases: _Bit15, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit16(name)

Bases: _Bit16, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit2(name)

Bases: _Bit2, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit3(name)

Bases: _Bit3, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit4(name)

Bases: _Bit4, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit5(name)

Bases: _Bit5, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit6(name)

Bases: _Bit6, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit7(name)

Bases: _Bit7, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit8(name)

Bases: _Bit8, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Bit9(name)

Bases: _Bit9, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

PY_TYPE: str = 'int'
UA_VARIANT: ua.VariantType = 5
encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.BitArr16(name)

Bases: _BitArr16, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.BitArr32(name)

Bases: _BitArr32, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.BitArr8(name)

Bases: _BitArr8, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Boolean(name)

Bases: _Boolean, PDO[bool]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (bool) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Byte(name)

Bases: _Byte, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.DWord(name)

Bases: _DWord, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Guid(name)

Bases: _Guid, PDO[UUID]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (UUID) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Integer16(name)

Bases: _Integer16, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Integer24(name)

Bases: _Integer24, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Integer32(name)

Bases: _Integer32, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Integer40(name)

Bases: _Integer40, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Integer48(name)

Bases: _Integer48, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Integer56(name)

Bases: _Integer56, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Integer64(name)

Bases: _Integer64, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Integer8(name)

Bases: _Integer8, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.OctetString(name)

Bases: _OctetString, PDO[list[int]]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (list[int]) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Real32(name)

Bases: _Real32, PDO[float]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (float) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Real64(name)

Bases: _Real64, PDO[float]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (float) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.UnicodeString(name)

Bases: _UnicodeString, PDO[list[int]]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (list[int]) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Unknown(name)

Bases: _Unknown, PDO[list[int]]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (list[int]) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Unsigned16(name)

Bases: _Unsigned16, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Unsigned24(name)

Bases: _Unsigned24, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Unsigned32(name)

Bases: _Unsigned32, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Unsigned40(name)

Bases: _Unsigned40, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Unsigned48(name)

Bases: _Unsigned48, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Unsigned56(name)

Bases: _Unsigned56, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Unsigned64(name)

Bases: _Unsigned64, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Unsigned8(name)

Bases: _Unsigned8, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.VisibleString(name)

Bases: _VisibleString, PDO[str]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (str) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.

class voraus_ecat.pdo.Word(name)

Bases: _Word, PDO[int]

Initializes the PDO.

Parameters:

name (str) – The name of the PDO OPC UA node.

encode(value)

Encodes the PDO value for OPC UA communication.

Parameters:

value (int) – The new PDO value.

Return type:

Variant

Returns:

The encoded PDO value.