Click or drag to resize

PkDccProgram Class

Represents a Loconet packet used to program DCC decoders on the track.
Inheritance Hierarchy

Namespace:  RRAutoLib.Loconet
Assembly:  RRAutoLib (in RRAutoLib.dll) Version: 4.0.8678.28884
Syntax
<SerializableAttribute>
Public Class PkDccProgram
	Inherits PkRdWrSlotData

The PkDccProgram type exposes the following members.

Constructors
  NameDescription
Public methodPkDccProgram
Initializes a new instance of the PkDccProgram class
Protected methodPkDccProgram(SerializationInfo, StreamingContext)
Used to inherit custom serialization from Packet because constructors are not inherited.
Public methodPkDccProgram(Boolean, DccProgMode, UInt16, Byte)
Initializes a new instance of the PkDccProgram class
Public methodPkDccProgram(Boolean, DccProgMode, UInt16, UInt16, Byte)
Initializes a new instance of the PkDccProgram class
Top
Properties
  NameDescription
Public propertyBytes
Gets the bytes that makes up a Loconet packet message.
(Inherited from Packet.)
Public propertyCvNumber
Gets or sets the DCC decoder configuration number.
Public propertyCvValue
Gets or sets the DCC decoder configuration value.
Public propertyDescription
User friendly description of the packet.
(Overrides PkRdWrSlotDataDescription.)
Public propertyID
Gets the unique identifier of the packet.
(Inherited from Packet.)
Public propertyIsEchoe
Gets value indicating if the packet is an echoe.
(Inherited from Packet.)
Public propertyIsIntellibox (Inherited from PkRdWrSlotData.)
Public propertyIsLoconet11 (Inherited from PkRdWrSlotData.)
Public propertyNeedsPacketResponse
Gets value indicating if this packet expects a response packet.
(Inherited from Packet.)
Public propertyOpAddress
Gets or sets the DCC decoder's address for operation mode programming.
Public propertyOpCode
Gets the Loconet operation code associated with the packet.
(Inherited from PkRdWrSlotData.)
Public propertyParmsDesc
User friendly description of the most significant packet parameters.
(Overrides PkRdWrSlotDataParmsDesc.)
Public propertyPostTxWait
Gets or sets the time in milliseconds to wait after sending this packet before performing the next step.
(Inherited from Packet.)
Public propertyProgErrFlags
Error flags returned from an attempted programming task.
Public propertyProgMode
Gets or sets the track programming mode.
Public propertyProgWrite
Gets or sets if packet is used for reading or writing data.
Public propertyRxPacket
Gets the received response packet post transmit.
(Inherited from Packet.)
Public propertyServTrackIsBusy (Inherited from PkRdWrSlotData.)
Public propertySlot
Gets the command stations's slot number.
(Overrides PkRdWrSlotDataSlot.)
Public propertyTag
Gets or sets an arbitrary object that is associated with the packet.
(Inherited from Packet.)
Public propertyTimeStamp
Gets an event time stamp of the packet's echo or arrival.
(Inherited from Packet.)
Public propertyTrackIsPaused (Inherited from PkRdWrSlotData.)
Public propertyTrackPowerIsOn (Inherited from PkRdWrSlotData.)
Top
Methods
  NameDescription
Public methodBytesToString
Converts the Bytes into a readable string.
(Inherited from Packet.)
Public methodClone
Same as Clone but also converts to a slot write if cloaning a slot read.
(Inherited from PkRdWrSlotData.)
Protected methodGetObjectData (Inherited from Packet.)
Public methodStatic memberSetDcc4DigitAddress
Sets the four digit address of a DCC decoder.
Public methodValidPacketResponse (Inherited from PkRdWrSlotData.)
Top
Fields
  NameDescription
Protected field_blnIsEchoe
Exposed through IsEchoe property.
(Inherited from Packet.)
Protected field_bytaBytes
Exposed through Bytes property.
(Inherited from Packet.)
Protected field_dblTimeStamp
Exposed through TimeStamp property.
(Inherited from Packet.)
Protected field_objRxPacket
Exposed through RxPacket property.
(Inherited from Packet.)
Protected field_objTag
Exposed through Tag property.
(Inherited from Packet.)
Protected field_sctID
Exposed through ID property.
(Inherited from Packet.)
Protected field_srtPostTxWait
Exposed through PostTxWait property.
(Inherited from Packet.)
Top
Remarks
A PkLongAck response is expected indicating if programming with given parameters is allowed. If a valid programming task is started, a PkDccProgram response will also follow echoing most of the request values plus the ProgErrFlags indicating if the task returned an error. This packet type reads and writes from command station slot 124.
Examples
The following are four examples communicating with decoders.
VB
'assumes LoconetService (locServ) has been previously initialized and started

'sets CV57 (speed compensation) and is performed on the service track
locServ.TxPacket(New PkDccProgram(True, DccProgMode.ServTrkPagedByte, 57, 5))

'also sets CV57 but in opperation mode; note: decoder address 2045 is also specified
locServ.TxPacket(New PkDccProgram(True, DccProgMode.OperByteNoFeedback, 2045, 57, 5))

'gets value of CV57 on the service track; note the CvValue can be any value like 0
locServ.TxPacket(New PkDccProgram(False, DccProgMode.ServTrkPagedByte, 57, 0))

'simple way to set CV17 and CV18 to the 4 digit address of 2045
'this is a Shared helper function that internally sends two PkDccProgram packets
PkDccProgram.SetDcc4DigitAddress(locServ, DccProgMode.ServTrkPagedByte, 2045)
See Also