EdsDcfNet 1.7.1

dotnet add package EdsDcfNet --version 1.7.1
                    
NuGet\Install-Package EdsDcfNet -Version 1.7.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EdsDcfNet" Version="1.7.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EdsDcfNet" Version="1.7.1" />
                    
Directory.Packages.props
<PackageReference Include="EdsDcfNet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EdsDcfNet --version 1.7.1
                    
#r "nuget: EdsDcfNet, 1.7.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EdsDcfNet@1.7.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EdsDcfNet&version=1.7.1
                    
Install as a Cake Addin
#tool nuget:?package=EdsDcfNet&version=1.7.1
                    
Install as a Cake Tool

EdsDcfNet

Build Status Semantic Release NuGet Version NuGet Downloads License: MIT codecov

A comprehensive, easy-to-use C# .NET library for CANopen file formats: CiA DS 306 (EDS, DCF, CPJ) and CiA 311 (XDD, XDC).

Features

โœจ Simple API - Intuitive, fluent API style for quick integration

๐Ÿ“– Read & Write EDS - Parse and generate Electronic Data Sheets

๐Ÿ“ Read & Write DCF - Process and create Device Configuration Files

๐ŸŒ Read & Write CPJ - Parse and create Nodelist Project files (CiA 306-3 network topologies)

๐Ÿงฉ Read & Write XDD/XDC - Parse and generate CiA 311 XML device descriptions/configurations

๐Ÿ”„ EDS to DCF Conversion - Easy conversion with configuration parameters

๐ŸŽฏ Type-Safe - Fully typed models for all CANopen objects

๐Ÿ“ฆ Modular - Support for modular devices (bus couplers + modules)

โœ… CiA DS 306 v1.4 / CiA 311 v1.1 Compliant - Implemented according to official specification

Quick Start

Reading an EDS File

using EdsDcfNet;

// Read EDS file
var eds = CanOpenFile.ReadEds("device.eds");

// Display device information
Console.WriteLine($"Device: {eds.DeviceInfo.ProductName}");
Console.WriteLine($"Vendor: {eds.DeviceInfo.VendorName}");
Console.WriteLine($"Product Number: 0x{eds.DeviceInfo.ProductNumber:X}");

Writing an EDS File

using EdsDcfNet;

var eds = CanOpenFile.ReadEds("device.eds");
eds.FileInfo.FileRevision++;
CanOpenFile.WriteEds(eds, "device_updated.eds");

Async File I/O (async/await)

using EdsDcfNet;
using System.Threading;

using var cts = new CancellationTokenSource();

var eds = await CanOpenFile.ReadEdsAsync("device.eds", cts.Token);
eds.FileInfo.FileRevision++;
await CanOpenFile.WriteEdsAsync(eds, "device_updated.eds", cts.Token);

Reading an XDD File (CiA 311 XML)

using EdsDcfNet;

// Read XDD file
var xdd = CanOpenFile.ReadXdd("device.xdd");

Console.WriteLine($"Device: {xdd.DeviceInfo.ProductName}");
Console.WriteLine($"Vendor: {xdd.DeviceInfo.VendorName}");

Reading a DCF File

using EdsDcfNet;

// Read DCF file
var dcf = CanOpenFile.ReadDcf("configured_device.dcf");

Console.WriteLine($"Node ID: {dcf.DeviceCommissioning.NodeId}");
Console.WriteLine($"Baudrate: {dcf.DeviceCommissioning.Baudrate} kbit/s");

Reading an XDC File (CiA 311 XML)

using EdsDcfNet;

// Read XDC file
var xdc = CanOpenFile.ReadXdc("configured_device.xdc");

Console.WriteLine($"Node ID: {xdc.DeviceCommissioning.NodeId}");
Console.WriteLine($"Baudrate: {xdc.DeviceCommissioning.Baudrate} kbit/s");

Working with ApplicationProcess (CiA 311 ยง6.4.5)

XDD/XDC files may include an ApplicationProcess element describing device parameters at the application level. The typed model gives full programmatic access to all sub-constructs.

using EdsDcfNet;

var xdd = CanOpenFile.ReadXdd("device.xdd");

