1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-01-11 21:31:02 +01:00

correct example

This commit is contained in:
Asbelos 2021-08-10 10:41:35 +01:00
parent 67be436898
commit b06db69b53

View File

@ -8,52 +8,52 @@
* - automate some cosmetic part of the layout without any loco. * - automate some cosmetic part of the layout without any loco.
* *
* At startup, a single task is created to execute the first * At startup, a single task is created to execute the first
* instruction after ROUTES. * instruction after E$XRAIL.
* This task may simply follow a route, or may SCHEDULE * This task may simply follow a route, or may START
* further tasks (thats is.. send a loco out along a route). * further tasks (thats is.. send a loco out along a route).
* *
* Where the loco id is not known at compile time, a new task * Where the loco id is not known at compile time, a new task
* can be creatd with the command: * can be creatd with the command:
* </ SCHEDULE [cab] route> * </ START [cab] route>
* *
* A ROUTE, AUTOMATION or SEQUENCE are internally identical in ExRail terms * A ROUTE, AUTOMATION or SEQUENCE are internally identical in ExRail terms
* but are just represented differently to a Withrottle user: * but are just represented differently to a Withrottle user:
* ROUTE(n) - as Route_n .. to setup a route through a layout * ROUTE(n,"name") - as Route_n .. to setup a route through a layout
* AUTOMATION(n) as Auto_n .. to send the current loco off along an automated journey * AUTOMATION(n,"name") as Auto_n .. to send the current loco off along an automated journey
* SEQUENCE(n) is not visible to Withrottle. * SEQUENCE(n) is not visible to Withrottle.
* *
*/ */
ROUTES // myAutomation must start with the ROUTES instruction EXRAIL // myAutomation must start with the EXRAIL instruction
// This is the default starting route, AKA ROUTE(0) // This is the default starting route, AKA SEQUENCE(0)
SETLOCO(3) // set current loco id... SETLOCO(3) // set current loco id...
SCHEDULE(1) // send current loco off along route 1 START(1) // send current loco off along route 1
SETLOCO(10) // set current loco id... SETLOCO(10) // set current loco id...
SCHEDULE(2) // send current loco off along route 2 START(2) // send current loco off along route 2
ENDROUTE // This just ends the startup thread, leaving 2 others running. DONE // This just ends the startup thread, leaving 2 others running.
/* ROUTE(1) is a simple shuttle between 2 sensors /* SEQUENCE(1) is a simple shuttle between 2 sensors
* S10 and S11 are sensors pre-defined with the <S> command * S10 and S11 are sensors pre-defined with the <S> command
* S10 S11 * S10 S11
* === START->================ * === START->================
*/ */
AUTOMATION(1) SEQUENCE(1)
DELAY(100) // wait 10 seconds DELAY(10000) // wait 10 seconds
FON(3) // Set Loco Function 3, Horn on FON(3) // Set Loco Function 3, Horn on
DELAY(10) // wait 1 second DELAY(1000) // wait 1 second
FOFF(3) // Horn off FOFF(3) // Horn off
FWD(80) // Move forward at speed 80 FWD(80) // Move forward at speed 80
AT(11) // until we hit sensor id 11 AT(11) // until we hit sensor id 11
STOP // then stop STOP // then stop
DELAY(50) // Wait 5 seconds DELAY(5000) // Wait 5 seconds
FON(2) // ring bell FON(2) // ring bell
REV(60) // reverse at speed 60 REV(60) // reverse at speed 60
AT(10) // until we get to S10 AT(10) // until we get to S10
STOP // then stop STOP // then stop
FOFF(2) // Bell off FOFF(2) // Bell off
FOLLOW(1) // and follow route 1 again FOLLOW(1) // and follow sequence 1 again
/* AUTOMATION(2) is an automation example for a single loco Y shaped journey /* SEQUENCE(2) is an automation example for a single loco Y shaped journey
* S1,S2,S3 are sensors, T4 is a turnout * S1,S2,S3 are sensors, T4 is a turnout
* *
* S3 T4 S1 * S3 T4 S1
@ -64,23 +64,23 @@ ROUTES // myAutomation must start with the ROUTES instruction
* *
* Train runs from START to S1, back to S2, again to S1, Back to start. * Train runs from START to S1, back to S2, again to S1, Back to start.
*/ */
AUTOMATION(2) SEQUENCE(2)
FWD(60) // go forward at DCC speed 60 FWD(60) // go forward at DCC speed 60
AT(1) STOP // when we get to sensor 1 AT(1) STOP // when we get to sensor 1
DELAY(100) // wait 10 seconds DELAY(10000) // wait 10 seconds
THROW(4) // throw turnout for route to S2 THROW(4) // throw turnout for route to S2
REV(45) // go backwards at speed 45 REV(45) // go backwards at speed 45
AT(2) STOP // until we arrive at sensor 2 AT(2) STOP // until we arrive at sensor 2
DELAY(50) // wait 5 seconds DELAY(5000) // wait 5 seconds
FWD(50) // go forwards at speed 50 FWD(50) // go forwards at speed 50
AT(1) STOP // and stop at sensor 1 AT(1) STOP // and stop at sensor 1
DELAY(50) // wait 5 seconds DELAY(5000) // wait 5 seconds
CLOSE(4) // set turnout closed CLOSE(4) // set turnout closed
REV(50) // reverse back to S3 REV(50) // reverse back to S3
AT(3) STOP AT(3) STOP
DELAY(200) // wait 20 seconds DELAY(20000) // wait 20 seconds
FOLLOW(2) // follow route 2... ie repeat the process FOLLOW(2) // follow sequence 2... ie repeat the process
ENDROUTES // marks the end of the ROUTES program. ENDEXRAIL // marks the end of the EXRAIL program.