Skip to content

CanOpenDeviceDescription Class

A CiA 306 device description — an EDS (electronic data sheet) or a DCF (device configuration file) — read with the maintainer's EdsDcfNet library and ready to be applied to a node: OpenNode(ICanBus, byte, CanOpenDeviceDescription, CanOpenNodeOptions) creates the node's object dictionary and its PDO, SYNC, EMCY, heartbeat and guarding configuration from it, and reports in DeviceDescriptionReport what it could not take as written.

public sealed class CanOpenDeviceDescription

Inheritance Object → CanOpenDeviceDescription

Remarks

The description is the source of the node's power-on values: an NMT Reset Communication returns the communication profile area to what the file says, an NMT Reset Node the application objects as well, unless the application stored other values since (StoreParameters()). A DCF's ParameterValue takes precedence over the DefaultValue of the EDS it was made from, and its NodeID is the node-id OpenNode(ICanBus, CanOpenDeviceDescription, CanOpenNodeOptions) uses. $NODEID+… expressions are evaluated against the node-id the node is opened with. The same type is what BindPeerDeviceDescription(byte, CanOpenDeviceDescription) binds for a remote node: the SDO client then transfers only pairs Contains(ushort, byte) reports. A DCF binds only to the node-id it was commissioned for; an EDS binds to any node.

Properties

CanOpenDeviceDescription.Dcf Property

The DCF model, when the description is a DCF.

public EdsDcfNet.Models.DeviceConfigurationFile? Dcf { get; }

Property Value

DeviceConfigurationFile

CanOpenDeviceDescription.DeviceInfo Property

The device information section of the description.

public EdsDcfNet.Models.DeviceInfo DeviceInfo { get; }

Property Value

DeviceInfo

CanOpenDeviceDescription.Eds Property

The EDS model, when the description is an EDS.

public EdsDcfNet.Models.ElectronicDataSheet? Eds { get; }

Property Value

ElectronicDataSheet

CanOpenDeviceDescription.IsConfigurationFile Property

Whether the description is a DCF (a commissioned device) rather than an EDS.

public bool IsConfigurationFile { get; }

Property Value

Boolean

CanOpenDeviceDescription.NodeId Property

The node-id a DCF was commissioned for ([DeviceComissioning] NodeID); null for an EDS, which describes a device type rather than a node.

public System.Nullable<byte> NodeId { get; }

Property Value

Nullable<Byte>

CanOpenDeviceDescription.Objects Property

The object dictionary the description declares (the EdsDcfNet model, not the node's ObjectDictionary). Mutable: an edit in place is seen from the next call that reads the description. Nothing synchronizes those readers — the peer-SDO gate on every SDO call to the peer this description is bound for, the loader, the foreign PDO and SRDO observers, a safety transaction's reading at its start — with an edit, so edit only while no such call is running. An edit during one is not supported and what that call sees is not specified: the EdsDcfNet dictionaries are not safe for a read concurrent with a write, so a reader that enumerates may fail with the dictionary's InvalidOperationException, reported as that call's failure, and a reader that looks objects up one at a time around its own awaits may answer from a description that is part old and part new, or find no match, with no error.

public EdsDcfNet.Models.ObjectDictionary Objects { get; }

Property Value

ObjectDictionary

CanOpenDeviceDescription.ParseDiagnostics Property

What the parser repaired or tolerated while reading the file (lenient mode); empty when the file was clean. These describe the file, not this node.

public System.Collections.Generic.IReadOnlyList<EdsDcfNet.Diagnostics.ParseDiagnostic> ParseDiagnostics { get; }

Property Value

IReadOnlyList<ParseDiagnostic>

Methods

CanOpenDeviceDescription.Contains(ushort, byte) Method

Whether the description declares index:subindex.

public bool Contains(ushort index, byte subindex);

Parameters

index UInt16

subindex Byte

Returns

Boolean

Remarks

A variable or domain (no sub-objects) is sub-index 0. A record or array is the sub-indices the file actually carries, including those compact storage synthesized. A sub-index the file does not list is absent even when the index itself is present.

CanOpenDeviceDescription.FromDcf(DeviceConfigurationFile) Method

Wraps an already-parsed DCF.

public static CanKit.Pro.CANopen.CanOpenDeviceDescription FromDcf(EdsDcfNet.Models.DeviceConfigurationFile dcf);

Parameters

dcf DeviceConfigurationFile

Returns

CanOpenDeviceDescription

CanOpenDeviceDescription.FromEds(ElectronicDataSheet) Method

Wraps an already-parsed EDS.

public static CanKit.Pro.CANopen.CanOpenDeviceDescription FromEds(EdsDcfNet.Models.ElectronicDataSheet eds);

Parameters

eds ElectronicDataSheet

Returns

CanOpenDeviceDescription

CanOpenDeviceDescription.Load(string) Method

Reads an EDS or DCF file; the extension decides which (.dcf is a DCF, anything else an EDS).

public static CanKit.Pro.CANopen.CanOpenDeviceDescription Load(string path);

Parameters

path String

Returns

CanOpenDeviceDescription

Exceptions

EdsParseException
The file is not a readable description. A $NODEID formula in an integer header entry such as VendorNumber is not this failure on the default read: the description is returned and the formula is recorded in ParseDiagnostics. Strict parsing still throws.

CanOpenDeviceDescription.ParseDcf(string) Method

Parses DCF content.

public static CanKit.Pro.CANopen.CanOpenDeviceDescription ParseDcf(string content);

Parameters

content String

Returns

CanOpenDeviceDescription

Exceptions

EdsParseException
The content is not a readable description, as for Load(string).

CanOpenDeviceDescription.ParseEds(string) Method

Parses EDS content.

public static CanKit.Pro.CANopen.CanOpenDeviceDescription ParseEds(string content);

Parameters

content String

Returns

CanOpenDeviceDescription

Exceptions

EdsParseException
The content is not a readable description, as for Load(string).