START SOUND SEQUENCE
<x CAB FN_BELL FN_HORN EFFECT DURATION [TRACK] >
Starts a sound sequence
- CAB: the short (1-127) or long (128-10293) address of the engine decoder
- FN_HORN: fn number of cab's bell (e.g. specify '2' for F2)
- FN_BELL: fn number of cab's horn (e.g. specify '1' for F1)
- EFFECT: sound effect sequences of air horn and/or bells as follows:
- 0 - Bells (continous duration or until stopped)
- 1 - Airhorn (continous duration or until stopped)
- 2 - Applying Airbrakes (1 short airhorn with bells)
- 3 - Releasing Airbrakes (2 long airhorn with bells)
- 4 - Warning Signal (1 long, 1 short airhorn with bells)
- 5 - Approaching Grade Crossing (2 long, 1 short, 1 long airhorn with with bells)
- 6 - Stopping/Backing Up (3 short airhorn with bells)
- 7 - Approaching Station or Junction (1 long airhorn with bells)
- DURATION: number of secs for the sound sequence.
- 0 - bells or airhorn is continous until stopped using stop sound command "<X>" is received
- [TRACK]: track #, defaults to main track when not specified
returns: < x CAB FN_BELL FN_HORN EFFECT DURATION [TRACK] >
STOP SOUND SEQUENCE
<X CAB FN_BELL FN_HORN EFFECT [TRACK] >
Stops sound sequence
- CAB: the short (1-127) or long (128-10293) address of the engine decoder
- FN_HORN: fn number of cab's bell (e.g. specify '2' for F2)
- FN_BELL: fn number of cab's horn (e.g. specify '1' for F1)
- EFFECT: sound effect sequence that was previously used to "Start Sound Sequence"
- [TRACK]: track # that was previously used to "Start Sound Sequence"
returns: < X CAB FN_BELL FN_HORN EFFECT [TRACK] >
SET ENGINE THROTTLES USING 128-STEP SPEED CONTROL
<t REGISTER CAB SPEED DIRECTION [TRACK] [DELAY]>
sets the throttle for a given register/cab combination
- REGISTER: an internal register number, from 1 through MAX_MAIN_REGISTERS (inclusive), to store the DCC packet used to control this throttle setting
- CAB: short (1 - 127) or long (128-10293) address of the engine decoder
- SPEED: throttle speed from 0-126, or -1 for emergency stop (resets SPEED to 0)
- DIRECTION: 1=forward, 0=reverse. Setting direction when speed=0 or speed=-1 only effects directionality of cab lighting for a stopped train
- [TRACK]: track # (0=both, 1=main, 2=prog). Defaults to main track when not specified.
- [DELAY]: delay in (s) before chaning speed. Note: must also specify [TRACK].
returns: <T REGISTER SPEED DIRECTION>
OPERATE ENGINE DECODER FUNCTIONS F0-F28
<f CAB BYTE1 [BYTE2]>
<f -1 REGISTER CAB BYTE1 [BYTE2]>
<f -2 REGISTER CAB FN TOGGLE [TRACK]>
turns on and off engine decoder functions F0-F28 (F0 is sometimes called FL) NOTE: setting requests transmitted directly to mobile engine decoder — current state of engine functions is not stored by this program
- REGISTER: an internal register number, from 1 through MAX_MAIN_REGISTERS (inclusive), to store the DCC packet used to control these functions.
- REGISTER is only used if the first argument is -1 or -2
- CAB: the short (1-127) or long (128-10293) address of the engine decoder
- FN: the FN number (0-28)
- TOGGLE:
- 1 = Toggle FN 'ON' (set corresponding bit on)
- 0 = Toggle FN 'OFF' (set corresonding bit off)
- [TRACK]: track #
- 0=both
- 1=main (default when not specified)
- 2=prog
- BYTE1 and BYTE2
- To set functions F0-F4 on (=1) or off (=0):
- BYTE1: 128 + F1*1 + F2*2 + F3*4 + F4*8 + F0*16
- BYTE2: omitted
- To set functions F5-F8 on (=1) or off (=0):
- BYTE1: 176 + F5*1 + F6*2 + F7*4 + F8*8
- BYTE2: omitted
- To set functions F9-F12 on (=1) or off (=0):
- BYTE1: 160 + F9*1 +F10*2 + F11*4 + F12*8
- BYTE2: omitted
- To set functions F13-F20 on (=1) or off (=0):
- BYTE1: 222
- BYTE2: F13*1 + F14*2 + F15*4 + F16*8 + F17*16 + F18*32 + F19*64 + F20*128
- To set functions F21-F28 on (=1) of off (=0):
- BYTE1: 223
- BYTE2: F21*1 + F22*2 + F23*4 + F24*8 + F25*16 + F26*32 + F27*64 + F28*128
returns: NONE
WRITE CONFIGURATION VARIABLE BYTE TO ENGINE DECODER ON MAIN OPERATIONS TRACK
<w CAB CV VALUE>
writes, without any verification, a Configuration Variable to the decoder of an engine on the main operations track
- CAB: the short (1-127) or long (128-10293) address of the engine decoder
- CV: the number of the Configuration Variable memory location in the decoder to write to (1-1024)
- VALUE: the value to be written to the Configuration Variable memory location (0-255)
returns: NONE
TURN ON POWER FROM MOTOR SHIELD TO TRACKS
<1 [TRACK]>
enables power from the motor shield to the main operations and programming tracks
- [TRACK]: optionally specify track number; 1=main, 2=prog. When not specified, enable power to both tracks.
returns: <p1>
TURN OFF POWER FROM MOTOR SHIELD TO TRACKS
<0 [TRACK]>
disables power from the motor shield to the main operations and programming tracks
- [TRACK]: optionally specify track number; 1=main, 2=prog. When not specified, disables power to both tracks.
returns: <p0>