PeerSafetyConfiguration Class¶
What a safety node's configuration should be: 1300h and, per SRDO number, the communication parameter and the mapping — and, for a configuration, whether the peer is to store it (Storage). Built by hand or from a DCF's parameter values (CiA 306). A record whose direction is 0 is not part of it — it is deleted on the peer. Not thread-safe: fill it on one thread, then hand it over. A transaction takes its own copy when it starts; a concurrent Add(int, SrdoCommunicationParameter, SrdoMapping) while that copy is being made is not supported.
Inheritance Object → PeerSafetyConfiguration
Properties¶
PeerSafetyConfiguration.DeclaresAnySrdo Property¶
True when at least one SRDO is configured — what makes a peer a safety slave for the boot-up.
Property Value¶
PeerSafetyConfiguration.GlobalFailsafeCommandEnabled Property¶
1300h: 1 when true.
Property Value¶
PeerSafetyConfiguration.Srdos Property¶
The SRDOs to exist on the peer, by number.
public System.Collections.Generic.IReadOnlyDictionary<int,(CanKit.Pro.CANopen.Safety.SrdoCommunicationParameter Parameter,CanKit.Pro.CANopen.Safety.SrdoMapping Mapping)> Srdos { get; }
Property Value¶
IReadOnlyDictionary<Int32,<SrdoCommunicationParameter,SrdoMapping>>
PeerSafetyConfiguration.Storage Property¶
CiA 319 v2.0.0 §5.3 step 5: once the peer has acknowledged the configuration (13FEh = A5h read back), it is asked to store it in non-volatile memory — 13FEh and 13FFh included — through 1010h at this sub-index, with the "save" signature. None, the default, stores nothing. Settable, so that a configuration FromDeviceDescription(CanOpenDeviceDescription, byte) built can ask for it too. The sub-index must be one the peer's bound description declares, or the configuration is refused before its first frame; a store the peer aborts is reported in the result (StorageAbort), after the acknowledgement. A verification does not read it.
Property Value¶
Exceptions¶
ArgumentOutOfRangeException
Not a value of PeerSafetyStorage.
Methods¶
PeerSafetyConfiguration.Add(int, SrdoCommunicationParameter, SrdoMapping) Method¶
Adds or replaces SRDO srdoNumber (1..64). What the peer's validator would refuse whatever its state is refused here, before a configuration can delete the peer's SRDOs (CiA DSP 304 §8.4.2.2): the direction is tx or rx (None: leave the SRDO out to delete it); COB-ID 1 is an odd id of 101h..17Fh and COB-ID 2 the next one; the refresh time or SCT is 1..65535 ms and the SRVT 1..255 ms after rounding to whole milliseconds; and no other SRDO of this configuration uses either COB-ID. The configuration keeps a copy of mapping: a later change to the caller's instance does not change it.
public CanKit.Pro.CANopen.Safety.PeerSafetyConfiguration Add(int srdoNumber, CanKit.Pro.CANopen.Safety.SrdoCommunicationParameter parameter, CanKit.Pro.CANopen.Safety.SrdoMapping mapping);
Parameters¶
srdoNumber Int32
parameter SrdoCommunicationParameter
mapping SrdoMapping
Returns¶
Exceptions¶
ArgumentOutOfRangeException
The number is not 1..64, or a time is out of range.
ArgumentException
The direction, the COB-IDs, or a COB-ID another SRDO of the configuration uses.
PeerSafetyConfiguration.FromDeviceDescription(CanOpenDeviceDescription, byte) Method¶
What a device with node-id nodeId holds after loading description: 1300h and every SRDO the device creates from the file, with the records it then holds. It is built by the node's own loader — the same code, over a dictionary of its own — not by a second reading of the file: the §8.4.2.2 defaults for what the file leaves out or the device refuses (25 ms, 20 ms, the pre-defined COB-IDs of SRDO 1 for a node-id 1..64, §8.3.3), the device's write rules (§8.4.2.2: consecutive COB-IDs, an inverted slot equal to its plain one, no COB-ID of another existing SRDO, mapped objects the file declares), and the SRDO left deleted where the loader leaves it deleted. So step D against a slave's own DCF expects what the slave holds. Parameter values are read as ParameterValue, DefaultValue where none, $NODEID resolved with nodeId.
public static CanKit.Pro.CANopen.Safety.PeerSafetyConfiguration FromDeviceDescription(CanKit.Pro.CANopen.CanOpenDeviceDescription description, byte nodeId);
Parameters¶
description CanOpenDeviceDescription
nodeId Byte
Returns¶
Exceptions¶
ArgumentNullException
description is null.
ArgumentOutOfRangeException
nodeId is not 1..127.