Reference

DCC-EX Consolidated Command Summary

Engineer Hat

This is a summary, for a detailed command, see…

Command Reference

This page describes all the DCC-EX commands that the EX‑CommandStation supports.

Conventions used on this page

  • < and > - All DCC-EX commands are surrounded by these characters to indicate the beginning and end, these must always be included

  • First letter or number - These are called OPCODES, are case sensitive, and must be specified as directed, eg. 1, c, or -

  • CAPITALISED words - These are parameters referred to as keywords, and should be specified as directed, eg. MAIN (note these are not case sensitive, however capitalising makes them easier to distinguish from other parameters)

  • lowercase words - These are parameters that must be provided or are returned, with multiple parameters separated by a space ” “, eg. cab

  • Square brackets [] - Parameters within square brackets [] are optional and may be omitted, and if specifying these parameters, do not include the square brackets themselves

  • | - Use of the | character means you need to provide one of the provided options only, for example <0|1 MAIN|PROG|JOIN> becomes either <0 MAIN> or <1 MAIN>

  • 0|1 DIRECTION: 1=forward, 0=reverse.

Controlling the EX-CommandStation

Power management

Command

Description / Response

<D RESET>

Re-boot the command Station

 Parameters:
 N/A

 Response:
 N/A

<J I>

Request current status

 Parameters:
 N/A

 Response:
 repeated for each Channel/Track: <j I track current>
 
 track: channel/track
 current: current in milliamps

 Version Introduced: 4.2.19

<J G>

Request max current

 Parameters:
 N/A

 Response:
 repeated for each Channel/Track: <j IG track currentmax>
 
 track: channel/track
 currentmax: current in milliamps

 Version Introduced: 4.2.19

<onOff [track]>

Turns power on and off to the MAIN and PROG tracks together or independently. Also allows joining the MAIN and PROG tracks together.

 Parameters:
 onOff: one of
  1 = on
  0 = off
 track: one of
  blank = Both Main and Programming Tracks
  MAIN = Main track
  PROG = Programming Track
  JOIN = Join the Main and Programming tracks temporarily
 
 e.g.
 all tracks off: <0>
 all tracks on <1>
 join: <1 JOIN>

 Response:
 N/A

 Notes:
 The use of the JOIN function ensures that the DCC signal for the MAIN track is also sent to the PROG track. This allows the prog track to act as a siding (or similar) in the main layout even though it is isolated electrically and connected to the programming track output. However, it is important that the prog track wiring be in the same phase as the main track i.e. when the left rail is high on MAIN, it is also high on PROG. You may have to swap the wires to your prog track to make this work. If you drive onto a programming track that is “joined” and enter a programming command, the track will automatically switch to a programming track. If you use a compatible Throttle, you can then send the join command again and drive off the track onto the rest of your layout!
 
 In some split motor shield hardware configurations JOIN will not be able to work.

Cab (Loco) Commands

Command

Description / Response

<f cab byte1 [byte2]]>

Decoder Functions - Legacy command.

 Parameters:
 cab: DCC Address of the decoder/loco
 byte1 byte2: DCC function bytes as sent to decoders (up to F28)

 Response:
 Success: nothing; Fail: <X>

 Notes:
 Used by the sniffer

<!>

Emergency Stop

 Parameters:
 N/A

 Response:
 Repeated for each loco in the reminders list <l cab reg speedByte functMap>

<- [cab]>

Remove one or all locos from reminders

 Parameters:
 cab: one of
  blank = all locos
  No. = Cab (loco) to forget

 Response:
 N/A

 Notes:
 Forgets one or all locos. The “cab” parameter is optional.
 Once you send a throttle command to any loco, throttle commands to that loco will continue to be sent to the track. If you remove the loco, or for testing purposes need to clear the loco from repeating messages to the track, you can use this command. Sending <- cab> will forget/clear that loco. Sending <-> will clear all the locos. This doesn’t do anything destructive or erase any loco settings, it just clears the speed reminders from being sent to the track. As soon as a controller sends another throttle command, it will go back to repeating those commands.

<J R id>

Request details of a specific Roster Entry

 Parameters:
 id: unique id of the Cab/s (Loco/s) in the roster

 Response:
 <jR id ˮˮ|ˮdescˮ ˮˮ|ˮfunct1/funct2/funct3/…ˮ>
 id: unique id of the Cab/s (Loco/s) in the roster
 desc: description of the Loco
 funct?: Label for each function 0-28
 
 e.g.
 Response (id is in Roster): <jR id ˮdescˮ ˮfunct1/funct2/funct3/…ˮ>
 Response (id is not in Roster): <jR id ˮˮ ˮˮ>

