Skip to content

CanOpenCobId Class

CiA 301 pre-defined connection set: helpers that translate CANopen node identifiers into the 11-bit COB-IDs used for NMT, SYNC, EMCY, PDO, SDO and heartbeat traffic.

public static class CanOpenCobId

Inheritance Object → CanOpenCobId

Remarks

Constants and helpers only — no state, no allocation. The layout mirrors CiA 301 §7.2: - NMT master command frame — 0x000 - SYNC — 0x080 - EMCY — 0x080 + node-id - TPDO1..4 — 0x180/0x280/0x380/0x480 + node-id - RPDO1..4 — 0x200/0x300/0x400/0x500 + node-id - SDO server → client — 0x580 + node-id - SDO client → server — 0x600 + node-id - NMT error control (heartbeat / bootup) — 0x700 + node-id - LSS slave message — 0x7E4 (CiA 305 §7.3) - LSS master message — 0x7E5 (CiA 305 §7.3)

Fields

CanOpenCobId.CanIdMask Field

Mask of the 11-bit CAN-ID in a COB-ID object.

public const uint CanIdMask = 2047;

Field Value

UInt32

CanOpenCobId.EmcyBase Field

Base COB-ID for EMCY frames: 0x080 + node-id.

public const uint EmcyBase = 128;

Field Value

UInt32

CanOpenCobId.ExtendedFrameBit Field

Bit 29 of a COB-ID object: set means the CAN-ID is a 29-bit extended identifier. PDOs support both frame formats; services that support only base frames reject this bit with SDO abort 0609 0030h.

public const uint ExtendedFrameBit = 536870912;

Field Value

UInt32

CanOpenCobId.FlyingMasterClaim Field

Flying-master claim: the active master, or the winner of a timeslot race, sends its priority level and node-id here (2 data bytes).

public const uint FlyingMasterClaim = 113;

Field Value

UInt32

CanOpenCobId.FlyingMasterDetect Field

Flying-master detection request. No data. The active master answers on FlyingMasterClaim.

public const uint FlyingMasterDetect = 115;

Field Value

UInt32

CanOpenCobId.FlyingMasterForce Field

Flying-master force. No data. Asks the active master to restart the election with a broadcast Reset Communication.

public const uint FlyingMasterForce = 118;

Field Value

UInt32

CanOpenCobId.FlyingMasterTrigger Field

Flying-master timeslot trigger. No data. Receiving it starts the wait; the sender does not need a second copy from every other candidate.

public const uint FlyingMasterTrigger = 114;

Field Value

UInt32

CanOpenCobId.GlobalFailsafeCommand Field

Global failsafe command, CiA DSP 304 V1.0 §8.2.3 / Table 3: COB-ID 001h, DLC 0.

public const uint GlobalFailsafeCommand = 1;

Field Value

UInt32

CanOpenCobId.HeartbeatBase Field

Base COB-ID for NMT error control (heartbeat + bootup): 0x700 + node-id.

public const uint HeartbeatBase = 1792;

Field Value

UInt32

CanOpenCobId.InvalidBit Field

Bit 31 of a COB-ID object (1014h, 1200h, 1400h:01, 1800h:01): set means the communication object "does not exist / is not valid" (CiA 301 Tables 59, 64, 66, 70).

public const uint InvalidBit = 2147483648;

Field Value

UInt32

CanOpenCobId.LssMasterMessage Field

LSS master message CAN-ID (CiA 305 §7.3). The single LSS master transmits here.

public const uint LssMasterMessage = 2021;

Field Value

UInt32

CanOpenCobId.LssSlaveMessage Field

LSS slave message CAN-ID (CiA 305 §7.3). Every LSS slave transmits here.

public const uint LssSlaveMessage = 2020;

Field Value

UInt32

CanOpenCobId.MaxNodeId Field

Largest legal CANopen node identifier (CiA 301 §7.2.4).

public const byte MaxNodeId = 127;

Field Value

Byte

CanOpenCobId.MinNodeId Field

Smallest legal CANopen node identifier (CiA 301 §7.2.4).

public const byte MinNodeId = 1;

Field Value

Byte

CanOpenCobId.NmtCommand Field

NMT master command COB-ID (single-broadcast, no node offset).

public const uint NmtCommand = 0;

Field Value

UInt32

CanOpenCobId.NoRtrBit Field

Bit 30 of a TPDO COB-ID (1800h:01): set means "no RTR allowed on this PDO" (CiA 301 Table 70).

public const uint NoRtrBit = 1073741824;

Field Value

UInt32

CanOpenCobId.Rpdo1Base Field

Base COB-ID for RPDO1: 0x200 + node-id.

public const uint Rpdo1Base = 512;

Field Value

UInt32

CanOpenCobId.Rpdo2Base Field

Base COB-ID for RPDO2: 0x300 + node-id.

public const uint Rpdo2Base = 768;

Field Value

UInt32

CanOpenCobId.Rpdo3Base Field

Base COB-ID for RPDO3: 0x400 + node-id.

public const uint Rpdo3Base = 1024;

Field Value

UInt32

CanOpenCobId.Rpdo4Base Field

Base COB-ID for RPDO4: 0x500 + node-id.

public const uint Rpdo4Base = 1280;

Field Value

UInt32

CanOpenCobId.SdoRxBase Field

Base COB-ID for SDO client → server requests: 0x600 + node-id.

public const uint SdoRxBase = 1536;

Field Value

UInt32

CanOpenCobId.SdoTxBase Field

Base COB-ID for SDO server → client responses: 0x580 + node-id.

public const uint SdoTxBase = 1408;

Field Value

UInt32

CanOpenCobId.SrdoFirstCobId Field

