Transmits a locomotive speed control packet asynchronously with high priority.
Namespace: RRAutoLib.LoconetAssembly: RRAutoLib (in RRAutoLib.dll) Version: 1.4.4504.18867
Syntax
| C# |
|---|
public void TxPrioritySpeed( byte bytSlot, byte bytSpeed, Object objTag ) |
| Visual Basic |
|---|
Public Sub TxPrioritySpeed ( _ bytSlot As Byte, _ bytSpeed As Byte, _ objTag As Object _ ) |
Parameters
- bytSlot
- Type: System..::..Byte
Valid values are 1-120. Some command stations have less than 120 slots.
- bytSpeed
- Type: System..::..Byte
The speed value that should be assigned to the locomotive located at the bytSlot number.
- objTag
- Type: System..::..Object
An optional Object that contains data to be associated with the packet.
Remarks
On average, the Loconet network can handle packet transmissions no faster than one every 15ms. If you have a user interface, such as a slider,
that generates speed changes faster than the described interval, packets can get backlogged in the transmission queues, causing sluggish performance.
Unlike TxPriorityPacket(Packet), this method checks the priority queue for unprocessed speed control packets before inserting a new packet.
If it finds one with the same slot number, the existing packet will be updated with the new speed value. If no match is found, this method behaves
identically to TxPriorityPacket(Packet).
Examples
The following two lines are equivalent except the latter overrides obsolete packets backlogged in the queue.
CopyVB.NET
'assumes objLoconetService has been previously initialized and started objLoconetService.TxPriorityPacket(New PkSetSlotSpeed(3, 50)) objLoconetService.TxPrioritySpeed(3, 50)