Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
mm::etg::EsiEntry Struct Reference

One (index, subindex) row of a device's fully expanded object dictionary. More...

#include <esi_entry.h>

Collaboration diagram for mm::etg::EsiEntry:
[legend]

Public Member Functions

uint32_t key () const
 Packed (index << 8) | subindex — the same key as mm::node::makeParameterKey.
 

Public Attributes

uint16_t index = 0
 Effective CoE index, with any slot offset applied.
 
uint8_t subindex = 0
 CoE subindex.
 
uint16_t rawIndex = 0
 The index exactly as written in the source dictionary.
 
std::string objectName
 Object/Name — identical across every subindex of an object.
 
std::string entryName
 This subindex's own name; equals objectName for a VAR.
 
std::string displayName
 Info/DisplayName when the ESI overrides it, else entryName.
 
ObjectCode objectCode = ObjectCode::Var
 
uint8_t numberOfEntries = 0
 The subindex-0 value (highest subindex); 0 for a VAR.
 
std::string dataTypeName
 Resolved ESI type name, e.g. "UDINT", "STRING(50)".
 
uint16_t dataType = 0
 ETG.1020 code; 0 when the name could not be resolved.
 
ValueKind valueKind = ValueKind::Bytes
 The C++ type this entry's value maps to (resolveValueKind of dataType and bitSize).
 
bool isSigned = false
 
uint16_t bitSize = 0
 Width of this entry.
 
uint16_t bitOffset = 0
 Offset within the object's complete-access image.
 
std::optional< std::vector< uint8_t > > defaultData
 Raw bytes, first byte least significant.
 
std::optional< std::vector< uint8_t > > minData
 
std::optional< std::vector< uint8_t > > maxData
 
std::optional< uint32_t > unit
 Packed ETG.1004 notation value, e.g. 0xFD260000.
 
std::string unitSymbol
 Rendered symbol, e.g. "mV"; empty when unresolvable.
 
Access access {}
 Resolved mode plus read/write AL-state restrictions.
 
Category category = Category::Optional
 
PdoMapping pdoMapping = PdoMapping::None
 
SafetyMapping safetyMapping = SafetyMapping::None
 
SdoAccess sdoAccess = SdoAccess::SubIndexAccess
 
bool backup = false
 
bool setting = false
 
std::optional< uint32_t > attribute
 SoE IDN, when declared.
 
uint16_t objAccess = 0
 ETG.1000.6 ObjAccess bitfield synthesised from the resolved flags.
 
std::vector< Propertyproperties
 Every <Property> as written, for whatever this row describes.
 
std::string description
 The "description" property of properties, decoded to text.
 
std::vector< EsiEnumOptionoptions
 
EsiEntrySource source
 

Detailed Description

One (index, subindex) row of a device's fully expanded object dictionary.

This is the library's deliverable: a flat vector of these describes every addressable CoE entry a configured device exposes, merged across its own dictionary and every module in its slots, with the ETG.2000 rules for flag inheritance, subindex derivation and type resolution already applied.

Values are raw little-endian bytes plus an ETG.1020 type code, deliberately — the same convention mm::comm::OdEntry documents. Decoding into a typed variant belongs to the node layer (mm::node::decodeSdoBytes(dataType, bytes)), which is what keeps mm::etg free of any dependency on mm::comm or mm::node. Note that a byte-wise comparison of minData against maxData is wrong for a signed type — minData "FF" on a SINT is −1, which sorts above maxData "01" as bytes. Interpret both through dataType first.

Member Function Documentation

◆ key()

uint32_t mm::etg::EsiEntry::key ( ) const
inline

Packed (index << 8) | subindex — the same key as mm::node::makeParameterKey.

Member Data Documentation

◆ access

Access mm::etg::EsiEntry::access {}

Resolved mode plus read/write AL-state restrictions.

◆ attribute

std::optional<uint32_t> mm::etg::EsiEntry::attribute

SoE IDN, when declared.

◆ backup

bool mm::etg::EsiEntry::backup = false

◆ bitOffset

uint16_t mm::etg::EsiEntry::bitOffset = 0

Offset within the object's complete-access image.

◆ bitSize

uint16_t mm::etg::EsiEntry::bitSize = 0

Width of this entry.

◆ category

Category mm::etg::EsiEntry::category = Category::Optional

◆ dataType

uint16_t mm::etg::EsiEntry::dataType = 0

ETG.1020 code; 0 when the name could not be resolved.

◆ dataTypeName

