CanOpen Class¶
Factory entry point for opening ICanOpenNode instances. Non-instantiable.
Inheritance Object → CanOpen
Remarks¶
Mirrors the ownership patterns used by CanKit.Pro.IsoTp, CanKit.Pro.J1939Tp and
CanKit.Pro.Uds:
- OpenNode(ICanBus, byte, CanOpenNodeOptions) — the node
owns a private ICanBusService wrapping the supplied bus and disposes it on
dispose. Convenient for single-protocol callers.
- OpenNode(ICanBusService, byte, CanOpenNodeOptions, bool) —
the caller supplies an existing service (shared with other protocols on the same bus per
FR-CO-012); with leaveOpen=true the service outlives the node.
Methods¶
CanOpen.OpenNode(ICanBus, byte, CanOpenNodeOptions) Method¶
Opens a node that owns a private CanBusService around bus. Disposing the node disposes that service and detaches from bus; the bus itself is not disposed.
public static CanKit.Pro.CANopen.ICanOpenNode OpenNode(CanKit.Abstractions.API.Can.ICanBus bus, byte nodeId, CanKit.Pro.CANopen.CanOpenNodeOptions? options=null);
Parameters¶
bus ICanBus
nodeId Byte
options CanOpenNodeOptions
Returns¶
CanOpen.OpenNode(ICanBusService, byte, CanOpenNodeOptions, bool) Method¶
Opens a node bound to an already-existing service. Multiple nodes with different node-ids may share the same service to multiplex several CANopen identities over one physical bus, or to co-exist with other protocol layers (ISO-TP, J1939, ...).
public static CanKit.Pro.CANopen.ICanOpenNode OpenNode(CanKit.Pro.RawCan.ICanBusService service, byte nodeId, CanKit.Pro.CANopen.CanOpenNodeOptions? options=null, bool leaveOpen=true);
Parameters¶
service ICanBusService
The demux service. Must not be null.
nodeId Byte
CANopen node-id 1..127 this node identifies as.
options CanOpenNodeOptions
Node options; defaults to a fresh CanOpenNodeOptions.
leaveOpen Boolean
When true (default) disposing the node does not dispose
service; when false the node takes ownership and disposes the
service on its own IDisposable.Dispose.