EX-CommandStation EXRAIL Documentation
EXRAIL Language
Loading...
Searching...
No Matches
Macros
/home/runner/work/CommandStation-EX/CommandStation-EX/EXRAIL2MacroReset.h File Reference

Go to the source code of this file.

Macros

#define ACTIVATE(addr, subaddr)
 Send DCC Accessory Activate packet (gate on then off)
 
#define ACTIVATEL(longaddr)
 Send DCC Accessory Activate packet (gate on then off)
 
#define AFTER(sensor_id, timer...)
 Wait for sensor activated, then decativated for given time.
 
#define AFTEROVERLOAD(track_id)
 Wait for overload to be resolved.
 
#define ALIAS(name, value...)
 defines a named numeric value.
 
#define AMBER(signal_id)
 Sets a signal to amber state.
 
#define ANOUT(vpin, value, param1, param2)
 Writes to the HAL analog output interface of a device driver. Values and meanings of extra parameters depend on driver.
 
#define AT(sensor_id)
 wait intil a sensor becomes active
 
#define ASPECT(address, value)
 Sends a DCC aspect value to an accessory address. May also change status of a signal defined using this aspect.
 
#define ATGTE(sensor_id, value)
 Wait for analog sensor to be greater than given value.
 
#define ATLT(sensor_id, value)
 Wait for analog sensor value to be less than given value.
 
#define ATTIMEOUT(sensor_id, timeout_ms)
 Wait for sensor active, with timeout. Use IFTIMEOUT to determine whether the AT was satisfied.
 
#define AUTOMATION(id, description)
 Defies starting point of a sequence that will be shown as an Automation by the throttles. Automations are started by the throttle handing over a loco id to be driven.
 
#define AUTOSTART
 A new task will be created starting from this point at Command Station startup

 
#define BLINK(vpin, onDuty, offDuty)
 Starts a blinking process for a vpin (typically a LED) Stop blink with SET or RESET.
 
#define BROADCAST(msg)
 Send raw message text to all throttles using the DCC-EX protocol.
 
#define CALL(route)
 transfer control to another sequence with expectation to return
 
#define CLEAR_STASH(id)
 Clears loco stash value

 
#define CLEAR_ALL_STASH(id)
 ???????????????????????????????????????
 
#define CLOSE(id)
 Close turnout by id.
 
#define CONFIGURE_SERVO(vpin, pos1, pos2, profile)
 setup servo movement parameters for non-turnout
 
#define DCC_SIGNAL(id, add, subaddr)
 Define a DCC accessory signal with short address.
 
#define DCCX_SIGNAL(id, redAspect, amberAspect, greenAspect)
 DEfine advanced DCC accessory signal with aspects.
 
#define DCC_TURNTABLE(id, home, description...)
 ??????????????????????????????????
 
#define DEACTIVATE(addr, subaddr)
 Sends DCC Deactivate packet (gate on, gate off) to short address.
 
#define DEACTIVATEL(addr)
 Sends DCC Deactivate packet (gate on, gate off) to long address.
 
#define DELAY(mindelay)
 Waits for given milliseconds delay (This is not blocking)
 
#define DELAYMINS(mindelay)
 Waits for given minutes delay (This is not blocking)
 
#define DELAYRANDOM(mindelay, maxdelay)
 Waits for random delay between min and max milliseconds (This is not blocking)
 
#define DONE
 Stops task loco (if any) and terminates current task.
 
#define DRIVE(analogpin)
 RESERVED do not use.
 
#define ELSE
 introduces alternate processing path after any kind of IF
 
#define ENDEXRAIL
 Obsolete, has no effect.
 
#define ENDIF
 determines end of IF(any type) block. IF something ENDIF, or
IF something ELSE something ENDIF

 
#define ENDTASK
 same as DONE
 
#define ESTOP
 Performs emergency stop on current task loco.
 
#define EXRAIL
 OBSOLETE ignored.
 
#define EXTT_TURNTABLE(id, vpin, home, description...)
 ??????????????????????
 
#define FADE(pin, value, ms)
 Modifies analog value slowly taking a given time.
 
#define FOFF(func)
 Turns off loco function for current loco.
 
#define FOLLOW(route)
 Task processing follows given route or sequence (Effectively a GoTo)
 
#define FON(func)
 Turn on current loc finction.
 
#define FORGET
 Removes current loco from task and DCC reminders table.
 
#define FREE(blockid)
 Frees logical token for given block.
 
#define FTOGGLE(func)
 Toggles function for current loco.
 
#define FWD(speed)
 Instructs current loco to set DCC speed.
 
#define GREEN(signal_id)
 Sets signal to green state.
 
#define HAL(haltype, params...)
 Defines VPIN mapping for specific hardware drivers.
 
#define HAL_IGNORE_DEFAULTS
 System will ignore default HAL settings.
 
#define IF(sensor_id)
 Checks sensor state, If false jumps to matching nested ELSE or ENDIF.
 
#define IFAMBER(signal_id)
 Checks if signal is in AMBER state.
 
#define IFCLOSED(turnout_id)
 Checks if given turnout is in close state.
 
