Class SetTurnoutCommand
A turnout (or any accessory function) can be switched with the following command.
public class SetTurnoutCommand : IZ21Command
- Inheritance
-
SetTurnoutCommand
- Implements
- Inherited Members
Examples
Wrong: Activate 1 -> Active 2 -> Deactivate 1 -> Deactivate 2
Correct: Activate 1 -> Deactivate 1 -> Activate 2 -> Deactivate 2
Remarks
The <xref href="CommandStation.Model.AccessoryState.Activate" data-throw-if-not-resolved="false"></xref> signal is output on the track until the LAN client sends the corresponding <xref href="CommandStation.Model.AccessoryState.Deactivate" data-throw-if-not-resolved="false"></xref>> signale.
Only one switching command may be active at the same time.
Constructors
SetTurnoutCommand(IZ21FrameBuilder, IAddressCodec, ushort, AccessoryOutput, AccessoryState, bool)
public SetTurnoutCommand(IZ21FrameBuilder frameBuilder, IAddressCodec addressCodec, ushort accessoryAddress, AccessoryOutput accessoryOutput, AccessoryState accessoryState, bool executeImmediately)
Parameters
frameBuilderIZ21FrameBuilderaddressCodecIAddressCodecaccessoryAddressushortaccessoryOutputAccessoryOutputaccessoryStateAccessoryStateexecuteImmediatelybool
Exceptions
- ArgumentOutOfRangeException
Thrown when
accessoryAddressis smaller than 1.
Properties
Data
public byte[] Data { get; }
Property Value
- byte[]
Name
Human-readable command according to the specification.
public string Name { get; }