Expand description
Parses and generates POWERLINK XDC (XML Device Configuration) files.
This no_std + alloc library provides type-safe parsing and serialization
for POWERLINK XDC (Configuration Manager) data based on the EPSG DS 311 specification.
It provides the following main capabilities:
- Parsing: Loading
.xdcor.xddXML strings into strongly-typed Rust structures. - Resolution: Resolving complex inheritance,
uniqueIDReflinks, and templates defined in the Application Process. - Serialization: generating minimal valid XDC XML strings from Rust structures.
- Core Integration: Converting the parsed data into the
ObjectDictionaryformat required by thepowerlink-rscore stack.
Structs§
- AddInfo
- Represents one
<addInfo>element. - Allowed
Values - Represents
<allowedValues>for a parameter. - AppArray
- Represents an
<array>data type. - AppDerived
- Represents a
<derived>data type. - AppEnum
- Represents an
<enum>data type. - AppStruct
- Represents a
<struct>data type. - Application
Process - Represents the
<ApplicationProcess>block, defining application parameters and types. - Capabilities
- Represents the
<capabilities>element. (EPSG DS 311, 7.4.6.2) - Characteristic
- Represents a single
<characteristic>. (EPSG DS 311, 7.4.6.2.2.2) - Characteristic
List - Represents a
<characteristicsList>, grouping characteristics by category. (EPSG DS 311, 7.4.6.2.2) - Classification
- Represents a
<classification>element. (EPSG DS 311, 7.4.6.7) - CnFeatures
- Represents
<CNFeatures>, specific to Controlled Nodes. - Combined
State - Represents a state composed of multiple LEDs (e.g., “Error Stop”).
- Connected
Module - Represents a
<connectedModule>entry, linking a slot to a child module. - Connector
- Represents a
<connector>element. (EPSG DS 311, 7.4.6.5) - Count
- Represents a
<count>element within a derived type. - Device
Function - Represents the
<DeviceFunction>block. (EPSG DS 311, 7.4.6) - Device
Manager - Represents the
<DeviceManager>block. - Diagnostic
- Represents
<Diagnostic>capabilities. - Dictionary
- Represents a
<dictionary>element for external text resources. (EPSG DS 311, 7.4.6.4) - Enum
Value - Represents a single
<enumValue>. - Error
Definition - Represents one
<Error>entry in the<ErrorList>. - Firmware
- Represents a
<firmware>element. (EPSG DS 311, 7.4.6.6) - Function
Instance - Represents a
<functionInstance>. - Function
Type - Represents a
<functionType>. - General
Features - Represents
<GeneralFeatures>. - Identity
- Represents the
<DeviceIdentity>block. - Indicator
List - Represents an
<indicatorList>containing LED definitions. - Interface
Comm - Represents an
<interface>in the Communication profile, mapping hardware interfaces to OD ranges. - Interface
Device - Represents an
<interface>on a modular head (Device profile). - Interface
List - Represents an
<interfaceList>. - LED
- Represents a single
<LED>indicator. - LEDstate
- Represents a single state for a specific
<LED>(e.g., “flashing red”). - MnFeatures
- Represents
<MNFeatures>, specific to Managing Nodes. - Module
Interface - Represents a
<moduleInterface>(properties of a child module). - Module
Management Comm - Represents the
<moduleManagement>block from the Communication profile. - Module
Management Device - Represents the
<moduleManagement>block from the Device profile. - Network
Management - Represents the
<NetworkManagement>block. - NmtSettings
- Configuration settings for the NMT (Network Management) state machine,
extracted from the XDC profile’s
<NetworkManagement>block. - Object
- Represents a single
<Object>(an OD Index). - Object
Dictionary - Represents the complete
<ObjectList>(Object Dictionary). - Parameter
Group - Represents a
<parameterGroup>. - Parameter
Ref - Represents a reference to a parameter within a group.
- Picture
- Represents a
<picture>element. (EPSG DS 311, 7.4.6.3) - Profile
Header - Represents the
<ProfileHeader>block, containing file metadata. - Range
- Represents a
<range>of OD indices for a modular interface. - Standard
Compliance - Represents a
<compliantWith>element describing standard compliance. (EPSG DS 311, 7.4.6.2.2.5) - Static
Error Bit - Represents one
<ErrorBit>from the<StaticErrorBitField>. - Struct
Member - Represents a
<varDeclaration>within a struct. - SubObject
- Represents a
<SubObject>(an OD Sub-Index). - Value
- Represents a single
<value>. - Value
Range - Represents a
<range>. - VarDeclaration
- Represents a
<varDeclaration>in an interface list. - Version
- Represents a
<version>element. - Version
Info - Represents a
<versionInfo>element. - XdcFile
- Represents a fully parsed and resolved XDC/XDD file.
Enums§
- AppData
Type - Enum representing user-defined data types from
<dataTypeList>. - NmtCn
Dna - Public representation of the
NMTCNDNAattribute (Dynamic Node Addressing). - Object
PdoMapping - PDO mapping capabilities.
- Parameter
Access - Access types for an Object Dictionary entry.
- Parameter
Group Item - An item inside a
<parameterGroup>. - Parameter
Support - Support level for an Object Dictionary entry.
- XdcError
- Errors that can occur during XDC parsing, validation, or serialization.
Functions§
- extract_
nmt_ settings - Extracts NMT configuration settings from the parsed XDC file.
- load_
xdc_ from_ str - Loads XDC data from an XML string, prioritizing
actualValueattributes. - load_
xdd_ defaults_ from_ str - Loads XDD data from an XML string, prioritizing
defaultValueattributes. - save_
xdc_ to_ string - Serializes an
XdcFiledata structure into a standard XDC XML string. - to_
core_ od - Converts a parsed
XdcFileinto the runtimeObjectDictionary. - xdc_
to_ storage_ map - Extracts storable parameters from the XDC file into a flat map.