#define IFGREEN(signal_id)
 Checks if given signal is in GREEN state.
 
#define IFGTE(sensor_id, value)
 Checks if analog sensor >= value.
 
#define IFLOCO(loco_id)
 Checks if current task loco = loco_id.
 
#define IFLT(sensor_id, value)
 Checks if analog sensor < value.
 
#define IFNOT(sensor_id)
 Inverse of IF.
 
#define IFRANDOM(percent)
 randomly satisfield IF at given percent probability
 
#define IFRED(signal_id)
 Checks if given signal is in RED state.
 
#define IFTHROWN(turnout_id)
 Checks if given turnout is in THROWN state.
 
#define IFRESERVE(block)
 Agttempts to reserve block token and if satisfiled the block remains reserved.
 
#define IFTIMEOUT
 Checks TIMEOUT state after an AT/AFTER request with timeout value.
 
#define IFTTPOSITION(turntable_id, position)
 Checks if GTurntable is in given position.
 
#define IFRE(sensor_id, value)
 ????????????????????????????????????????
 
#define INVERT_DIRECTION
 Marks current task so that FWD and REV commands are inverted.
 
#define JMRI_SENSOR(vpin, count...)
 DEfines multiple JMRI type sensor feedback definitions each with id matching vpin.
 
#define JOIN
 Switches PROG track to receive MAIN track DCC packets. (Drive on PROG track)
 
#define KILLALL
 Tertminates all running EXRAIL tasks.
 
#define LATCH(sensor_id)
 Make all AT/AFTER/IF see sensor active without checking hardware.
 
#define LCC(eventid)
 Issue event to LCC.
 
#define LCCX(senderid, eventid)
 Issue LCC event while impersonating another sender.
 
#define LCD(row, msg)
 Write message on row of default configured LCD/OLED.
 
#define SCREEN(display, row, msg)
 Send message to external display hadlers.
 
#define LCN(msg)
 ??????
 
#define MESSAGE(msg)
 Send a human readable message to all throttle users.
 
#define MOVETT(id, steps, activity)
 ???????????????????
 
#define NEOPIXEL(id, r, g, b, count...)
 Set a NEOPIXEL vpin to a given red/green/blue colour.
 
#define NEOPIXEL_SIGNAL(sigid, redcolour, ambercolour, greencolour)
 Define a signal that uses a single multi colour pixel.
 
#define ACON(eventid)
 Send MERG CBUS ACON to Adapter.
 
#define ACOF(eventid)
 Send MERG CBUS ACOF to Adapter.
 
#define ONACON(eventid)
 Start task here when ACON for event receied from MERG CBUS.
 
#define ONACOF(eventid)
 Start task here when ACOF for event receied from MERG CBUS.
 
#define ONACTIVATE(addr, subaddr)
 Start task here when DCC Activate sent for short address.
 
#define ONACTIVATEL(linear)
 Start task here when DCC Activate sent for long address.
 
#define ONAMBER(signal_id)
 Start task here when signal set to AMBER state.
 
#define ONTIME(value)
 Start task here when fastclock mins in day=value.
 
#define ONCLOCKTIME(hours, mins)
 Start task here when fastclock matches time.
 
#define ONCLOCKMINS(mins)
 Start task here hourly when fastclock minutes matches.
 
#define ONOVERLOAD(track_id)
 Start task here when given track goes into overload.
 
#define ONDEACTIVATE(addr, subaddr)
 Start task here when DCC deactivate packet sent.
 
#define ONDEACTIVATEL(linear)
 Start task here when DCC deactivate sent to linear address.
 
#define ONCLOSE(turnout_id)
 Start task here when turnout closed.
 
#define ONLCC(sender, event)
 ??????????????????
 
#define ONGREEN(signal_id)
 Start task here when signal set to GREEN state.
 
#define ONRED(signal_id)
 Start task here when signal set to RED state.
 
#define ONROTATE(turntable_id)
 Start task here when turntable is rotated.
 
#define ONTHROW(turnout_id)
 Start task here when turnout is Thrown.
 
#define ONCHANGE(sensor_id)
 ???????????????????
 
#define ONSENSOR(sensor_id)
 Start task here when sensor changes state (debounced)
 
#define ONBUTTON(sensor_id)
 Start task here when sensor changes HIGH to LOW.
 
#define PAUSE
 Pauses all EXRAIL tasks except the curremnt one. Other tasks ESTOP their locos until RESUME issued.
 
#define PIN_TURNOUT(id, pin, description...)
 Defines a tirnout which operates on a signle pin.
 
#define PRINT(msg)
 prints diagnostic message on USB serial
 
#define PARSE(msg)
 Executes <> command as if entered from serial.
 
#define PICKUP_STASH(id)
 Loads stashed value into current task loco.
 
#define POM(cv, value)
 Write value to cv on current tasks loco (Program on Main)
 
#define POWEROFF
 Powers off all tracks.
 
#define POWERON
 Powers ON all tracks.
 
#define READ_LOCO
 Reads loco Id from prog traqck and sets currenmt task loco id.
 
