Represents a Loconet packet used to send a direct DCC packet.
Namespace: RRAutoLib.LoconetAssembly: RRAutoLib (in RRAutoLib.dll) Version: 1.4.4420.16901
Syntax
| C# |
|---|
[SerializableAttribute] public class PkImmediate : Packet |
| Visual Basic |
|---|
<SerializableAttribute> _ Public Class PkImmediate _ Inherits Packet |
Remarks
This Loconet packet wraps a DCC packet which it forwards directly to the track. A PkLongAck response is expected.
Examples
In the following example, we are setting functions 21 through 28 of an auxiliary decoder configured with a 14 bit long address of 813.
The order of parameter assignment is very important due to the offsets created by variable bit addressing and instruction.
For proper encoding, the address must be set first, then the instruction, and lastly the instruction specific method that encodes the data.
CopyVB.NET
Dim objPacket As New PkImmediate objPacket.DccLongAdr = 813 objPacket.DccInstruction = PkImmediate.DccInstrType.Func21To28 objPacket.DccFunctions = New OnOffState() {1, 0, 0, 0, 1, 0, 0, 0} 'assumes objLoconetService has been previously initialized and started objLoconetService.TxPacket(objPacket)