Skip to main content
Version: 1.0.15

ecdev::IDeviceProfile

Device-class behaviour plugged onto a [GenericEniDevice]. More...

#include <device_profile.hpp>

Inherits from IDeviceLifecycle

Inherited by ecdev::CiA402DriveProfile, ecdev::CiA406EncoderProfile, ecdev::GenericIoProfile

Public Functions

Name
~IDeviceProfile() override =default
virtual voidwriteOutputs(ProcessImage & image, std::uint64_t cycle_count)
virtual voidresolveTopology(const ProcessImage & image)
Resolve the static channel/PDO topology from the ENI-derived process image.
virtual voidreadInputs(const ProcessImage & image, bool wkc_valid, bool operational)
virtual const char *profileName() const =0
Stable identifier for diagnostics (e.g.
virtual voidprimeOutputs(ProcessImage & image)
virtual std::stringprepareSafeOp(ISlaveServices & svc, ProcessImage & image)
virtual std::stringconfigurePreOp(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 IIoProfile *asIo()
virtual IEncoderProfile *asEncoder()

Detailed Description

class ecdev::IDeviceProfile;

Device-class behaviour plugged onto a [GenericEniDevice].

A profile understands the PDO semantics of one EtherCAT device class (CiA 402 drive, CiA 401 digital/analog I/O, CiA 406 encoder, ...) and nothing about the backend, the ENI XML, or the master. It interacts with the world through exactly two narrow contracts:

  • [ISlaveServices] for setup-time SDO / register / PDO-pulse work (NOT on the RT path).
  • [ProcessImage] for per-cycle reads/writes of mapped objects (RT path).

Selection is done by a [ProfileRegistry](/lxmaster/api/classes/ProfileRegistry); a new device class is added by registering a new profile, with no change to the generic device or the orchestration layer.

Threading: configurePreOp/prepareSafeOp/shutdown hooks run on the bring-up/shutdown thread while the bus is not in OPERATIONAL; writeOutputs/readInputs run on the RT cyclic thread. A profile that exposes data to application threads must do so through its own lock-free state (e.g. atomics), exactly as the facades expect.

Public Functions Documentation

function ~IDeviceProfile

~IDeviceProfile() override =default

function writeOutputs

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

Reimplemented by: ecdev::CiA402DriveProfile::writeOutputs, ecdev::GenericIoProfile::writeOutputs

function resolveTopology

inline virtual void resolveTopology(
const ProcessImage & image
)

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

Reimplemented by: ecdev::GenericIoProfile::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

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

Reimplemented by: ecdev::CiA402DriveProfile::readInputs, ecdev::CiA406EncoderProfile::readInputs, ecdev::GenericIoProfile::readInputs

function profileName

virtual const char * profileName() const =0

Stable identifier for diagnostics (e.g.

Reimplemented by: ecdev::CiA401IoProfile::profileName, ecdev::CiA402DriveProfile::profileName, ecdev::CiA406EncoderProfile::profileName, ecdev::GenericIoProfile::profileName

"CiA402-drive").

function primeOutputs

inline virtual void primeOutputs(
ProcessImage & image
)

Reimplemented by: ecdev::CiA402DriveProfile::primeOutputs

function prepareSafeOp

inline virtual std::string prepareSafeOp(
ISlaveServices & svc,
ProcessImage & image
)

Reimplemented by: ecdev::CiA402DriveProfile::prepareSafeOp

function configurePreOp

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

Reimplemented by: ecdev::CiA402DriveProfile::configurePreOp, ecdev::CiA406EncoderProfile::configurePreOp, ecdev::GenericIoProfile::configurePreOp

function captureExitDiagnostics

inline virtual void captureExitDiagnostics(
ISlaveServices & svc
)

End-of-run, after the RT thread has joined; safe to do SDO reads via svc.

Reimplemented by: ecdev::CiA402DriveProfile::captureExitDiagnostics

function asMotion

inline virtual IMotionProfile * asMotion()

Reimplemented by: ecdev::CiA402DriveProfile::asMotion

function asIo

inline virtual IIoProfile * asIo()

Reimplemented by: ecdev::GenericIoProfile::asIo

function asEncoder

inline virtual IEncoderProfile * asEncoder()

Reimplemented by: ecdev::CiA406EncoderProfile::asEncoder


Updated on 2026-07-06 at 04:47:20 +0000