#define RED(signal_id)
 sets signal to RED state
 
#define RESERVE(blockid)
 Waits for token for block. If not available immediately, current task loco is stopped.
 
#define RESET(pin, count...)
 Sets output puin LOW.
 
#define RESUME
 Resumes PAUSEd tasks.
 
#define RETURN
 Returns to CALL.
 
#define REV(speed)
 Issues DCC speed packet for current loco in reverse.
 
#define ROTATE(turntable_id, position, activity)
 ????
 
#define ROTATE_DCC(turntable_id, position)
 ????
 
#define ROSTER(cab, name, funcmap...)
 Describes a loco roster entry visible to throttles.
 
#define ROUTE(id, description)
 DEfines starting point of a sequence that will appear as a route on throttle buttons.
 
#define ROUTE_ACTIVE(id)
 Tells throttle to display the route button as active.
 
#define ROUTE_INACTIVE(id)
 Tells throttle to display the route button as inactive.
 
#define ROUTE_HIDDEN(id)
 Tells throttle to hide the route button.
 
#define ROUTE_DISABLED(id)
 Tells throttle to display the route button as disabled.
 
#define ROUTE_CAPTION(id, caption)
 Tells throttle to change thr route button caption.
 
#define SENDLOCO(cab, route)
 Start a new task to drive the loco.
 
#define SEQUENCE(id)
 Provides a unique label than can be used to call, follow or start.
 
#define SERIAL(msg)
 Write direct to Serial output.
 
#define SERIAL1(msg)
 Write direct to Serial1 output.
 
#define SERIAL2(msg)
 Write direct to Serial2 output.
 
#define SERIAL3(msg)
 Write direct to Serial3 output.
 
#define SERIAL4(msg)
 Write direct to Serial4 output.
 
#define SERIAL5(msg)
 Write direct to Serial5 output.
 
#define SERIAL6(msg)
 Write direct to Serial6 output.
 
#define SERVO(id, position, profile)
 Move servo to given position.
 
#define SERVO2(id, position, duration)
 Move servo to given position taking time.
 
#define SERVO_SIGNAL(vpin, redpos, amberpos, greenpos)
 Dedfine a servo based signal with 3 servo positions.
 
#define SERVO_TURNOUT(id, pin, activeAngle, inactiveAngle, profile, description...)
 Define a servo driven turnout.
 
#define SET(pin, count...)
 Set VPIN HIGH

 
#define SET_TRACK(track, mode)
 Set output track type.
 
#define SET_POWER(track, onoff)
 Set track power mode.
 
#define SETLOCO(loco)
 Sets the loco being handled by the current task.
 
#define SETFREQ(freq)
 Sets the DC track PWM frequency.
 
#define SIGNAL(redpin, amberpin, greenpin)
 Define a Signal with LOW=on leds (is that common annode???)
 
#define SIGNALH(redpin, amberpin, greenpin)
 define a signal with HIGH=ON leds
 
#define SPEED(speed)
 Changes current tasks loco speed without changing direction.
 
#define START(route)
 Starts a new task at the given route/animation/sequence.
 
#define STASH(id)
 saves cuttent tasks loco id in the stash array
 
#define STEALTH(code...)
 Allows for embedding raw C++ code in context of current task.
 
#define STEALTH_GLOBAL(code...)
 Allows for embedding raw c++ code out of context.
 
#define STOP
 Same as SPEED(0)
 
#define THROW(id)
 Throws given turnout.
 
#define TOGGLE_TURNOUT(id)
 Toggles given turnout.
 
#define TT_ADDPOSITION(turntable_id, position, value, angle, description...)
 Defines a turntable track position.
 
#define TURNOUT(id, addr, subaddr, description...)
 Defines a DCC accessory turnout with legacy address.
 
#define TURNOUTL(id, addr, description...)
 Defines a DCC accessory turnout with inear address.
 
#define UNJOIN
 Disconnects PROG track from MAIN.
 
#define UNLATCH(sensor_id)
 removes latched on flag
 
#define VIRTUAL_SIGNAL(id)
 Defines a virtual (no hardware) signal.
 
#define VIRTUAL_TURNOUT(id, description...)
 Defines a virtual (no hardware) turnout.
 
#define WAITFOR(pin)
 ???????????????????
 
#define WAITFORTT(turntable_id)
 
#define WITHROTTLE(msg)
 Broadcasts a string in Withrottle protocol format to all throttles using this protocol.
 
#define XFOFF(cab, func)
 Turns function off for given loco.
 
#define XFON(cab, func)
 Turns function ON for given loco.
 
#define XFTOGGLE(cab, func)
 Toggles function state for given loco.
 
#define XFWD(cab, speed)
 Sends DCC speed to loco in forward direction.
 
#define XREV(cab, speed)
 Sends DCC speed to loco in reverse direction.
 

Macro Definition Documentation

◆ ACOF

#define ACOF (   eventid)

Send MERG CBUS ACOF to Adapter.

Parameters
eventid

◆ ACON

#define ACON (   eventid)

Send MERG CBUS ACON to Adapter.

Parameters
eventid