<J R>

Request the list defined Roster Entry IDs

 Parameters:
 N/A

 Response:
 <jR [id1 id2 id3 …]>
 id?: unique id of the Cab/s (Loco/s) in the roster
 
 e.g.
 Response (roster exists): <jR id1 id2 id3 …>
 Response (no roster exists): <jR>

<t cab>

Requests a deliberate update on the cab speed/functions in the same format as the cab (loco) broadcast.

 Parameters:
 cab: DCC Address of the decoder/loco

 Response:
 The following is not a direct response, but rather as a broadcast that will be triggered as a result of any throttle command being issued by any device for the cab(loc) in question.
 
 <l cab reg speedByte functMap>
 cab: DCC Address of the decoder/loco
 speedbyte: Speed in DCC speedstep format .
  reverse - 2-127 = speed 1-126, 0 = stop
  forward - 130-255 = speed 1-126, 128 = stop
 FunctiMap: individual function states represented by the the bits in a byte

 Notes:
 The speedbyte value is different to the speed sent, as it is an encoded (1,7 bits) byte.
 This starts a reminder process for any external updates to the cab’s (loco’s) status.

<t cab speed dir>

Set Cab (Loco) Speed

 Parameters:
 cab: DCC Address of the decoder/loco
 speed: 0-127
 dir: one of
  1=forward
  0=reverse

 Response:
 The following is not a direct response, but rather as a broadcast that will be triggered as a result of any throttle command being issued by any device for the cab(loc) in question.
 
 <l cab reg speedByte functMap>
 cab: DCC Address of the decoder/loco
 speedbyte: Speed in DCC speedstep format .
  reverse - 2-127 = speed 1-126, 0 = stop
  forward - 130-255 = speed 1-126, 128 = stop
 FunctiMap: individual function states represented by the the bits in a byte

 Version Introduced: 4.1.1
 Notes:
 The speedbyte value is different to the speed sent, as it is an encoded (1,7 bits) byte.
 This starts a reminder process for any external updates to the cab’s (loco’s) status.

<D speedsteps>

Switch between 28 and 128 speed steps

 Parameters:
 speedsteps:
  SPEED28 = use 28 speed steps
  SPEED128 = use 128 speed steps

 Response:
 Response sent to the Serial Monitor only (not wifi clients).
 One of:
  28 Speedsteps
  128 Speedsteps

<F cab funct state>