if (xdd.ApplicationProcess is { } ap)
{
    // Iterate parameters
    foreach (var param in ap.ParameterList)
    {
        var displayName = param.LabelGroup.GetDisplayName() ?? param.UniqueId;
        Console.WriteLine($"Parameter: {displayName}");
    }

    // Inspect data type definitions
    if (ap.DataTypeList is { } dtl)
    {
        foreach (var enumType in dtl.Enums)
            Console.WriteLine($"Enum type: {enumType.Name}");
    }
}

Converting EDS to DCF

using EdsDcfNet;

// Read EDS
var eds = CanOpenFile.ReadEds("device.eds");

// Convert to DCF with node ID and baudrate
var dcf = CanOpenFile.EdsToDcf(eds, nodeId: 2, baudrate: 500, nodeName: "MyDevice");

// Save DCF
CanOpenFile.WriteDcf(dcf, "device_node2.dcf");

Working with Nodelist Projects (CPJ)

using EdsDcfNet;
using EdsDcfNet.Models;

// Read a CPJ file describing the network topology
var cpj = CanOpenFile.ReadCpj("nodelist.cpj");

foreach (var network in cpj.Networks)
{
    Console.WriteLine($"Network: {network.NetName}");
    foreach (var node in network.Nodes.Values)
    {
        Console.WriteLine($"  Node {node.NodeId}: {node.Name} ({node.DcfFileName})");
    }
}

// Create a new CPJ
var project = new NodelistProject();
project.Networks.Add(new NetworkTopology
{
    NetName = "Production Line 1",
    Nodes =
    {
        [2] = new NetworkNode { NodeId = 2, Present = true, Name = "PLC", DcfFileName = "plc.dcf" },
        [3] = new NetworkNode { NodeId = 3, Present = true, Name = "IO Module", DcfFileName = "io.dcf" }
    }
});
CanOpenFile.WriteCpj(project, "network.cpj");

Working with Object Dictionary

using EdsDcfNet.Extensions;

var dcf = CanOpenFile.ReadDcf("device.dcf");

// Get object
var deviceType = dcf.ObjectDictionary.GetObject(0x1000);

// Set value (returns true if object exists, false if not found)
bool set = dcf.ObjectDictionary.SetParameterValue(0x1000, "0x00000191");

// Browse PDO objects
var tpdos = dcf.ObjectDictionary.GetPdoCommunicationParameters(transmit: true);

API Overview

Main Class: CanOpenFile

// Read EDS
ElectronicDataSheet ReadEds(string filePath)
Task<ElectronicDataSheet> ReadEdsAsync(string filePath, CancellationToken cancellationToken = default)
ElectronicDataSheet ReadEdsFromString(string content)

// Write EDS
void WriteEds(ElectronicDataSheet eds, string filePath)
Task WriteEdsAsync(ElectronicDataSheet eds, string filePath, CancellationToken cancellationToken = default)
string WriteEdsToString(ElectronicDataSheet eds)

// Read DCF
DeviceConfigurationFile ReadDcf(string filePath)
Task<DeviceConfigurationFile> ReadDcfAsync(string filePath, CancellationToken cancellationToken = default)
DeviceConfigurationFile ReadDcfFromString(string content)

// Write DCF
void WriteDcf(DeviceConfigurationFile dcf, string filePath)
Task WriteDcfAsync(DeviceConfigurationFile dcf, string filePath, CancellationToken cancellationToken = default)
string WriteDcfToString(DeviceConfigurationFile dcf)

// Read CPJ (CiA 306-3 Nodelist Project)
NodelistProject ReadCpj(string filePath)
Task<NodelistProject> ReadCpjAsync(string filePath, CancellationToken cancellationToken = default)
NodelistProject ReadCpjFromString(string content)

// Write CPJ
void WriteCpj(NodelistProject cpj, string filePath)
Task WriteCpjAsync(NodelistProject cpj, string filePath, CancellationToken cancellationToken = default)
string WriteCpjToString(NodelistProject cpj)

// Read XDD (CiA 311 XML Device Description)
ElectronicDataSheet ReadXdd(string filePath)
Task<ElectronicDataSheet> ReadXddAsync(string filePath, CancellationToken cancellationToken = default)
ElectronicDataSheet ReadXddFromString(string content)

// Write XDD
void WriteXdd(ElectronicDataSheet xdd, string filePath)
Task WriteXddAsync(ElectronicDataSheet xdd, string filePath, CancellationToken cancellationToken = default)
string WriteXddToString(ElectronicDataSheet xdd)

