DCC-EX Serial Command List¶
The following list is dynamically built from the CommandStation-EX code. It contains all the serial commands with brief definitions. In many cases the parameters are self explanatory. For example a tSpeed will always be -1..127 where 0=stop and -1=emergency stop. (See the Common Elements / Parameters section for more information on this and other common elements.)
This list appears in the order in which the command parser will detect command patterns.
Clicking on a command pattern will search this web site for pages which describe or use that command.
Note: This list is easily, automatically, generated but the various links spread about the documentation take a lot of effort and will be built over time.
DCC-EX Serial Commands Overview¶
Click to expand
- Serial commands are accepted as input from the USB serial connection or a TCP/IP connection.
- Commands have a single case dependent character opcode and optionally parameters.
- Keyword parameters are shown in upper case but may be entered in mixed case.
- Value parameters are decimal numeric (unless otherwise noted)
- Not all commands have a response, and broadcasts mean that not all responses come from the last commands that you have issued.
- Commands entered like
<JA>are actually read as<J A>, so<Ja>is also acceptable. - Commands that produce diagnostic information (which is intended for human reading rather than code) only write to the USB Serial output.
- Commands that cause state changes (such as loco speeds, turnout position) cause broadcasts to all serial connections and, where appropriate, WiThrottle protocol connections.
DCC-EX Serial Commands are also referred to as Native DCC-EX Commands/Protocol or DCC-EX Native Commands/Protocol.
Refer to the WiThrottle VS Native Serial Protocol page for information on the differences to the WiThrottle protocol/commands.
Conventions Used for Command Descriptions¶
Click to expand
<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, e.g.
1,c, or- - CAPITALISED words - These are parameters referred to as keywords, and should be specified as directed, e.g.
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 " ", e.g.
locoor«loco» - 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|1DIRECTION: 1=forward, 0=reverse.
Common Elements / Parameters¶
Click to expand
The following are element / parameters that are common across multiple commands and are described here for ease of reference.
| Parameter | Description |
|---|---|
| cab or loco |
The short (1-127) or long (128-10293) address of the engine decoder. (This has to be already programmed in the decoder.) Note: DCC-EX commands do not distinguish between short and long DCC addresses, so you can use the same command format for both. |
| dir or direction |
One of - 1=forward - 0=reverse |
| tSpeed | 0-127 or -1 for Emergency Stop |
| speedByte | Speed in DCC speedstep format. This is an encoded (1-7 bits) byte. The single value incorporates both speed and direction, with the following values: - reverse - 2-127 = speed 1-126, 0 = stop, 1 = Emergency Stop - forward - 130-255 = speed 1-126, 128 = stop, 129 = Emergency Stop |
| id | The numeric ID (0-32767) assigned to an element to control. ids are generally unique within the element type, but not across element types. (NOTE: ids are shared between Turnouts/Points, Sensors and Outputs) |
| vpin | Generally, the pin number of the physical input or output GPIO to receive information from or to control. vpins are normally assigned to an id to use in subsequent commands. For GPIOs on the microcontroller, this is the same as the pin number. For servo outputs and I/O expanders, it is the pin number defined for the HAL device (if present), for example 100-115 for servos attached to the first PCA9685 Servo Controller module, 200-215 for the second PCA9685 Servo Controller module, 300-315 for the first PCA9685 I/O Expander module, and 400-415 for the second PCA9685 I/O Expander module. |
Command List¶
<!>¶
Emergency stop all locos
<! P>¶
ESTOP Pause layout
<! Q>¶
ESTOP Query paused status
<! R>¶
ESTOP Resume paused layout
<#>¶
Request number of simultaneously supported locos
<->¶
Clear loco state and reminder table
<- loco>¶
Remove loco state and reminders
</>¶
Stream EXRAIL status
</ AMBER signal>¶
Set Signal to Amber/Yellow
</ FREE section>¶
Free reserve on section
</ FREEALL>¶
Free all reserves
</ GREEN signal>¶
Set signal to Green
</ KILL ALL>¶
Kill all EXRAIL tasks
</ KILL taskid>¶
Kill specific EXRAIL tasks
</ LATCH latch>¶
Set pin latch
</ PAUSE>¶
Pause all EXRAIL tasks
</ RED signal>¶
Set signal to Red
</ RESERVE section>¶
Flag section as reserved
</ RESUME>¶
Resume all tasks
</ START loco route>¶
Start an AUTOMATION or sequence with a loco
</ START route>¶
Start a route or sequence
</ UNLATCH latch>¶
Remove pin latch
<0>¶
Power off all tracks
<0 MAIN>¶
Power off MAIN track
<0 PROG>¶
Power off PROG track
<0 track>¶
Power off given track
<1>¶
Power ON all tracks
<1 JOIN>¶
JOIN prog track to MAIN and power
<1 MAIN>¶
Power on MAIN track
<1 PROG>¶
Power on PROG track
<1 track>¶
Power on given track
<=>¶
List track manager states
<= track AUTO>¶
Update track to auto reverse
<= track DC loco>¶
Set track to DC
<= track DC_INV loco>¶
Set track to DC with inverted polarity
<= track DCX loco>¶
Set track to DC with inverted polarity
<= track EXT>¶
Set track to use external sync
<= track INV>¶
Update track to inverse polarity
<= track MAIN>¶
Set track to MAIN
<= track MAIN_AUTO>¶
Set track to MAIN with auto reversing
<= track MAIN_INV>¶
Set track to MAIN inverted polarity
<= track NONE>¶
Set track no output
<= track OFF>¶
Set track power OFF
<= track PROG>¶
Set track to PROG
<= track RAILCOM>¶
Update track to add cutout
<@>¶
Request all virtual msgs to this client
<@ display row text>¶
Display text on virtual LCD at row
<^>¶
List consists
<^ leadLoco follower [ follower2..7]>¶
Creates a consist from up to 8 loco ids (negative for loco in reverse)
<^ loco>¶
Uncouples any consist containing this loco
<a address activate>¶
Send dcc accessory command to linear address
activate: 0=deactivate, 1=activate
<A address aspect>¶
Send DCC extended accessory (Aspect) command
<a address subAddr activate>¶
Send DCC accessory command activate: 0=deactivate, 1=activate
<a address subAddr activate onoff>¶
Send DCC accessory command with onoff control activate: 0=deactivate, 1=activate onoff: 0=off, 1=on, 2=toggle
<B cv bitPosition bitValue>¶
Write cv bit
<b loco cv bitPosition bitValue>¶
POM write cv bit on main track
<c>¶
Report main track current (Deprecated)
<C ETHERNET OFF>¶
Disable Ethernet
<C ETHERNET ON>¶
Enable Ethernet
<C HOSTNAME hostname>¶
set Wifi/eth hostname (in quotes)
<C NODE ON>¶
Enable Node mode without throttle support
<C NVS nvsnumber nvsvalue>¶
set Non Volatile storage value (int or quoted string)
<C PROGBOOST>¶
Configure PROG track boost
<C RAILCOM OFF>¶
Disable Railcom cutout
<C RAILCOM ON>¶
Enable Railcom cutout
<C RESET>¶
Reset and restart command station
<C SNIFFER OFF>¶
Turn sniffer output off
<C SNIFFER ON>¶
Turn sniffer output on
<C SPEED128>¶
Set all DCC speed commands to 128 step (default)
<C SPEED28>¶
Set all DCC speed commands as 28 step to old decoders
<C WIFI AP ssid password>¶
Set WiFi to AP mode with given ssid and password (in quotes)
<C WIFI AP ssid password channel>¶
Set WiFi to AP mode with given ssid and password (in quotes)
<C WIFI DEFAULT>¶
Set WiFi to default credentials
<C WIFI HIDDENAP ssid password>¶
Set WiFi to hidden AP mode with given ssid and password (in quotes)
<C WIFI HIDDENAP ssid password channel>¶
Set WiFi to hidden AP mode with given ssid and password (in quotes)
<C WIFI HOSTNAME hostname>¶
(deprecated, use C,HOSTNAME,hostname instead)
<C WIFI OFF>¶
Disable WiFi
<C WIFI ON>¶
Enable Wifi
<C WIFI ssid password>¶
Set WiFi ssid and password (in quotes, like "mySSID" and "myPassword")
<C WIFI TEMP ssid password>¶
Set WiFi ssid and password temporarily (in quotes)
<D ACK LIMIT value>¶
Set ACK detection limit mA
<D ACK MAX value>¶
Set ACK maximum duration uS
<D ACK MAX value MS>¶
Set ACK maximum duration mS
<D ACK MIN value>¶
Set ACK minimum duration uS
<D ACK MIN value MS>¶
Set ACK minimum duration mS
<D ACK OFF>¶
Disable PROG track diagnostics
<D ACK ON>¶
Enable PROG track diagnostics
<D ACK RETRY value>¶
Set ACK retry count
<D ANIN vpin>¶
Display analogue input value
<D ANOUT vpin position>¶
same as
<D ANOUT vpin position profile>¶
see
<D CABS>¶
Diagnostic display loco state table
<D CMD OFF>¶
Disable command input diagnostics
<D CMD ON>¶
Enable command input diagnostics
<D EEPROM numEntries>¶
Dump EEPROM contents
<D ETHERNET OFF>¶
Disable Ethernet diagnostics
<D ETHERNET ON>¶
Enable Ethernet diagnostics
<D ETHERNET SHOW>¶
Show Ethernet status
<D EXRAIL OFF>¶
EXRAIL diagnostics off
<D EXRAIL ON>¶
EXRAIL diagnostics on
<D HAL RESET>¶
Reset all HAL devices
<D HAL SHOW>¶
Show HAL devices table
<D LCN OFF>¶
Disable LCN diagnostics
<D LCN ON>¶
Enable LCN Diagnostics
<D NODE OFF>¶
Disable Node diagnostics
<D NODE ON>¶
Enable Node diagnostics
<D NVS>¶
Show all non-zero NVS values (Not Loco CVs)
<D NVS value>¶
Show specific NVS value
<D RAILCOM OFF>¶
DIsable Railcom diagnostics
<D RAILCOM ON>¶
Enable Railcom diagnostics
<D RAM>¶
Diagnostic display free RAM
<D RESET>¶
Reset and restart command station
<D SERVO vpin position>¶
Test servo
<D SERVO vpin position profile>¶
Test servo
<D TT vpin steps>¶
Test turntable
<D TT vpin steps activity>¶
Test turntable
<D WEBSOCKET OFF>¶
Disable WebSocket diagnostics
<D WEBSOCKET ON>¶
Enable WebSocket diagnostics
<D WIFI OFF>¶
Disable WiFi diagnostics
<D WIFI ON>¶
Enable WiFi diagnostics
<D WIFI SHOW>¶
Show WiFi status
<D WIT OFF>¶
Disable WiThrottle diagnostics
<D WIT ON>¶
Enable WiThrottle diagnostics
<E>¶
STORE EPROM
<e>¶
CLEAR EPROM
<f loco byte1>¶
Set loco function group (Deprecated use F)
<F loco DCCFREQ freqValue>¶
Set DC frequency for loco
<F loco function onoff>¶
Set loco function ON/OFF
<f loco group byte2>¶
Set loco function group (Deprecated use F)
<I>¶
List all turntables
<I id>¶
Broadcast turntable type and current position
<I id ADD position value angle>¶
Add turntable position
<I id DCC home>¶
Create DCC turntable
<I id EXTT vpin home>¶
Create an EXTT turntable
<I id position>¶
Rotate a DCC turntable
<I id position activity>¶
Rotate an EXTT turntable
<J A>¶
List Routes
<J A id>¶
List automation details
<J C>¶
Get fastclock time
<J C mmmm nn>¶
Set fastclock time
<J G>¶
Report gauge limits
<J I>¶
Report currents
<J L display row>¶
Direct current displays to LCS/OLED
<J M>¶
List stash values
<J M CLEAR ALL>¶
Clear all stash values
<J M CLEAR ANY loco>¶
Clear all stash entries that contain loco
<J M CLEAR stashId>¶
Clear given stash
<J M stashId>¶
get stash value
<J M stashId loco>¶
Set stash value
<J O>¶
List turntable IDs
<J O id>¶
List turntable state
<J P id>¶
List turntable positions
<J R>¶
List Roster
<J R id>¶
Get roster for loco
<J S>¶
list signals
<J S signal_id>¶
get signal state and description
<J T>¶
Get turnout list
<J T id>¶
Get turnout state and description
<K blockId loco>¶
Loco entering Block
<k blockId loco>¶
Loco exiting block
<L>¶
LCC/CBUS adapter introducing self
<L eventId>¶
LCC incoming event
<M ignore d0 d1 [d2 d3 d4 d5]>¶
Send up to 5 byte DCC packet on MAIN track (values in hex). The ignore value is for backward compatibility, use 0.
<m LINEAR>¶
Set Momentum algorithm to linear acceleration
<m loco accelerating braking>¶
Set momentum for loco
<m loco momentum>¶
Set momentum for loco (accel and braking)
<m POWER>¶
Set momentum algorithm to very based on difference between current speed and throttle setting
<N>¶
List current and alternate defines for SensorCam base vpins
<N cmd value>¶
execute SensorCam command with parameters
<N Q>¶
Lists full set of SensorCam sensor states
<o vpin>¶
Set neopixel on(vpin>0) or off(vpin<0)
<o vpin count>¶
Set multiple neopixels on(vpin>0) or off(vpin<0)
<o vpin r g b>¶
Set neopixel colour
<o vpin r g b count>¶
Set multiple neopixels colour
<P ignore d0 d1[ d2 d3 d4 d5]>¶
Send up to 5 byte DCC packet on PROG track (all d values in hex). The ignore value is for backward compatibility, use 0.
<Q>¶
List all sensors
<R>¶
Read driveable loco id (may be long, short or consist)
<R CONSIST>¶
Read consist id on PROG track
<R cv>¶
Read cv
<r loco cv>¶
POM read cv on MAIN track
<R LOCOID>¶
Read loco id (ignoring consist) on PROG track
<S>¶
List sensors
<s>¶
Command station status
<S id>¶
Delete sensor
<S id vpin pullup>¶
Create Sensor
<T>¶
List all turnouts
<T id>¶
Delete turnout
<T id addr subAddr>¶
Create DCC turnout (Deprecated use
<T id C>¶
Close Turnout
<T id DCC addr subAddr>¶
Create DCC turnout
<T id DCC linearAddr>¶
Create DCC turnout
<T id SERVO vpin closedValue thrownValue>¶
Create Servo turnout
<T id SERVO vpin closedValue thrownValue profile>¶
Create Servo turnout profile: 1=Fast, 2=Medium, 3=Slow
<T id T>¶
Throw Turnout
<T id value>¶
Close (value=0) or Throw turnout
<T id vpin closedValue thrownValue>¶
Create SERVO turnout (Deprecated use
<T id VPIN vpin>¶
Create pin turnout
<T id X>¶
List turnout details
<t loco>¶
Request loco status
<t loco tSpeed direction>¶
Set throttle speed(0..127) and direction (0=reverse, 1=fwd)
<V cv bitPosition bitValue>¶
Fast read bit with expected value
<V cv cValue>¶
Fast read cv with expected value
<w A linearaddress cv value>¶
POM write basic accessory decoder cv on main track
<W CONSIST loco>¶
write consist address on PROG track
<W CONSIST loco REVERSE>¶
Write consist address and reverse flag on PROG track
<W cv bitPosition bitValue>¶
Write cv bit on prog track
<W cv cValue>¶
Write cv value on PROG track
<w E linearaddress cv value>¶
POM write extended accessory decoder cv on main track
<W loco>¶
Write loco address on PROG track
<w loco cv value>¶
POM write cv on MAIN track
<y vpin EQ eq>¶
Set sound EQ
<y vpin FOLDER folder>¶
Switch to sound track folder
<y vpin PAUSE>¶
Pause sound
<y vpin PLAY trackNumber>¶
Play sound track with default volume
<y vpin PLAY trackNumber volume>¶
Play sound track with volume
<y vpin REPEAT trackNumber>¶
Repeat sound track with default volume
<y vpin REPEAT trackNumber volume>¶
Repeat sound track with volume
<y vpin RESET>¶
Reset sound module
<y vpin RESUME>¶
Resume sound
<y vpin STOP>¶
Stop playing sound
<y vpin VOL volume>¶
Set sound volume
<Z>¶
List Output definitions
<Z id>¶
Delete output
<Z id active>¶
Set output
<Z id pin iFlag>¶
Create Output
<z signedVpin>¶
Set pin. HIGH iv vpin positive, LOW if vpin negative
<z vpin analogue>¶
Write analogue device value
<z vpin analogue profile>¶
Write analogue device using profile number (Fade or servo movement)
<z vpin analogue profile duration>¶
Change analogue value over duration (Fade or servo move)
Build info:¶
Autogenerated from devel/DCCEXCommands.h at Thu Oct 1 00:42:57 UTC 2026