Operates the given locomotive.

Namespace: XpressnetLib
Assembly: XpressnetLib (in XpressnetLib.dll) Version: 0.1.4195.39796

Syntax

C#
public bool LocoSetSpeedAndDirection(
	int locoAddr,
	int steps,
	int speed,
	bool direction
)
Visual Basic
Public Function LocoSetSpeedAndDirection ( _
	locoAddr As Integer, _
	steps As Integer, _
	speed As Integer, _
	direction As Boolean _
) As Boolean
Visual C++
public:
bool LocoSetSpeedAndDirection(
	int locoAddr, 
	int steps, 
	int speed, 
	bool direction
)

Parameters

locoAddr
Type: System..::..Int32
Locomotive address
steps
Type: System..::..Int32
Speed steps to use (this must comply with the decoder setting, otherwise it can cause erratic behavior)
speed
Type: System..::..Int32
Speed of the locomotive (0 = stop, 1 = emergency stop, 2+ movement)
direction
Type: System..::..Boolean
Direction of travel (true = forward)

Return Value

True if the command has been successfully processed by the command station.

See Also