Skip to main content
Version: 1.0.15

ecdev::CiA406EncoderProfile

CiA 406 (encoder) profile. More...

#include <cia406_encoder_profile.hpp>

Inherits from ecdev::IDeviceProfile, ecdev::IEncoderProfile, IDeviceLifecycle

Public Functions

Name
virtual std::int32_tvelocity() const override
Latest velocity value, if the sensor maps one (otherwise 0).
virtual std::uint16_tstatus() const override
Raw status/operating-status word, if mapped (otherwise 0).
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::int32_tposition() const override
Latest position value (counts) from the sensor.
virtual std::stringconfigurePreOp(ISlaveServices & svc, ProcessImage & image) override
virtual IEncoderProfile *asEncoder() override

Additional inherited members

Public Functions inherited from ecdev::IDeviceProfile

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 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 IIoProfile *asIo()

Public Functions inherited from ecdev::IEncoderProfile

Name
virtual~IEncoderProfile() =default

Detailed Description

class ecdev::CiA406EncoderProfile;

CiA 406 (encoder) profile.

Reads the position value (0x6004) and optional velocity/status into a lock-free snapshot exposed via [IEncoderProfile](/lxmaster/api/classes/IEncoderProfile) (wrapped by the Encoder facade). A read-only device class – another data point that the plugin model is not motion-specific.

Extending it: this class is intentionally NOT final. To add vendor/extra PDO variables (objects the ENI maps beyond the standard CiA406 set), subclass it, override the relevant lifecycle method (typically readInputs, and optionally configurePreOp), and CHAIN to the base (CiA406EncoderProfile::readInputs(...)) before doing your own work. Resolve your extra objects with ProcessImage::resolve(index, sub) and publish them to application threads through your own lock-free state (atomics). Encoder keeps working unchanged because the subclass inherits this profile's asEncoder(). The application reaches the subclass via ecfacade::DeviceFacade::deviceProfile().

Public Functions Documentation

function velocity

inline virtual std::int32_t velocity() const override

Latest velocity value, if the sensor maps one (otherwise 0).

Reimplements: ecdev::IEncoderProfile::velocity

function status

inline virtual std::uint16_t status() const override

Raw status/operating-status word, if mapped (otherwise 0).

Reimplements: ecdev::IEncoderProfile::status

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 position

inline virtual std::int32_t position() const override

Latest position value (counts) from the sensor.

Reimplements: ecdev::IEncoderProfile::position

function configurePreOp

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

Reimplements: ecdev::IDeviceProfile::configurePreOp

function asEncoder

inline virtual IEncoderProfile * asEncoder() override

Reimplements: ecdev::IDeviceProfile::asEncoder


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