◆ ACTIVATE

#define ACTIVATE (   addr,
  subaddr 
)

Send DCC Accessory Activate packet (gate on then off)

Parameters
addr
subaddr

◆ ACTIVATEL

#define ACTIVATEL (   longaddr)

Send DCC Accessory Activate packet (gate on then off)

Parameters
longaddr

◆ AFTER

#define AFTER (   sensor_id,
  timer... 
)

Wait for sensor activated, then decativated for given time.

Parameters
sensor_id
timer...optional wait in mS, default 500

◆ AFTEROVERLOAD

#define AFTEROVERLOAD (   track_id)

Wait for overload to be resolved.

Parameters
track_idA..H

◆ ALIAS

#define ALIAS (   name,
  value... 
)

defines a named numeric value.

Parameters
name
value...if omitted, a large negative value is created automatically

◆ AMBER

#define AMBER (   signal_id)

Sets a signal to amber state.

Parameters
signal_id

◆ ANOUT

#define ANOUT (   vpin,
  value,
  param1,
  param2 
)

Writes to the HAL analog output interface of a device driver. Values and meanings of extra parameters depend on driver.

Parameters
vpinVirtual pin number of device
valuebasic analog value
param1device dependent
param2device dependent

◆ ASPECT

#define ASPECT (   address,
  value 
)

Sends a DCC aspect value to an accessory address. May also change status of a signal defined using this aspect.

Parameters
address
value

◆ AT

#define AT (   sensor_id)

wait intil a sensor becomes active

Parameters
sensor_idUse negative value for sensors that are HIGH when activated

◆ ATGTE

#define ATGTE (   sensor_id,
  value 
)

Wait for analog sensor to be greater than given value.

Parameters
sensor_id
value

◆ ATLT

#define ATLT (   sensor_id,
  value 
)

Wait for analog sensor value to be less than given value.

Parameters
sensor_id
value

◆ ATTIMEOUT

#define ATTIMEOUT (   sensor_id,
  timeout_ms 
)

Wait for sensor active, with timeout. Use IFTIMEOUT to determine whether the AT was satisfied.

See also
IFTIMEOUT
Parameters
sensor_id
timeout_ms

◆ AUTOMATION

#define AUTOMATION (   id,
  description 
)

Defies starting point of a sequence that will be shown as an Automation by the throttles. Automations are started by the throttle handing over a loco id to be driven.

Parameters
idUnique sequence/route/automation id
description(Quoted text) will be shown on throttle button

◆ AUTOSTART

#define AUTOSTART

A new task will be created starting from this point at Command Station startup

◆ BLINK

#define BLINK (   vpin,
  onDuty,
  offDuty 
)

Starts a blinking process for a vpin (typically a LED) Stop blink with SET or RESET.

Parameters
vpin
onDutyMilliseconds with LED ON
offDutyMilliseconds with LED off

◆ BROADCAST

#define BROADCAST (   msg)

Send raw message text to all throttles using the DCC-EX protocol.

See also
WITHROTTLE
Parameters
msgQuoted message

◆ CALL

#define CALL (   route)

transfer control to another sequence with expectation to return

See also
RETURN
Parameters
routeSequence id, sequence must terminate of RETURN

◆ CLEAR_ALL_STASH

#define CLEAR_ALL_STASH (   id)

???????????????????????????????????????

Parameters
id

◆ CLEAR_STASH

#define CLEAR_STASH (   id)

Clears loco stash value

Parameters
idwhich stash to clear.

◆ CLOSE

#define CLOSE (   id)

Close turnout by id.

See also
THROW
Parameters
id

◆ CONFIGURE_SERVO

#define CONFIGURE_SERVO (   vpin,
  pos1,
  pos2,
  profile 
)

setup servo movement parameters for non-turnout

Parameters
vpinmust refer to a servo capable pin
pos1SET position of servo
pos2RESET position of servo
profileMovement profile (????????)

◆ DCC_SIGNAL

#define DCC_SIGNAL (   id,
  add,
  subaddr 
)

Define a DCC accessory signal with short address.

Parameters
idSignal id used for all signal manipulation commands
addDCC address
subaddrDCC subaddress

◆ DCC_TURNTABLE

#define DCC_TURNTABLE (   id,
  home,
  description... 
)

??????????????????????????????????

Parameters
id
home
description...

◆ DCCX_SIGNAL

#define DCCX_SIGNAL (   id,
  redAspect,
  amberAspect,
  greenAspect 
)

DEfine advanced DCC accessory signal with aspects.

Parameters
idSignal id used for all signal manipulation commands
redAspect
amberAspect
greenAspect

◆ DEACTIVATE

#define DEACTIVATE (   addr,
  subaddr 
)

Sends DCC Deactivate packet (gate on, gate off) to short address.

Parameters
addr
subaddr

◆ DEACTIVATEL

#define DEACTIVATEL (   addr)

Sends DCC Deactivate packet (gate on, gate off) to long address.

Parameters
addr

◆ DELAY

#define DELAY (   mindelay)

Waits for given milliseconds delay (This is not blocking)

