LssCommissioning Class¶
Commissioning on top of an ILssMaster (CiA 305 §6). The master is not owned. Exactly one LSS master may be active in the network; this type does not add another.
Inheritance Object → LssCommissioning
Remarks¶
A scan that only lists slaves leaves each one in configuration until the scan ends, so the next Fastscan cannot return it again, and then switches every slave to waiting. Configure and inquire switch every slave to waiting and then select only the addressed one, so a slave that was already in configuration does not take the same service. An assigning scan switches every slave to waiting first. When Fastscan read the whole address, the found slave is selected again before it is configured. A skipped LSS number is not in that address, so the slave Fastscan left in configuration is configured there; selecting again would miss it. Activating bit timing in a scan is limited to one slave. Commissioning calls sharing the same master run one sequence at a time, including cleanup. Do not call the master directly while a commissioning sequence is running. A sequence that is cancelled or fails still returns its slaves to waiting before it ends. That release has no time budget of its own: it waits out whatever the master has reserved, which after an abandoned activation is both switch-delay periods (up to 2 × 65 535 ms). Disposing the master ends that wait.
Constructors¶
LssCommissioning(ILssMaster) Constructor¶
Uses master for every service. The caller disposes it.
Parameters¶
master ILssMaster
Properties¶
LssCommissioning.Master Property¶
The master this tool drives.
Property Value¶
Methods¶
LssCommissioning.ConfigureSlaveAsync(LssAddress, LssSlaveConfiguration, CancellationToken) Method¶
Switches the slave with address to configuration and applies configuration. Returns a result with Selectedfalse when no slave confirms.
public System.Threading.Tasks.Task<CanKit.Pro.CANopen.Lss.LssCommissioningResult> ConfigureSlaveAsync(CanKit.Pro.CANopen.Lss.LssAddress address, CanKit.Pro.CANopen.Lss.LssSlaveConfiguration configuration, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
Parameters¶
address LssAddress
configuration LssSlaveConfiguration
cancellationToken CancellationToken
Returns¶
Exceptions¶
LssTimeoutException
A confirmed service did not answer. Earlier services may already have succeeded:
a timeout during bit timing or store can leave the pending node-id written on the slave.
The exception's command specifier identifies the service that timed out.
LssCommissioning.InquireSlaveAsync(LssAddress, CancellationToken) Method¶
Switches the slave with address to configuration and reads its LSS address and node-id (§6.5). The slave is returned to waiting. A selective miss is Selectedfalse.
public System.Threading.Tasks.Task<CanKit.Pro.CANopen.Lss.LssCommissioningResult> InquireSlaveAsync(CanKit.Pro.CANopen.Lss.LssAddress address, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
Parameters¶
address LssAddress
cancellationToken CancellationToken
Returns¶
LssCommissioning.ReadIdentitiesAsync(ICanOpenNode, IEnumerable<byte>, CancellationToken) Method¶
Reads 1018h:01..04 of each booted node in nodeIds through
client. A node that does not answer, or aborts the vendor-id, is
skipped. A missing later sub-index (0609 0011h) counts as 0. A timeout or any
other abort is reported, so a partial answer is not stored as a fabricated LSS number.
This is how a configured slave, which does not take part in Fastscan, is listed.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<CanKit.Pro.CANopen.Lss.LssCommissioningResult>> ReadIdentitiesAsync(CanKit.Pro.CANopen.ICanOpenNode client, System.Collections.Generic.IEnumerable<byte> nodeIds, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
Parameters¶
client ICanOpenNode
nodeIds IEnumerable<Byte>
cancellationToken CancellationToken
Returns¶
Task<IReadOnlyList<LssCommissioningResult>>
LssCommissioning.ScanUnconfiguredAsync(LssUnconfiguredScan, CancellationToken) Method¶
Finds unconfigured slaves by Fastscan (§6.7). With AssignFromNodeId, each one is given the next node-id and, when asked, a bit timing and a store, then released to waiting. Bit timing is activated only when Limit is 1. Without an assignment, slaves are parked in configuration for the duration of the scan and released together at the end.
public System.Threading.Tasks.Task<CanKit.Pro.CANopen.Lss.LssUnconfiguredScanResult> ScanUnconfiguredAsync(CanKit.Pro.CANopen.Lss.LssUnconfiguredScan? scan=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
Parameters¶
scan LssUnconfiguredScan
cancellationToken CancellationToken