Skip to main content
Version: 1.1.1

ecfacade::IoModule

High-level digital/analog I/O handle. More...

#include <io_module.hpp>

Inherits from DeviceFacade

Public Functions

Name
voidwriteDigital(std::size_t channel, bool value)
Command a digital output channel.
voidwriteAnalog(std::size_t channel, std::int32_t value)
Command an analog output channel (raw counts).
boolreadDigital(std::size_t channel) const
Read the current state of a digital input channel.
std::int32_treadAnalog(std::size_t channel) const
Read the current value of an analog input channel (raw counts).
ecdev::IIoProfile *ioProfile() const
Escape hatch to the underlying I/O profile contract for callers that need capabilities beyond the standard channel accessors.
booldigitalOutputState(std::size_t channel) const
Read back the last value written to a digital output channel.
std::size_tdigitalOutputCount() const
Number of digital output channels available on this module (process-image order).
std::size_tdigitalInputCount() const
Number of digital input channels available on this module (process-image order).
std::int32_tanalogOutputState(std::size_t channel) const
Read back the last value written to an analog output channel (raw counts).
std::size_tanalogOutputCount() const
Number of analog output channels available on this module.
std::size_tanalogInputCount() const
Number of analog input channels available on this module.
IoModule(ecdev::IIoProfile * io, std::string name, ecdev::IEthercatDevice * device)

Detailed Description

class ecfacade::IoModule;

High-level digital/analog I/O handle.

Thin wrapper over an [ecdev::IIoProfile](/lxmaster/api/classes/IIoProfile); the application reads/writes named-by-index channels without seeing CoE objects, PDO offsets, or the backend. Safe to use from the application thread during the RT cycle.

Public Functions Documentation

function writeDigital

void writeDigital(
std::size_t channel,
bool value
)

Command a digital output channel.

Parameters:

  • channel 0-based channel index.
  • value true to assert the output, false to de-assert it.

Out-of-range channels are silently ignored. RT-safe.

function writeAnalog

void writeAnalog(
std::size_t channel,
std::int32_t value
)

Command an analog output channel (raw counts).

Parameters:

  • channel 0-based channel index.
  • value Raw output value in process-image counts.

Out-of-range channels are silently ignored. RT-safe.

function readDigital

bool readDigital(
std::size_t channel
) const

Read the current state of a digital input channel.

Parameters:

  • channel 0-based channel index.

Return: The input state, or false for out-of-range channels.

RT-safe.

function readAnalog

std::int32_t readAnalog(
std::size_t channel
) const

Read the current value of an analog input channel (raw counts).

Parameters:

  • channel 0-based channel index.

Return: The raw input value, or 0 for out-of-range channels.

RT-safe.

function ioProfile

ecdev::IIoProfile * ioProfile() const

Escape hatch to the underlying I/O profile contract for callers that need capabilities beyond the standard channel accessors.

Return: The IIoProfile backing this module. Never null while the module is valid.

function digitalOutputState

bool digitalOutputState(
std::size_t channel
) const

Read back the last value written to a digital output channel.

Parameters:

  • channel 0-based channel index.

Return: The last commanded output state, or false for out-of-range channels.

RT-safe.

function digitalOutputCount

std::size_t digitalOutputCount() const

Number of digital output channels available on this module (process-image order).

Return: Channel count; use as the exclusive upper bound for [writeDigital()](/lxmaster/api/classes/IoModule#function-writedigital).

function digitalInputCount

std::size_t digitalInputCount() const

Number of digital input channels available on this module (process-image order).

Return: Channel count; use as the exclusive upper bound for [readDigital()](/lxmaster/api/classes/IoModule#function-readdigital).

function analogOutputState

std::int32_t analogOutputState(
std::size_t channel
) const

Read back the last value written to an analog output channel (raw counts).

Parameters:

  • channel 0-based channel index.

Return: The last commanded output value, or 0 for out-of-range channels.

RT-safe.

function analogOutputCount

std::size_t analogOutputCount() const

Number of analog output channels available on this module.

Return: Channel count; use as the exclusive upper bound for [writeAnalog()](/lxmaster/api/classes/IoModule#function-writeanalog).

function analogInputCount

std::size_t analogInputCount() const

Number of analog input channels available on this module.

Return: Channel count; use as the exclusive upper bound for [readAnalog()](/lxmaster/api/classes/IoModule#function-readanalog).

function IoModule

IoModule(
ecdev::IIoProfile * io,
std::string name,
ecdev::IEthercatDevice * device
)

Updated on 2026-07-13 at 20:44:41 +0000