Parameters
mindelaymS

◆ DELAYMINS

#define DELAYMINS (   mindelay)

Waits for given minutes delay (This is not blocking)

Parameters
mindelay

◆ DELAYRANDOM

#define DELAYRANDOM (   mindelay,
  maxdelay 
)

Waits for random delay between min and max milliseconds (This is not blocking)

Parameters
mindelaymS
maxdelaymS

◆ DONE

#define DONE

Stops task loco (if any) and terminates current task.

◆ DRIVE

#define DRIVE (   analogpin)

RESERVED do not use.

Parameters
analogpin

◆ ELSE

#define ELSE

introduces alternate processing path after any kind of IF

◆ ENDEXRAIL

#define ENDEXRAIL

Obsolete, has no effect.

◆ ENDIF

#define ENDIF

determines end of IF(any type) block. IF something ENDIF, or
IF something ELSE something ENDIF

◆ ENDTASK

#define ENDTASK

same as DONE

See also
DONE

◆ ESTOP

#define ESTOP

Performs emergency stop on current task loco.

◆ EXRAIL

#define EXRAIL

OBSOLETE ignored.

◆ EXTT_TURNTABLE

#define EXTT_TURNTABLE (   id,
  vpin,
  home,
  description... 
)

??????????????????????

Parameters
id
vpin
home
description...

◆ FADE

#define FADE (   pin,
  value,
  ms 
)

Modifies analog value slowly taking a given time.

Parameters
pin
valuenew target value
mstime to reach value

◆ FOFF

#define FOFF (   func)

Turns off loco function for current loco.

See also
FON
Parameters
func

◆ FOLLOW

#define FOLLOW (   route)

Task processing follows given route or sequence (Effectively a GoTo)

Parameters
route

◆ FON

#define FON (   func)

Turn on current loc finction.

See also
FOFF
Parameters
func

◆ FORGET

#define FORGET

Removes current loco from task and DCC reminders table.

◆ FREE

#define FREE (   blockid)

Frees logical token for given block.

See also
RESERVE
Parameters
blockid0..255

◆ FTOGGLE

#define FTOGGLE (   func)

Toggles function for current loco.

Parameters
func

◆ FWD

#define FWD (   speed)

Instructs current loco to set DCC speed.

Parameters
speed0..127 (1=ESTOP)

◆ GREEN

#define GREEN (   signal_id)

Sets signal to green state.

Parameters
signal_id

◆ HAL

#define HAL (   haltype,
  params... 
)

Defines VPIN mapping for specific hardware drivers.

Parameters
haltypedriver name, normally device type
params...depend on driver

◆ HAL_IGNORE_DEFAULTS

#define HAL_IGNORE_DEFAULTS

System will ignore default HAL settings.

◆ IF

#define IF (   sensor_id)

Checks sensor state, If false jumps to matching nested ELSE or ENDIF.

Parameters
sensor_idVPIN of sensor. Negative VPIM will invert sensor state.

◆ IFAMBER

#define IFAMBER (   signal_id)

Checks if signal is in AMBER state.

See also
IF
Parameters
signal_id

◆ IFCLOSED

#define IFCLOSED (   turnout_id)

Checks if given turnout is in close state.

See also
IF
Parameters
turnout_id

◆ IFGREEN

#define IFGREEN (   signal_id)

Checks if given signal is in GREEN state.

See also
IF
Parameters
signal_id

◆ IFGTE

#define IFGTE (   sensor_id,
  value 
)

Checks if analog sensor >= value.

See also
IF
Parameters
sensor_id
value

◆ IFLOCO

#define IFLOCO (   loco_id)

Checks if current task loco = loco_id.

See also
IF
Parameters
loco_id

◆ IFLT

#define IFLT (   sensor_id,
  value 
)

Checks if analog sensor < value.

See also
IF
Parameters
sensor_id
value

◆ IFNOT

#define IFNOT (   sensor_id)

Inverse of IF.

See also
IF
Parameters
sensor_id

◆ IFRANDOM

#define IFRANDOM (   percent)

randomly satisfield IF at given percent probability

See also
IF
Parameters
percent

◆ IFRE

#define IFRE (   sensor_id,
  value 
)

????????????????????????????????????????

Parameters
sensor_id
value

◆ IFRED

#define IFRED (   signal_id)

Checks if given signal is in RED state.

See also
IF
Parameters
signal_id

◆ IFRESERVE

#define IFRESERVE (   block)

Agttempts to reserve block token and if satisfiled the block remains reserved.

See also
IF
Parameters
block

◆ IFTHROWN

#define IFTHROWN (   turnout_id)

Checks if given turnout is in THROWN state.

See also
IF
Parameters
turnout_id

◆ IFTIMEOUT

#define IFTIMEOUT

Checks TIMEOUT state after an AT/AFTER request with timeout value.

See also
IF

◆ IFTTPOSITION

#define IFTTPOSITION (   turntable_id,
  position 
)

Checks if GTurntable is in given position.

See also
IF
Parameters
turntable_id
position

◆ INVERT_DIRECTION

#define INVERT_DIRECTION