std::string mm::etg::EsiEntry::dataTypeName

Resolved ESI type name, e.g. "UDINT", "STRING(50)".

◆ defaultData

std::optional<std::vector<uint8_t> > mm::etg::EsiEntry::defaultData

Raw bytes, first byte least significant.

◆ description

std::string mm::etg::EsiEntry::description

The "description" property of properties, decoded to text.

◆ displayName

std::string mm::etg::EsiEntry::displayName

Info/DisplayName when the ESI overrides it, else entryName.

◆ entryName

std::string mm::etg::EsiEntry::entryName

This subindex's own name; equals objectName for a VAR.

◆ index

uint16_t mm::etg::EsiEntry::index = 0

Effective CoE index, with any slot offset applied.

◆ isSigned

bool mm::etg::EsiEntry::isSigned = false

Whether minData / maxData / defaultData are two's complement — needed to compare or render them correctly.

◆ maxData

std::optional<std::vector<uint8_t> > mm::etg::EsiEntry::maxData

◆ minData

std::optional<std::vector<uint8_t> > mm::etg::EsiEntry::minData

◆ numberOfEntries

uint8_t mm::etg::EsiEntry::numberOfEntries = 0

The subindex-0 value (highest subindex); 0 for a VAR.

◆ objAccess

uint16_t mm::etg::EsiEntry::objAccess = 0

ETG.1000.6 ObjAccess bitfield synthesised from the resolved flags.

Bits 0-2 readable in PreOP/SafeOP/OP, 3-5 writable in PreOP/SafeOP/OP, 6 RxPDO-mappable, 7 TxPDO-mappable, 8 backup, 9 setting. Provided so an entry drops straight into mm::node::DeviceParameter::access and its isReadable() without a second conversion.

◆ objectCode

ObjectCode mm::etg::EsiEntry::objectCode = ObjectCode::Var

VAR / ARRAY / RECORD. The enum's underlying value is the CoE object code (7/8/9), so it assigns straight to mm::node::DeviceParameter::objectCode.

◆ objectName

std::string mm::etg::EsiEntry::objectName

Object/Name — identical across every subindex of an object.

◆ options

std::vector<EsiEnumOption> mm::etg::EsiEntry::options

◆ pdoMapping

PdoMapping mm::etg::EsiEntry::pdoMapping = PdoMapping::None

◆ properties

std::vector<Property> mm::etg::EsiEntry::properties

Every <Property> as written, for whatever this row describes.

<Property> is the format's generic annotation mechanism, so these are carried verbatim and a vendor that uses names other than Synapticon's loses nothing. description and options below are conveniences decoded from this vector for the two conventional names; both are empty for such a vendor, whose data is still right here.

Subindex 0 describes the object itself, so on that row this is the object's own annotation (the Object's for a VAR, the DataType's for an ARRAY or RECORD). Every other row carries only what that specific entry declares — which for a RECORD member is its own description, and for an ARRAY element is nothing, since the ESI describes an array once rather than per element. Object-level text is therefore stored once, not repeated onto every subindex: look it up on subindex 0 of the same index.

◆ rawIndex

uint16_t mm::etg::EsiEntry::rawIndex = 0

The index exactly as written in the source dictionary.

◆ safetyMapping

SafetyMapping mm::etg::EsiEntry::safetyMapping = SafetyMapping::None

◆ sdoAccess

SdoAccess mm::etg::EsiEntry::sdoAccess = SdoAccess::SubIndexAccess

◆ setting

bool mm::etg::EsiEntry::setting = false

◆ source

EsiEntrySource mm::etg::EsiEntry::source

◆ subindex

uint8_t mm::etg::EsiEntry::subindex = 0

CoE subindex.

◆ unit

std::optional<uint32_t> mm::etg::EsiEntry::unit

Packed ETG.1004 notation value, e.g. 0xFD260000.

◆ unitSymbol

std::string mm::etg::EsiEntry::unitSymbol

Rendered symbol, e.g. "mV"; empty when unresolvable.

◆ valueKind

ValueKind mm::etg::EsiEntry::valueKind = ValueKind::Bytes

The C++ type this entry's value maps to (resolveValueKind of dataType and bitSize).

Precomputed here for the same reason unitSymbol is: it is derived from two other fields by a rule with a trap in it — a width that contradicts its type code means the entry is bytes, not the scalar the code names — and every consumer deriving it independently is how one of them gets it wrong.


The documentation for this struct was generated from the following file: