Skip to main content
Version: 1.0.14

ecdev::GenericIoProfile

Protocol-agnostic digital/analog I/O profile. More...

#include <generic_io_profile.hpp>

Inherits from ecdev::IDeviceProfile, ecdev::IIoProfile, IDeviceLifecycle

Inherited by ecdev::CiA401IoProfile

Public Functions

Name
virtual voidwriteOutputs(ProcessImage & image, std::uint64_t cycle_count) override
virtual voidsetDigitalOutput(std::size_t channel, bool value) override
Command a digital output channel; out-of-range is a no-op.
virtual voidsetAnalogOutput(std::size_t channel, std::int32_t value) override
Command an analog output channel (raw counts); out-of-range is a no-op.
virtual voidresolveTopology(const ProcessImage & image) override
Resolve the static channel/PDO topology from the ENI-derived process image.
virtual voidreadInputs(const ProcessImage & image, bool wkc_valid, bool operational) override
virtual const char *profileName() const override
Stable identifier for diagnostics (e.g.
virtual std::size_tdigitalOutputCount() const override
virtual booldigitalOutput(std::size_t ch) const override
virtual std::size_tdigitalInputCount() const override
virtual booldigitalInput(std::size_t channel) const override
Read a digital input/output channel; out-of-range returns false.
virtual std::stringconfigurePreOp(ISlaveServices & svc, ProcessImage & image) override
virtual IIoProfile *asIo() override
virtual std::size_tanalogOutputCount() const override
virtual std::int32_tanalogOutput(std::size_t ch) const override
virtual std::size_tanalogInputCount() const override
virtual std::int32_tanalogInput(std::size_t channel) const override
Read an analog input/output channel (raw counts); out-of-range returns 0.

Public Attributes

Name
constexpr std::size_tkMaxDigital
constexpr std::size_tkMaxAnalog

Additional inherited members

Public Functions inherited from ecdev::IDeviceProfile

Name
~IDeviceProfile() override =default
virtual voidprimeOutputs(ProcessImage & image)
virtual std::stringprepareSafeOp(ISlaveServices & svc, ProcessImage & image)
virtual voidcaptureExitDiagnostics(ISlaveServices & svc)
End-of-run, after the RT thread has joined; safe to do SDO reads via svc.
virtual IMotionProfile *asMotion()
virtual IEncoderProfile *asEncoder()

Public Functions inherited from ecdev::IIoProfile

Name
virtual~IIoProfile() =default

Detailed Description

class ecdev::GenericIoProfile;

Protocol-agnostic digital/analog I/O profile.

Exposes a slave's mapped process data as typed channels through [IIoProfile](/lxmaster/api/classes/IIoProfile), which the IoModule facade wraps – with no dependence on CoE, a specific CiA profile, or any vendor object layout. Works for simple (non-CoE) terminals (e.g. Beckhoff EL2xxx/EL1xxx) as well as CoE I/O.

Channel model (purely structural, from the process image):

  • A PDO object in the CiA 401 digital area (0x6000-0x63FF) is treated as packed booleans and expanded to one digital channel per bit.
  • Any other 1-bit entry is a single digital channel (e.g. Beckhoff 0x7000:01 BOOL outputs).
  • Any wider entry is a scalar analog channel (8/16/32-bit). Direction follows the PDO (RxPDO = output, TxPDO = input).

Subclasses (e.g. [CiA401IoProfile](/lxmaster/api/classes/CiA401IoProfile)) may override [profileName()](/lxmaster/api/classes/GenericIoProfile#function-profilename) and add device-class specific setup; the channel logic here is shared.

Public Functions Documentation

function writeOutputs

virtual void writeOutputs(
ProcessImage & image,
std::uint64_t cycle_count
) override

Reimplements: ecdev::IDeviceProfile::writeOutputs

function setDigitalOutput

inline virtual void setDigitalOutput(
std::size_t channel,
bool value
) override

Command a digital output channel; out-of-range is a no-op.

Reimplements: ecdev::IIoProfile::setDigitalOutput

function setAnalogOutput

inline virtual void setAnalogOutput(
std::size_t channel,
std::int32_t value
) override

Command an analog output channel (raw counts); out-of-range is a no-op.

Reimplements: ecdev::IIoProfile::setAnalogOutput

function resolveTopology

inline virtual void resolveTopology(
const ProcessImage & image
) override

Resolve the static channel/PDO topology from the ENI-derived process image.

Reimplements: ecdev::IDeviceProfile::resolveTopology

Called once when the profile is attached to its device (during binding, before start()), so facade capability queries such as IIoProfile::digitalOutputCount() are valid as soon as the bus is bound — before any live PRE_OP SDO work. The image carries only ENI geometry here (it is not yet bound to the live IOmap), which is all a structural resolve needs. Default: no-op. Idempotent: configurePreOp may resolve again from the same image during start().

function readInputs

virtual void readInputs(
const ProcessImage & image,
bool wkc_valid,
bool operational
) override

Reimplements: ecdev::IDeviceProfile::readInputs

function profileName

inline virtual const char * profileName() const override

Stable identifier for diagnostics (e.g.

Reimplements: ecdev::IDeviceProfile::profileName

"CiA402-drive").

function digitalOutputCount

inline virtual std::size_t digitalOutputCount() const override

Reimplements: ecdev::IIoProfile::digitalOutputCount

function digitalOutput

inline virtual bool digitalOutput(
std::size_t ch
) const override

Reimplements: ecdev::IIoProfile::digitalOutput

function digitalInputCount

inline virtual std::size_t digitalInputCount() const override

Reimplements: ecdev::IIoProfile::digitalInputCount

function digitalInput

inline virtual bool digitalInput(
std::size_t channel
) const override

Read a digital input/output channel; out-of-range returns false.

Reimplements: ecdev::IIoProfile::digitalInput

function configurePreOp

virtual std::string configurePreOp(
ISlaveServices & svc,
ProcessImage & image
) override

Reimplements: ecdev::IDeviceProfile::configurePreOp

function asIo

inline virtual IIoProfile * asIo() override

Reimplements: ecdev::IDeviceProfile::asIo

function analogOutputCount

inline virtual std::size_t analogOutputCount() const override

Reimplements: ecdev::IIoProfile::analogOutputCount

function analogOutput

inline virtual std::int32_t analogOutput(
std::size_t ch
) const override

Reimplements: ecdev::IIoProfile::analogOutput

function analogInputCount

inline virtual std::size_t analogInputCount() const override

Reimplements: ecdev::IIoProfile::analogInputCount

function analogInput

inline virtual std::int32_t analogInput(
std::size_t channel
) const override

Read an analog input/output channel (raw counts); out-of-range returns 0.

Reimplements: ecdev::IIoProfile::analogInput

Public Attributes Documentation

variable kMaxDigital

static constexpr std::size_t kMaxDigital = 256;

variable kMaxAnalog

static constexpr std::size_t kMaxAnalog = 64;

Updated on 2026-07-04 at 23:28:44 +0000