Marks current task so that FWD and REV commands are inverted.

◆ JMRI_SENSOR

#define JMRI_SENSOR (   vpin,
  count... 
)

DEfines multiple JMRI type sensor feedback definitions each with id matching vpin.

Parameters
vpin
count...Number of consecutine VPINS for which to create JMRI sensor feedbacks. Default 1.

◆ JOIN

#define JOIN

Switches PROG track to receive MAIN track DCC packets. (Drive on PROG track)

◆ KILLALL

#define KILLALL

Tertminates all running EXRAIL tasks.

◆ LATCH

#define LATCH (   sensor_id)

Make all AT/AFTER/IF see sensor active without checking hardware.

Parameters
sensor_idMust only be for VPINS 0..255

◆ LCC

#define LCC (   eventid)

Issue event to LCC.

Parameters
eventid

◆ LCCX

#define LCCX (   senderid,
  eventid 
)

Issue LCC event while impersonating another sender.

Parameters
senderid
eventid

◆ LCD

#define LCD (   row,
  msg 
)

Write message on row of default configured LCD/OLED.

See also
SCREEN
Parameters
row
msgQuoted text

◆ LCN

#define LCN (   msg)

??????

Parameters
msg

◆ MESSAGE

#define MESSAGE (   msg)

Send a human readable message to all throttle users.

Parameters
msgQuoted text

◆ MOVETT

#define MOVETT (   id,
  steps,
  activity 
)

???????????????????

Parameters
id
steps
activity

◆ NEOPIXEL

#define NEOPIXEL (   id,
  r,
  g,
  b,
  count... 
)

Set a NEOPIXEL vpin to a given red/green/blue colour.

Parameters
idVPIN of a pixel
rred component 0-255
ggreen component 0-255
bblue component 0-255
count...Number of consecutive pixels to set, Default 1.

◆ NEOPIXEL_SIGNAL

#define NEOPIXEL_SIGNAL (   sigid,
  redcolour,
  ambercolour,
  greencolour 
)

Define a signal that uses a single multi colour pixel.

Parameters
sigidunique signal id
redcolourRGB colour
ambercolour
greencolourUse NeoRGB(red,green,blue) to create values for redcolour etc above.

◆ ONACOF

#define ONACOF (   eventid)

Start task here when ACOF for event receied from MERG CBUS.

Parameters
eventid

◆ ONACON

#define ONACON (   eventid)

Start task here when ACON for event receied from MERG CBUS.

Parameters
eventid

◆ ONACTIVATE

#define ONACTIVATE (   addr,
  subaddr 
)

Start task here when DCC Activate sent for short address.

Parameters
addr
subaddr

◆ ONACTIVATEL

#define ONACTIVATEL (   linear)

Start task here when DCC Activate sent for long address.

Parameters
linear

◆ ONAMBER

#define ONAMBER (   signal_id)

Start task here when signal set to AMBER state.

Parameters
signal_id

◆ ONBUTTON

#define ONBUTTON (   sensor_id)

Start task here when sensor changes HIGH to LOW.

Parameters
sensor_id

◆ ONCHANGE

#define ONCHANGE (   sensor_id)

???????????????????

Parameters
sensor_id

◆ ONCLOCKMINS

#define ONCLOCKMINS (   mins)

Start task here hourly when fastclock minutes matches.

Parameters
mins

◆ ONCLOCKTIME

#define ONCLOCKTIME (   hours,
  mins 
)

Start task here when fastclock matches time.

Parameters
hours
mins

◆ ONCLOSE

#define ONCLOSE (   turnout_id)

Start task here when turnout closed.

Parameters
turnout_id

◆ ONDEACTIVATE

#define ONDEACTIVATE (   addr,
  subaddr 
)

Start task here when DCC deactivate packet sent.

Parameters
addr
subaddr

◆ ONDEACTIVATEL

#define ONDEACTIVATEL (   linear)

Start task here when DCC deactivate sent to linear address.

Parameters
linear

◆ ONGREEN

#define ONGREEN (   signal_id)

Start task here when signal set to GREEN state.

Parameters
signal_id

◆ ONLCC

#define ONLCC (   sender,
  event 
)

??????????????????

Parameters
sender
event

◆ ONOVERLOAD

#define ONOVERLOAD (   track_id)

Start task here when given track goes into overload.

Parameters
track_idA..H

◆ ONRED

#define ONRED (   signal_id)

Start task here when signal set to RED state.

Parameters
signal_id

◆ ONROTATE

#define ONROTATE (   turntable_id)

Start task here when turntable is rotated.

Parameters
turntable_id

◆ ONSENSOR

#define ONSENSOR (   sensor_id)

Start task here when sensor changes state (debounced)

Parameters
sensor_id

◆ ONTHROW

#define ONTHROW (   turnout_id)

Start task here when turnout is Thrown.

Parameters
turnout_id

◆ ONTIME

#define ONTIME (   value)

Start task here when fastclock mins in day=value.

Parameters
value

◆ PARSE

#define PARSE (   msg)

Executes <> command as if entered from serial.

Parameters
msgQuoted text, preferably including <>