Turns loco decoder functions ON and OFF

 Parameters:
 cab: DCC Address of the decoder/loco
 funct: 0-28 (F29-F68 (Support for the RCN-212 Functions)
 state:
  1=on
  0=off

 Response:
 The following is not a direct response, but rather as a broadcast that will be triggered as a result of any throttle command being issued by any device for the cab(loc) in question.
 
 <l cab reg speedByte functMap>
 cab: DCC Address of the decoder/loco
 speedbyte: Speed in DCC speedstep format .
  reverse - 2-127 = speed 1-126, 0 = stop
  forward - 130-255 = speed 1-126, 128 = stop
 FunctiMap: individual function states represented by the the bits in a byte

 Notes:
 Setting requests are transmitted directly to mobile loco decoder.
 Current state of loco functions (as known by commands issued since power on) is stored by the CommandStation - All functions within a group get set all at once per NMRA DCC standards.
 The command station knows about the previous settings in the same group and will not, for example, unset F2 because you change F1. If, however, you have never set F2, then changing F1 WILL unset F2.

<t reg cab speed dir>

Set Cab (Loco) Speed - Legacy command

 Deprecated
 Parameters:
 reg: not used
 cab: DCC Address of the decoder/loco
 speed: 0-127
 dir: one of
  1=forward
  0=reverse

 Response:
 The following is not a direct response, but rather as a broadcast that will be triggered as a result of any throttle command being issued by any device for the cab(loc) in question.
 
 <l cab reg speedByte functMap>
 cab: DCC Address of the decoder/loco
 reg: redundant. Not used.
 speedbyte: Speed in DCC speedstep format .
  reverse - 2-127 = speed 1-126, 0 = stop
  forward - 130-255 = speed 1-126, 128 = stop
 FunctMap: individual function states represented by the the bits in a byte
 
 Legacy response: Deprecated
 <T reg speed dir> - do not rely on this response

 Version Deprecated: 4.1.1
 Notes:
 The speedbyte value is different to the speed sent, as it is an encoded (1,7 bits) byte.
 This starts a reminder process for any external updates to the cab’s (loco’s) status.

Turnout/Points

Command

Description / Response

<T id>

Delete defined turnout/point

 Parameters:
 id: identifier of the Turnout/Point

 Response:
 ???

<T>

Request a list all defined turnouts/Points

 Parameters:
 N/A

 Response:
 Repeated for each defined Turnout/Point
 Response (DCC Accessories): <H id DCC address subaddress state>
 Response (Servos): <H id SERVO vpin thrown_position closed_position profile state>
 Response (VPIN): <H id VPIN vpin state>
 Response (LCN): <H id LCN state>
 Response (fail): ?
 Response (no defined turnouts/points): ?
 
 state - 0=closed 1=thrown

<J T id>

Request details of a specific Turnout/Point

 Parameters:
 id: unique id of the Turnout/Point

 Response:
 <jT id X|state |ˮ[desc]ˮ>
 id: unique id of the Turnout/Point
 state: one of
  C = Closed
  T = Thrown
  X = unknown id
 desc: one of
  ˮdescˮ = description of the Turnout(Point) (including surrounding quotes)
  blank = unknown id
 
 e.g.
 Response (id is defined): <jT id state ˮ[desc]ˮ>
 Response (id not defined): <jT id X>

<J T>

Request the list of defined turnout/Point IDs

 Parameters:
 N/A

 Response:
 <jT [id1 id2 id3 …]>
 id: unique id of the Turnout/s(Point/s)
 
 e.g.
 Response (has defined Turnouts/Points): <jT id1 id2 id3 …>
 Response (no defined Turnouts/Points): <jT>

<T id state>

Throw (1 or T) or close(0 or C) a defined turnout/point

 Parameters:
 id: identifier of the Turnout/Point
 state: one of
  1=Throw,
  T=Throw,
  0=Close,
  C=Close

 Response:
 <H id state>
 id: one of
  identifier of the Turnout/Point, or
  X if the command fails
 state: one of
  1 = Thrown,
  0 = Closed
  blank = command failed
 
 e.g.
 Response (successful): <H id 0|1>
 Response (fail): <X>

Routes/Automations

Command

Description / Response

<J A>

Request a list of Automations/Routes

 Parameters:
 N/A

 Response:
 <jA [id0 id1 id2 ..]>
 id?: identifier of the Route/Automation(s)
 
 e.g.
 Response (successful turnouts/point exist): <jA id0 id1 id2 ..>
 Response (successful turnouts/point don’t exist): <jA.>
 Response (fail): ???

<J A id>

Requests information for a route/automation

 Parameters:
 id: identifier of the Route/Automation

 Response:
 <jA id X|type |ˮdescˮ>
 id: identifier of the Route/Automation
 type: one of
  ‘R’= Route
  ‘A’=Automation
 “desc”: Textual description of the route/automation always surrounded in quotes (“)
 
 e.g.
 Response (successful): <jA id type ˮdescˮ>
 Response (fail - is not defined): <jA id X>
 

System Information

Command

Description / Response

<c>

Request Current on the Track(s)

 Parameters:
 N/A

 Response:
 <c ˮCurrentMAINˮ current C ˮMilliˮ ˮ0ˮ max_ma ˮ1ˮ trip_ma>
 ˮCurrentMAINˮ: Static text for software like JMRI
 current: Current in MilliAmps
 C: Designator to signify this is a current meter (V would be for voltage)
 ˮMilliˮ: Unit of measure for external software with a meter like JMRI (Milli, Kilo, etc.)
 ˮ0ˮ: numbered parameter for external software (1,2,3, etc.)
 max_ma: The maximum current handling of the motor controller in MilliAmps
 ˮ1ˮ: number parameter for external software (we use 2 parameters here, 0 and 1)
 trip_ma - The overcurrent limit that will trip the software circuit breaker in mA

 Version Introduced: ??.

<s>

Requests the DCC-EX version and hardware info, along with listing defined turnouts.

 Parameters:
 N/A

 Response:
 <iDCCEX version / microprocessorType / MotorControllerType / buildNumber>
 (repeated for each defined Turnout/Point): <H id state>
 
 version: Command Station version
 microprocessorType: microprocessor type (e.g. MEGA)
 MotorControllerType: Motor controller type (e.g. SATNDARD_MOTOR_SHIELD)
 buildNumber: Command Station build number
 id: unique identifier for the Turnout/Point
 state: one of
  1=thrown
  0=Closed

<#>

Requests the number of supported cabs(locos)

 Parameters:
 N/A

 Response:
 <# noCabs>
 noCabs: maximum number of Cabs(Locos) supported by the command station
 

 Notes:
 This will display the number of available cab slots. This will typically be <# 20>, <# 30>, or <# 50> depending on how much memory your EX‑CommandStation has available.
 This is a design limit based on the memory limitations of the particular hardware and a compromise with other features that require memory such as WiFI. If you need more slots and are comfortable with code changes you can adjust this by changing MAX_LOCOS in “DCC.h”, knowing that each new slot will take approximately 8 bytes of memory. The <D RAM> command will display the amount of free memory. If you fill the available slots, the “Forget Locos” command (<- [CAB]>) will free up unused locos. Currently there is no automatic purging of unused locos.

Writing CVs - Program on the main

Command

Description / Response

<b address cv bit value>

Write CV bit on main track

 Parameters:
 address: DCC Address of the decoder/loco
 cv: CV number
 bit: ???
 value: value to change the CV to

 Response:
 ???

<w address cv value>

Write CV on main track

 Parameters:
 address: DCC Address of the decoder/loco
 cv: CV number
 value: value to change the CV to

 Response:
 N/A

Reading/Writing CVs - Programming track

Command

Description / Response

<R cv>

Read CV

 Parameters:
 cv: CV number

 Response:
 <r cv value>
 cv: CV number
 value: one of
  value of the CV
  -1: if the write failed

<R>

Read DCC decoder address

 Parameters:
 N/A

 Response:
 <r -cab>
 cab:
  DCC Address of the decoder/loco
  -1 = failed read
 
 e.g.
 Response (successful): <r cab>
 Response (fail): <r -1>

<V cv bit onOff>

Verify/Read bit of CV with guessed value

 Parameters:
 cv: CV number
 bit: bit to verify in the CV
 onOff: one of
  1=on
  0=off

 Response:
 ???

<V cv value>

Verify/Read of CV with guessed value

 Parameters:
 cv: CV number
 value: value to verify

 Response:
 <v cv value>
 cv: CV number
 value: one of
  actual value of the CV
  -1: if the write failed

 Notes:
 Additional Notes

<B cv bit onOff>

Write bit to CV

 Parameters:
 cv: CV number
 bit: bit to change in the CV
 onOff: one of
  1=on
  0=off

 Response:
 ???

<W cv value >

Write CV

 Parameters:
 cv: CV number
 value: value to change the CV to

 Response:
 <w cv value>
 cv: CV number
 value: one of
  value CV was changed to
  -1: if the write failed

<W address>

Write DCC address to cab (loco)

 Parameters:
 address: DCC Address of the decoder/loco

 Response:
 <w address>
 address: one of
  DCC Address of the decoder/loco
  -1 = failed read
 
 Response (successful): <w cab>
 Response (fail): <w -1>

 Notes:
 Writes, and then verifies, the address to decoder of an engine on the programming track. This involves clearing any consist and automatically setting a long or short address. This is an easy way to put a loco in a known state to test for issues like not responding to throttle commands when it is on the main track.

<P register hex1 hex2 [hex3 [hex4 [hex5]]]>

Writes a DCC packet to the PROG track

 Parameters:
 register: an internal register number, from 0 through MAX_MAIN_REGISTERS (inclusive), to write (if REGISTER=0) or write and store (if REGISTER>**0) the packet
 byte1: first hexadecimal byte in the packet
 byte2: second hexadecimal byte in the packet
 byte3: optional third hexadecimal byte in the packet
 byte4: optional fourth hexadecimal byte in the packet
 byte5: optional fifth hexadecimal byte in the packet

 Response:
 ???

<B cv bit value callbacknum callbacksub>

Deprecated, please use <W cv value> instead

 Deprecated
 Parameters:
 cv: CV to write
 bit: bit of the CV to change
 value: value to chnage the bit of CV to
 callbacknum: ???
 callbacksub: ???

 Response:
 ???

 Version Deprecated: ???

<W cv value callbacknum callbacksub>

Deprecated, please use <w cv value> instead

 Deprecated
 Parameters:
 cv: CV to write
 value: value to change the CV to
 callbacknum: ???
 callbacksub: ???

 Response:
 ???

 Version Deprecated: ???

Writing CVs - Programming track - Tuning

Command

Description / Response

<D ACK RETRY x>

Adjust ACK retries to number x (default is 2)

 Parameters:
 x: ???

 Response:
 N/A

<D PROGBOOST>

Override 250mA prog track limit while idle

 Parameters:
 N/A

 Response:
 N/A

DCC Accessories

Command

Description / Response

<a addr subaddr activate>

Control an Accessory Decoder

 Parameters:
 addr: the primary address of the decoder controlling the turnout (0-511)
 subaddr: the subaddress of the decoder controlling this turnout (0-3)
 activate: one of
  0=off, deactivate, straight or Closed
  1=on, activate, turn or thrown

 Response:
 ???

<a linear_addr activate>

Control an Accessory Decoder

 Parameters:
 linear_addr: linear address of the decoder controlling this turnout (1-2044)
 activate: one of
  0=off, deactivate, straight or Closed
  1=on, activate, turn or thrown

 Response:
 ???

Sensors

Command

Description / Response

<Q>

Lists Status of all sensors

 Parameters:
 N/A

 Response:
 Repeat for each defined sensor: <q id>
 
 e.g.
 Response (successful) Repeat for each defined sensor: <q id>
 Response (fail): N/A

<S>

Requests a definition list of all defined sensors

 Parameters:
 N/A

 Response:
 Repeated for each defined sensor: <Q id vpin pullup>
 id: identifier of the Sensor. (0-32767)
 vpin: pin number of the input to be controlled by the sensor object
 pullup: one of
  1=Use pull-up resistor ACTIVE=LOW
  0=don’t use pull-up resistor ACTIVE=HIGH
 
 e.g.
 Response (successful) Repeated for each defined sensor: <Q id vpin pullup>
 Response (fail): <X>

WiFi Control

Command

Description / Response

<+X>

Force the Command Station into “WiFi Connected” mode

 Parameters:
 N/A

 Response:
 ???

<+command>

Sends AT+ commands to the WiFi board (ESP8266, ESP32, etc.)

 Parameters:
 command: what you want to append after AT+ and send to the AT processor.

 Response:
 

 Notes:
 <+X> would send AT+X to the ESP

<+>

Switch to direct communication with WiFi AT processor

 Parameters:
 None

 Response:
 All input and output from this point is the direct communication with the Wifi AT software this mode is ended by typing ! (exclamationmark).

Track Manager (Formally DC-District)

Note: this is not available yet in the Production release of EX‑CommandStation

Command

Description / Response

<= trackletter mode [cab]>

Configure Track Manager Note: since only one channel can be PROG, changing a second channel to PROG, will force the other to OFF

 Parameters:
 trackletter: A through H and represents one of the outputs of the/a motor shield.
 mode: one of
  MAIN
  PROG
  DC
  DCX = DC reversed polarity
  OFF (DCX is DC with reversed polarity)
 id: the cab ID. Required when specifying DC or DCX

 Response:
 (for each track/channel that has changed) <= trackletter state cab>
 
 trackletter: A-H
 state: PROG, MAIN DC, DCX
 cab: cab(loco) equivalent to a fake DCC Address

<=>

Request the current Track Manager configuration

 Parameters:
 N/A

 Response:
 for each track/channel supported by the motor shield <= trackletter state cab>
 
 trackletter: A-H
 state: PROG, MAIN DC, DCX
 cab: cab(loco) equivalent to a fake DCC Address

EX-RAIL

Command

Description / Response

</ KILL taskId>

Kills a currently running script task by ID (use to list task IDs)

 Parameters:
 taskId: ??

 Response:
 ???

</ LATCH sensorId>

Lock sensor ON, preventing external influence

 Parameters:
 sensorId: ?? valid ids and in the range 0-255

 Response:
 ???
 
 <* Opcode=L params=2 *>
 <* p[0]=-7906 (0xE11E) *>
 <* p[1]=24 (0x18) *>
 <X>

</ FREE blockId>

Manually frees a virtual track Block

 Parameters:
 blockId: ?? valid ids and in the range 0-255

 Response:
 ???

</ RESERVE blockId>

Manually reserves a virtual track Block

 Parameters:
 blockId: ?? valid ids and in the range 0-255

 Response:
 ???

</ PAUSE>

Pauses ALL EX-RAIL automation actvites, including sending an E-STOP to all locos.

 Parameters:
 N/A

 Response:
 N/A

</>

Request EX-RAIL running task information.

 Parameters:
 N/A

 Response:
 <* EXRAIL STATUS |BR| |_| ID=0,PC=189,LOCO=0 ,SPEED=0F |BR| |_| ID=2,PC=267,LOCO=0 ,SPEED=0F |BR| |_| ID=1,PC=228,LOCO=0 ,SPEED=0F |BR| |_| RED[110] |BR| |_| RED[113] *>
 
 

</ ROUTES>

Request the Routes & Automations control list in wiThrottle Protocol format.

 Parameters:
 N/A

 Response:
 <X>

</ RESUME>

Resumes ALL EX-RAIL automation actvites, and resumes all locos at the same speed at which they were paused.

 Parameters:
 N/A

 Response:
 N/A

</ START [locoAddr] routeId>

Starts a new task to send a loco onto a Route, or activate a non-loco Animation or Sequence

 Parameters:
 locoAddr: DCC address of the loco
 routeId: id of the rout to start

 Response:
 ???

</ UNLATCH sensorId>

Unlock sensor, returning to current external state

 Parameters:
 sensor_id: ?? valid ids and in the range 0-255

 Response:
 ???
 
 <* Opcode=U params=2 *>
 <* p[0]=23772 (0x5CDC) *>
 <* p[1]=24 (0x18) *>
 <X>

<D EXRAIL state>

When the CommandStation is connected to a serial monitor, EX-RAIL script logging can be Enabled or Disabled

 Parameters:
 state: one of
  ON
  OFF

 Response:
 N/A

Configuring the EX-CommandStation

Configuring the EX-CommandStation - Turnouts/Points

Command

Description / Response

<T id DCC addr subaddr>

Define turnout on a DCC Accessory Decoder with the specified address and subaddress

 Parameters:
 id: identifier of the Turnout/Point
 addr: ???
 subaddr: ???

 Response:
 ???

<T id DCC linearAddr>

Define turnout on a DCC Accessory Decoder with the specified linear address

 Parameters:
 id: identifier of the Turnout/Point
 linearAddr: ???

 Response:
 ???

<T id VPIN vpin>

Define turnout output on specified vpin.

 Parameters:
 id: unique Id for the servo
 vpin: vpin to which the servo is attached

 Response:
 ???

 Notes:
 This may be used for controlling Arduino digital output pins or pins on an I/O Extender.

<T id SERVO vpin thrownPos closedPos profile>

Define turnout servo (PWM) on specified vpin Note: Servos are not supported on the minimal HAL (Uno or Nano target).

 Parameters:
 id: unique Id for the servo
 vpin: vpin to which the servo is attached
 thrownPos: position for the servo when thrown
 closedPos: position for the servo when closed
 profile: one of
  0=Instant,
  1=Fast (0.5 sec),
  2=Medium (1 sec),
  3=Slow (2 sec) and
  4=Bounce (subject to revision).

 Response:
 <X|O>
 
 Response (successful): <O>
 Response (fail): <X>

 Notes:
 The active and inactive positions are defined in terms of the PWM parameter (0-4095 corresponds to 0-100% PWM). The limits for an SG90 servo are about 102 to 490. The standard range of 1ms to 2ms pulses correspond to values 205 to 409.
 Profile defines the speed and style of movement: 0=Instant, 1=Fast (0.5 sec), 2=Medium (1 sec), 3=Slow (2 sec) and 4=Bounce (subject to revision).
 

<T id>

Deletes a turnout by Id.

 Parameters:
 id: unique Id for the servod

 Response:
 ???

<D SERVO vpin value [profile]>

Set servo position to value on pin vpin.

 Parameters:
 vpin: vpin to which the servo is attached
 value: position to mve the servo to
 profile: one of
  0 = instant
  1 = fast
  2 = medium
  3 = slow
  4 = bounce

 Response:
 N/A

<T id addr subaddr>

Define a turnout on a DCC Accessory Decoder with the specified address and subaddress - Legacy command

 Deprecated
 Parameters:
 id: identifier of the Turnout/Point
 addr: ???
 subaddr: ???

 Response:
 ???

 Version Deprecated: ???

<T id vpin activePos inactivePos>

Define a turnout servo on specified vpin - Legacy command

 Deprecated
 Parameters:
 id: identifier of the Turnout/Point
 vpin: vpin of the input to be controlled by the sensor object
 activePos: ???
 inactivePos: ???

 Response:
 ???

 Version Deprecated: ???
 Notes:
 The positions are the same as for the turnout servo command above. Note: Servos are not supported on the minimal HAL (Uno or Nano target).

Once all turnout/points have been properly defined, you can use the <E> (upper case E) command to store their definitions to EEPROM.

Configuring the EX-CommandStation - Sensors

Command

Description / Response

<S id vpin pullup>

Create a new sensor ID

 Parameters:
 id: identifier of the Sensor (0-32767)
 vpin: vpin of the input to be controlled by the sensor object
 pullup: one of
  1=Use pull-up resistor ACTIVE=LOW
  0=don’t use pull-up resistor ACTIVE=HIGH

 Response:
 <O>
 
 Response (successful): <O>
 Response (fail): ????

 Notes:
 Once defined, the EX-CS will send a <Q id> response anytime the sensor is activated, and a <q id> response when deactivated.

<S id>

Delete defined sensor

 Parameters:
 id: identifier of the Sensor (0-32767)

 Response:
 <O|X>
 
 Response (successful): <O>
 Response (fail): <X>

Once all sensors have been properly defined, you can use the <E> (upper case E) command to store their definitions to EEPROM.

Configuring the EX-CommandStation - Servos

Command

Description / Response

<S id pin state>

Creates a new sensor ID, with specified PIN and PULLUP

 Parameters:
 id: identifier of the Sensor (0-32767)
 pin: pin the sensor is connected to
 state: one of
  0= ???
  1=???

 Response:
 ???

<S id>

Deletes definition of sensor

 Parameters:
 id: identifier of the Sensor (0-32767)

 Response:
 ???

Configuring the EX-CommandStation - Outputs

Command

Description / Response

<Z id pin iflag>

Creates a new output ID, with specified PIN and IFLAG values

 Parameters:
 id: identifier of the output
 pin: pin to which the output will be connected
 iflag: see below
 
 iflag, bit 0:
  0 = forward operation (ACTIVE=HIGH / INACTIVE=LOW)
  1 = inverted operation (ACTIVE=LOW / INACTIVE=HIGH)
 iflag, bit 1:
  0 = state of pin restored on power-up to either ACTIVE or INACTIVE depending on state before power-down.
  1 = state of pin set on power-up, or when first created, to either ACTIVE of INACTIVE depending on IFLAG, bit 2
 iflag, bit 2:
  0 = state of pin set to INACTIVE upon power-up or when first created
  1 = state of pin set to ACTIVE upon power-up or when first created

 Response:
 ???

<Z id>

Deletes definition of output ID

 Parameters:
 id: identifier of the output to delete

 Response:
 ???

<Z>

Lists all defined output pins

 Parameters:
 N/A

 Response:
 ???

<Z id state>

Sets output ID to either INACTIVE or ACTIVE state

 Parameters:
 id: identifier of the output
 state: one of
  0= ???
  1= ???

 Response:
 ???

Configuring the EX-CommandStation - EEPROM management

Command

Description / Response

<D EEPROM>

Diagnostic dump eeprom contents

 Parameters:
 N/A

 Response:
 ???

<e>

Erase ALL (turnouts, sensors, and outputs) from EEPROM

 Parameters:
 N/A

 Response:
 <O>

<E>

Store definitions to EEPROM

 Parameters:
 N/A

 Response:
 <O>

Configuring the EX-CommandStation - Diagnostic programming commands

Command

Description / Response

<D PROGBOOST>

Override 250mA prog track limit while idle

 Parameters:
 N/A

 Response:
 N/A

 Notes:
 When the programming track is switched on with <1> or <1 PROG> it will normally be restricted to 250mA according to NMRA standards. Some loco decoders require more than this, especially sound versions. <D PROGBOOST> temporarily removes this limit to allow the decoder to use more power. The normal limit will be re-imposed when the programming track is switched off with <0> or <0 PROG> or the Command Station is reset.

<D ACK LIMIT mA>

Sets the ACK limit

 Parameters:
 mA: currently limit in milliamps

 Response:
 N/A

 Notes:
 The Ack current limit is set according to the DCC standard(s) of 60mA. Most decoders send a quick back and forth current pulse to the motor to generate this ACK. However, some modern motors (N and Z scales) may not be able to draw that amount of current. You can adjust down this limit. Or, if for some reasons your acks seem to be too “trigger happy” you can make it less sensitive by raising this limit.

<D ACK MAX µS>

Sets the ACK pulse maximum

 Parameters:
 µS: ACK pulsedureation in milliseconds upper bound

 Response:
 N/A

 Notes:
 see MIN

<D ACK MIN µS>

Sets the ACK pulse minimum

 Parameters:
 µS: ACK pulsedureation in milliseconds lower bound

 Response:
 N/A

 Notes:
 The NMRA specifies that the ACK pulse duration should be 6 milliseconds, which is 6000 microseconds (µS), give or take 1000 µS. That means the minimum pulse duration is 5000 µS and the maximum is 7000 µS. There are many poorly designed decoders in existence so DCC-EX extends this range from 4000 to 8500 µS. If you have any decoders that still do not function within this range, you can adjust the ACK MIN and ACK MAX parameters.

Diagnostic traces

Command

Description / Response

<D ACK state>

Enables ACK diagnostics

 Parameters:
 state: one of
  ON
  OFF

 Response:
 ˮAck diag onˮ or ˮAck diag offˮ
 Displayed on the serial monitor only.

 Notes:
 This will turn ACK diagnostics ON and then try to read the appropriate CVs to determine your loco address.

<D CMD state>

Enables Command Parser diagnostics

 Parameters:
 state: one of
  ON
  OFF

 Response:
 N/A

 Notes:
 When enabled, diagnostic messages will be shown on the the serial monitor.

<D ETHERNET state>

Enables Ethernet diagnostics

 Parameters:
 state: one of
  ON
  OFF

 Response:
 N/A

 Notes:
 When enabled, diagnostic messages will be shown on the the serial monitor.

<D LCN state>

Enables LCN interface diagnostics

 Parameters:
 state: one of
  ON
  OFF

 Response:
 N/A

<D WIFI state>

Enables WiFi diagnostics

 Parameters:
 state: one of
  ON
  OFF

 Response:
 N/A

 Notes:
 When enabled, diagnostic messages will be shown on the the serial monitor.

<D WIT state>

Enables WiThrottle diagnostics

 Parameters:
 state: one of
  ON
  OFF

 Response:
 N/A

 Notes:
 When enabled, diagnostic messages will be shown on the the serial monitor.

<D CABS>

Shows cab numbers and speed in reminder tables

 Parameters:
 N/A

 Response:
 ˮUsed=xxx, max=yyyˮ
 Displayed on the serial monitor only.

<D HAL SHOW>

Shows configured servo board and GPIO extender board config and used pins

 Parameters:
 N/A

 Response:
 ???

<D RAM>

Shows remaining RAM (Free Memory)

 Parameters:
 N/A

 Response:
 ˮFree memory=xxxxˮ
 Displayed on the serial monitor only.

I/O (HAL) Diagnostics

Command

Description / Response

<D HAL SHOW>

List HAL devices and allocated VPINs

 Parameters:
 N/A

 Response:
 ???

<D ANIN vpin>

Read and display pin vpin’s analogue value.

 Parameters:
 vpin: ??

 Response:
 ???

<D ANOUT vpin value [param2]>

Write value to analogue pin vpin, supplying param2 to the driver.

 Parameters:
 vpin: ??
 value: ??
 param2: ??

 Response:
 ???

Write direct DCC packet

Command

Description / Response

<M register hex1 hex2 [hex3 [hex4 [hex5]]]>

Write a DCC packet the MAIN track

 Parameters:
 register: ignored
 byte1: first hexadecimal byte in the packet
 byte2: second hexadecimal byte in the packet
 byte3: optional third hexadecimal byte in the packet
 byte4: optional fourth hexadecimal byte in the packet
 byte5: optional fifth hexadecimal byte in the packet

 Response:
 N/A

 Notes:
 register for backwards compat (can not be removed because number of arguments is unknown)

<P register hex1 hex2 [hex3 [hex4 [hex5]]]>

Write a DCC packet the MAIN track

 Parameters:
 register: ignored
 byte1: first hexadecimal byte in the packet
 byte2: second hexadecimal byte in the packet
 byte3: optional third hexadecimal byte in the packet
 byte4: optional fourth hexadecimal byte in the packet
 byte5: optional fifth hexadecimal byte in the packet

 Response:
 N/A

 Notes:
 register for backwards compat (can not be removed because number of arguments is unknown)

Other

Command

Description / Response

<U cmd>

Is reserved for user commands (through user filter)

 Parameters:
 cmd: user defined command

 Response:
 N/A

More Information

For a detailed command reference, see…

Command Reference