First CAN-ID of the SRDO range (CiA DSP 304 V1.0 Table 4; CiA 301 Table 40 restricts 101h–180h for this use).

public const uint SrdoFirstCobId = 257;

Field Value

UInt32

CanOpenCobId.SrdoLastCobId Field

Last CAN-ID of the SRDO range.

public const uint SrdoLastCobId = 384;

Field Value

UInt32

CanOpenCobId.Sync Field

SYNC COB-ID.

public const uint Sync = 128;

Field Value

UInt32

CanOpenCobId.SyncGenerateBit Field

Bit 30 of the SYNC COB-ID (1005h): set means "CANopen device generates SYNC message" (CiA 301 Table 55).

public const uint SyncGenerateBit = 1073741824;

Field Value

UInt32

CanOpenCobId.Tpdo1Base Field

Base COB-ID for TPDO1: 0x180 + node-id.

public const uint Tpdo1Base = 384;

Field Value

UInt32

CanOpenCobId.Tpdo2Base Field

Base COB-ID for TPDO2: 0x280 + node-id.

public const uint Tpdo2Base = 640;

Field Value

UInt32

CanOpenCobId.Tpdo3Base Field

Base COB-ID for TPDO3: 0x380 + node-id.

public const uint Tpdo3Base = 896;

Field Value

UInt32

CanOpenCobId.Tpdo4Base Field

Base COB-ID for TPDO4: 0x480 + node-id.

public const uint Tpdo4Base = 1152;

Field Value

UInt32

CanOpenCobId.UnconfiguredNodeId Field

Pending or persistent node-id that means the slave is not configured (CiA 305 §3.3). It is not an active node-id: nothing on the bus is addressed with it.

public const byte UnconfiguredNodeId = 255;

Field Value

Byte

Methods

CanOpenCobId.Emcy(byte) Method

Returns 0x080 + node-id, the EMCY COB-ID.

public static uint Emcy(byte nodeId);

Parameters

nodeId Byte

Returns

UInt32

CanOpenCobId.Heartbeat(byte) Method

Returns 0x700 + node-id, the heartbeat / bootup COB-ID.

public static uint Heartbeat(byte nodeId);

Parameters

nodeId Byte

Returns

UInt32

CanOpenCobId.IsActiveNodeId(byte) Method

Whether nodeId may be the active node-id on the bus (1..127).

public static bool IsActiveNodeId(byte nodeId);

Parameters

nodeId Byte

Returns

Boolean

CanOpenCobId.IsLayerSettingNodeId(byte) Method

Whether nodeId is a legal pending or persistent layer-setting node-id: 1..127, or UnconfiguredNodeId.

public static bool IsLayerSettingNodeId(byte nodeId);

Parameters

nodeId Byte

Returns

Boolean

CanOpenCobId.IsRestricted(uint) Method

Whether canId is one of the restricted CAN-IDs of CiA 301 §7.3.5 Table 40, which no configurable communication object (SYNC, TIME, EMCY, PDO, SDO) may use: 000h (NMT), 001h–07Fh, 101h–180h, 581h–5FFh (default SDO tx), 601h–67Fh (default SDO rx), 6E0h–6FFh, 701h–77Fh (NMT error control) and 780h–7FFh.

public static bool IsRestricted(uint canId);

Parameters

canId UInt32

Returns

Boolean

CanOpenCobId.RpdoDefault(byte, int) Method

Returns the default RPDO COB-ID for pdoIndex (1..4) and nodeId according to the CiA 301 pre-defined connection set.

public static uint RpdoDefault(byte nodeId, int pdoIndex);

Parameters

nodeId Byte

pdoIndex Int32

Returns

UInt32

CanOpenCobId.SdoRx(byte) Method

Returns 0x600 + node-id, the SDO client → server (SDO Rx) COB-ID.

public static uint SdoRx(byte nodeId);

Parameters

nodeId Byte

Returns

UInt32

CanOpenCobId.SdoTx(byte) Method

Returns 0x580 + node-id, the SDO server → client (SDO Tx) COB-ID.

public static uint SdoTx(byte nodeId);

Parameters

nodeId Byte

Returns

UInt32

CanOpenCobId.SrdoDefaultCobId1(byte) Method

COB-ID 1 of the first SRDO of a node in the pre-defined connection set: FFh + 2 × node-id (Table 4, object 1301h:05 default).

public static uint SrdoDefaultCobId1(byte nodeId);

Parameters

nodeId Byte

Returns

UInt32

Exceptions

ArgumentOutOfRangeException
Node-ids above 64 have no pre-defined SRDO COB-ID (§8.3.3).

CanOpenCobId.SrdoDefaultCobId2(byte) Method

COB-ID 2 of the first SRDO: 100h + 2 × node-id (Table 4, object 1301h:06 default).

public static uint SrdoDefaultCobId2(byte nodeId);

Parameters

nodeId Byte

Returns

UInt32

Exceptions

ArgumentOutOfRangeException
Node-ids above 64 have no pre-defined SRDO COB-ID (§8.3.3).

CanOpenCobId.TpdoDefault(byte, int) Method

Returns the default TPDO COB-ID for pdoIndex (1..4) and nodeId according to the CiA 301 pre-defined connection set.

public static uint TpdoDefault(byte nodeId, int pdoIndex);

Parameters

nodeId Byte

pdoIndex Int32

Returns

UInt32

CanOpenCobId.ValidateNodeId(byte) Method

Validates that nodeId falls in the legal CiA 301 range.

public static void ValidateNodeId(byte nodeId);

Parameters

nodeId Byte

Exceptions

ArgumentOutOfRangeException
Thrown when nodeId is outside [1, 127]. UnconfiguredNodeId is rejected here: it is a layer setting, not an address a frame may use.