◆ PAUSE

#define PAUSE

Pauses all EXRAIL tasks except the curremnt one. Other tasks ESTOP their locos until RESUME issued.

◆ PICKUP_STASH

#define PICKUP_STASH (   id)

Loads stashed value into current task loco.

Parameters
idposition in stash where a loco id was previously saved.

◆ PIN_TURNOUT

#define PIN_TURNOUT (   id,
  pin,
  description... 
)

Defines a tirnout which operates on a signle pin.

Parameters
id
pin
description...Quoted text (shown to throttles) or HIDDEN

◆ POM

#define POM (   cv,
  value 
)

Write value to cv on current tasks loco (Program on Main)

Parameters
cv
value

◆ POWEROFF

#define POWEROFF

Powers off all tracks.

◆ POWERON

#define POWERON

Powers ON all tracks.

◆ PRINT

#define PRINT (   msg)

prints diagnostic message on USB serial

Parameters
msgQuoted text

◆ READ_LOCO

#define READ_LOCO

Reads loco Id from prog traqck and sets currenmt task loco id.

◆ RED

#define RED (   signal_id)

sets signal to RED state

Parameters
signal_id

◆ RESERVE

#define RESERVE (   blockid)

Waits for token for block. If not available immediately, current task loco is stopped.

Parameters
blockid

◆ RESET

#define RESET (   pin,
  count... 
)

Sets output puin LOW.

Parameters
pin
count...Number of consecutive pins, default 1

◆ RESUME

#define RESUME

Resumes PAUSEd tasks.

See also
PAUSE

◆ RETURN

#define RETURN

Returns to CALL.

See also
CALL

◆ REV

#define REV (   speed)

Issues DCC speed packet for current loco in reverse.

See also
FWD
Parameters
speed(0..127, 1=ESTOP)

◆ ROSTER

#define ROSTER (   cab,
  name,
  funcmap... 
)

Describes a loco roster entry visible to throttles.

Parameters
cabloco DCC address or 0 for default entry
nameQuoted text
funcmap...Quoted text, optional list of function names separated by / character with momentary fuinctin names prefixed with an *.

◆ ROTATE

#define ROTATE (   turntable_id,
  position,
  activity 
)

????

Parameters
turntable_id
position
activity

◆ ROTATE_DCC

#define ROTATE_DCC (   turntable_id,
  position 
)

????

Parameters
turntable_id
position

◆ ROUTE

#define ROUTE (   id,
  description 
)

DEfines starting point of a sequence that will appear as a route on throttle buttons.

Parameters
id
descriptionQuoted text, throttle button capotion.

◆ ROUTE_ACTIVE

#define ROUTE_ACTIVE (   id)

Tells throttle to display the route button as active.

Parameters
id

◆ ROUTE_CAPTION

#define ROUTE_CAPTION (   id,
  caption 
)

Tells throttle to change thr route button caption.

Parameters
id
caption

◆ ROUTE_DISABLED

#define ROUTE_DISABLED (   id)

Tells throttle to display the route button as disabled.

Parameters
id

◆ ROUTE_HIDDEN

#define ROUTE_HIDDEN (   id)

Tells throttle to hide the route button.

Parameters
id

◆ ROUTE_INACTIVE

#define ROUTE_INACTIVE (   id)

Tells throttle to display the route button as inactive.

Parameters
id

◆ SCREEN

#define SCREEN (   display,
  row,
  msg 
)

Send message to external display hadlers.

Parameters
displaynumber, 0=local display, others are handled by external displays which may have different display numbers on different devices.
row
msgQuoted text

◆ SENDLOCO

#define SENDLOCO (   cab,
  route 
)

Start a new task to drive the loco.

Parameters
cabloco to be driven
routeid of route/automation or sequence to drive

◆ SEQUENCE

#define SEQUENCE (   id)

Provides a unique label than can be used to call, follow or start.

See also
CALL
FOLLOW
START
Parameters
id

◆ SERIAL

#define SERIAL (   msg)

Write direct to Serial output.

Parameters
msgQuoted text

◆ SERIAL1

#define SERIAL1 (   msg)

Write direct to Serial1 output.

Parameters
msgQuoted text

◆ SERIAL2

#define SERIAL2 (   msg)

Write direct to Serial2 output.

Parameters
msgQuoted text

◆ SERIAL3

#define SERIAL3 (   msg)

Write direct to Serial3 output.

Parameters
msgQuoted text

◆ SERIAL4

#define SERIAL4 (   msg)

Write direct to Serial4 output.

Parameters
msgQuoted text

◆ SERIAL5

#define SERIAL5 (   msg)

Write direct to Serial5 output.

Parameters
msgQuoted text

◆ SERIAL6

#define SERIAL6 (   msg)

Write direct to Serial6 output.

Parameters
msgQuoted text

◆ SERVO

#define SERVO (   id,
  position,
  profile 
)

Move servo to given position.

Parameters
idVPIN of servo
position
profile?????????? names ???????????

◆ SERVO2

#define SERVO2 (   id,
  position,
  duration 
)

Move servo to given position taking time.

