Skip to content

PdoMappingEntry Struct

A single entry in a PDO mapping: reference to an OD (index, subindex) plus the number of bits contributed to the assembled PDO payload. Bits are packed LSB first without gaps; the final byte is zero-padded. A PDO holds at most 64 mapped bits.

public readonly struct PdoMappingEntry : System.IEquatable<CanKit.Pro.CANopen.Pdo.PdoMappingEntry>

Implements IEquatable<PdoMappingEntry>

Remarks

Bit lengths are the same units the CiA 301 §7.5.2.38 mapping record uses (a 32-bit mapping entry is index << 16 | subindex << 8 | bit-length). The node stores every mapping in its mapping records — 1600h + n − 1 / 1A00h + n − 1 for PDO n, up to 17FFh / 1BFFh — whether it was configured through ConfigureTpdo/ConfigureRpdo or written over SDO. An entry whose index is one of the static data types 0001h–0007h (with sub-index 0) is a <em>dummy mapping</em> (CiA 301 §7.5.2.36): it occupies the bits of its data type (DummyBitLength(ushort)) in the PDO without touching the object dictionary, which pads an RPDO to a peer's layout.

Constructors

PdoMappingEntry(ushort, byte, byte) Constructor

Constructs a new mapping entry.

public PdoMappingEntry(ushort index, byte subindex, byte bitLength);

Parameters

index UInt16

Target OD index, or a dummy data-type index 0001h–0007h.

subindex Byte

Target OD subindex (0 for a dummy entry).

bitLength Byte

Field size in bits, 1..64.

Properties

PdoMappingEntry.BitLength Property

Contribution size in bits.

public byte BitLength { get; }

Property Value

Byte

PdoMappingEntry.ByteLength Property

Number of bytes needed to hold this field separately, rounded up.

public int ByteLength { get; }

Property Value

Int32

PdoMappingEntry.Index Property

OD index this entry references.

public ushort Index { get; }

Property Value

UInt16

PdoMappingEntry.IsDummy Property

Whether this is a dummy mapping (CiA 301 §7.5.2.36): index 0001h–0007h, sub-index 0. Its bits are padding — zeros in a TPDO, ignored in an RPDO.

public bool IsDummy { get; }

Property Value

Boolean

PdoMappingEntry.Subindex Property

OD subindex this entry references.

public byte Subindex { get; }

Property Value

Byte

Methods

PdoMappingEntry.DummyBitLength(ushort) Method

The bit length CiA 301 assigns to the dummy data type index (0001h = 1, 0002h/0005h = 8, 0003h/0006h = 16, 0004h/0007h = 32), or 0 for any other index.

public static byte DummyBitLength(ushort index);

Parameters

index UInt16

Returns

Byte

PdoMappingEntry.Equals(object) Method

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj);

Parameters

obj Object

The object to compare with the current instance.

Returns

Boolean
true if obj and this instance are the same type and represent the same value; otherwise, false.

PdoMappingEntry.GetHashCode() Method

Returns the hash code for this instance.

public override int GetHashCode();

Returns

Int32
A 32-bit signed integer that is the hash code for this instance.