// Read XDC (CiA 311 XML Device Configuration)
DeviceConfigurationFile ReadXdc(string filePath)
Task<DeviceConfigurationFile> ReadXdcAsync(string filePath, CancellationToken cancellationToken = default)
DeviceConfigurationFile ReadXdcFromString(string content)

// Write XDC
void WriteXdc(DeviceConfigurationFile xdc, string filePath)
Task WriteXdcAsync(DeviceConfigurationFile xdc, string filePath, CancellationToken cancellationToken = default)
string WriteXdcToString(DeviceConfigurationFile xdc)

// Convert EDS to DCF
DeviceConfigurationFile EdsToDcf(ElectronicDataSheet eds, byte nodeId,
                                  ushort baudrate = 250, string? nodeName = null)

Supported Features

  • โœ… Complete EDS parsing and writing
  • โœ… Complete DCF parsing and writing
  • โœ… CPJ nodelist project parsing and writing (CiA 306-3 network topologies)
  • โœ… XDD parsing and writing (CiA 311 XML device description)
  • โœ… XDC parsing and writing (CiA 311 XML device configuration)
  • โœ… All Object Types (NULL, DOMAIN, DEFTYPE, DEFSTRUCT, VAR, ARRAY, RECORD)
  • โœ… Sub-objects and sub-indexes
  • โœ… Compact Storage (CompactSubObj, CompactPDO)
  • โœ… Object Links
  • โœ… Modular device concept
  • โœ… Hexadecimal, decimal, and octal numbers
  • โœ… $NODEID formula evaluation (e.g., $NODEID+0x200)
  • โœ… CANopen Safety (EN 50325-5) - SRDOMapping, InvertedSRAD
  • โœ… Comments and additional sections

Examples

Complete examples can be found in the examples/EdsDcfNet.Examples project.

Project Structure

eds-dcf-net/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ EdsDcfNet/              # Main library
โ”‚       โ”œโ”€โ”€ Models/             # Data models
โ”‚       โ”œโ”€โ”€ Parsers/            # EDS/DCF/CPJ/XDD/XDC parsers
โ”‚       โ”œโ”€โ”€ Writers/            # EDS/DCF/CPJ/XDD/XDC writers
โ”‚       โ”œโ”€โ”€ Utilities/          # Helper classes
โ”‚       โ”œโ”€โ”€ Exceptions/         # Custom exceptions
โ”‚       โ””โ”€โ”€ Extensions/         # Extension methods
โ”œโ”€โ”€ examples/
โ”‚   โ””โ”€โ”€ EdsDcfNet.Examples/     # Example application
โ””โ”€โ”€ docs/
    โ”œโ”€โ”€ architecture/           # ARC42 software architecture
    โ””โ”€โ”€ cia/                    # CiA DS 306 specification

Requirements

For consuming the NuGet package:

  • Any .NET implementation compatible with .NET Standard 2.0 (e.g., .NET Framework 4.6.1+, .NET Core 2.0+, .NET 5+, Unity, Xamarin)

For building this repository (library, tests, examples):

  • .NET SDK 10.0 or higher
  • C# 13.0 (as provided by the .NET 10 SDK)

License

MIT License - see LICENSE file

Specification

Based on:

  • CiA DS 306 Version 1.4.0 (December 15, 2021)
  • CiA 311 XML device description/configuration concepts (XDD/XDC)

Support

For questions or issues:


EdsDcfNet - Professional CANopen EDS/DCF/CPJ/XDD/XDC processing in C# .NET

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.7.1 0 3/4/2026
1.7.1-beta.1 0 3/4/2026
1.7.0 86 2/28/2026
1.7.0-beta.2 35 2/28/2026
1.7.0-beta.1 39 2/28/2026
1.6.2-beta.2 39 2/28/2026
1.6.2-beta.1 36 2/28/2026
1.6.1 87 2/28/2026
1.6.1-beta.1 37 2/28/2026
1.6.0 86 2/28/2026
1.6.0-beta.1 39 2/27/2026
1.5.0 87 2/26/2026
1.5.0-beta.4 37 2/25/2026
1.5.0-beta.3 40 2/24/2026
1.5.0-beta.2 37 2/23/2026
1.5.0-beta.1 38 2/23/2026
1.4.8 131 2/21/2026
1.4.8-beta.1 44 2/21/2026
1.4.7 83 2/21/2026
1.4.6 82 2/21/2026
Loading failed