Parameters
id
position
durationmS

◆ SERVO_SIGNAL

#define SERVO_SIGNAL (   vpin,
  redpos,
  amberpos,
  greenpos 
)

Dedfine a servo based signal with 3 servo positions.

Parameters
vpin
redpos
amberpos
greenpos

◆ SERVO_TURNOUT

#define SERVO_TURNOUT (   id,
  pin,
  activeAngle,
  inactiveAngle,
  profile,
  description... 
)

Define a servo driven turnout.

Parameters
idused by THROW/CLOSE
pinVPIN for servo
activeAngle
inactiveAngle
profile??????
description...Quoted text shown to throttles or HIDDEN keyword to hide turnout button

◆ SET

#define SET (   pin,
  count... 
)

Set VPIN HIGH

Parameters
pin
count...Number of sequential vpins to set. Default 1.

◆ SET_POWER

#define SET_POWER (   track,
  onoff 
)

Set track power mode.

Parameters
trackA..H
onoff??? values ???

◆ SET_TRACK

#define SET_TRACK (   track,
  mode 
)

Set output track type.

Parameters
trackA..H
mode???names???

◆ SETFREQ

#define SETFREQ (   freq)

Sets the DC track PWM frequency.

Parameters
freq??????????? values ??????

◆ SETLOCO

#define SETLOCO (   loco)

Sets the loco being handled by the current task.

Parameters
loco

◆ SIGNAL

#define SIGNAL (   redpin,
  amberpin,
  greenpin 
)

Define a Signal with LOW=on leds (is that common annode???)

See also
SIGNALH
Parameters
redpin
amberpin
greenpin

◆ SIGNALH

#define SIGNALH (   redpin,
  amberpin,
  greenpin 
)

define a signal with HIGH=ON leds

Parameters
redpin
amberpin
greenpin

◆ SPEED

#define SPEED (   speed)

Changes current tasks loco speed without changing direction.

Parameters
speed0..127 (1=ESTOP)

◆ START

#define START (   route)

Starts a new task at the given route/animation/sequence.

Parameters
route

◆ STASH

#define STASH (   id)

saves cuttent tasks loco id in the stash array

Parameters
id

◆ STEALTH

#define STEALTH (   code...)

Allows for embedding raw C++ code in context of current task.

Parameters
code...

◆ STEALTH_GLOBAL

#define STEALTH_GLOBAL (   code...)

Allows for embedding raw c++ code out of context.

Parameters
code...

◆ STOP

#define STOP

Same as SPEED(0)

◆ THROW

#define THROW (   id)

Throws given turnout.

Parameters
id

◆ TOGGLE_TURNOUT

#define TOGGLE_TURNOUT (   id)

Toggles given turnout.

Parameters
id

◆ TT_ADDPOSITION

#define TT_ADDPOSITION (   turntable_id,
  position,
  value,
  angle,
  description... 
)

Defines a turntable track position.

Parameters
turntable_id
position??????????
value
angle
description...

◆ TURNOUT

#define TURNOUT (   id,
  addr,
  subaddr,
  description... 
)

Defines a DCC accessory turnout with legacy address.

Parameters
id
addr
subaddr
description...Quoted text or HIDDEN, appears on throttle buttons

◆ TURNOUTL

#define TURNOUTL (   id,
  addr,
  description... 
)

Defines a DCC accessory turnout with inear address.

Parameters

param id

Parameters
addr
description...

◆ UNJOIN

#define UNJOIN

Disconnects PROG track from MAIN.

See also
JOIN

◆ UNLATCH

#define UNLATCH (   sensor_id)

removes latched on flag

See also
LATCH
Parameters
sensor_id

◆ VIRTUAL_SIGNAL

#define VIRTUAL_SIGNAL (   id)

Defines a virtual (no hardware) signal.

Parameters
id

◆ VIRTUAL_TURNOUT

#define VIRTUAL_TURNOUT (   id,
  description... 
)

Defines a virtual (no hardware) turnout.

Parameters
id
description...

◆ WAITFOR

#define WAITFOR (   pin)

???????????????????

Parameters
pin

◆ WAITFORTT

#define WAITFORTT (   turntable_id)
Parameters
turntable_id

◆ WITHROTTLE

#define WITHROTTLE (   msg)

Broadcasts a string in Withrottle protocol format to all throttles using this protocol.

Parameters
msg

◆ XFOFF

#define XFOFF (   cab,
  func 
)

Turns function off for given loco.

Parameters
cab
func

◆ XFON

#define XFON (   cab,
  func 
)

Turns function ON for given loco.

Parameters
cab
func

◆ XFTOGGLE

#define XFTOGGLE (   cab,
  func 
)

Toggles function state for given loco.

Parameters
cab
func

◆ XFWD

#define XFWD (   cab,
  speed 
)

Sends DCC speed to loco in forward direction.

Parameters
cab
speed(0..127, 1=ESTOP)

◆ XREV

#define XREV (   cab,
  speed 
)

Sends DCC speed to loco in reverse direction.

Parameters
cab
speed(0..127, 1=ESTOP)