*EEP Lua Automatischer Zugsteuerung*
Dieses Lua-Modul automatisiert den Zugverkehr auf jeder EEP-Anlage, ohne dass man selbst Lua-Code schreiben muss. Alles, was der Benutzer tun muss, ist in Lua-Tabellen zu beschreiben, welche Züge in welchen Blöcken erlaubt sind. In diesen Tabellen können auch Haltezeiten, z.B. an Bahnhöfen, pro Zug(gruppe) und pro Block angegeben werden.
Das Lua-Modul wird die Züge von Block zu Block fahren. Ein Block ist ein Streckenabschnitt, der mit einem Kontakt beginnt, der eine Lua-Funktion auslöst, wenn ein Zug in den Block eingefahren ist, und der mit einem Signal endet, das vom Lua-Modul gesteuert wird, um einen Zug anzuhalten oder freizugeben. Die Weichen zwischen den Blöcken werden vom Lua-Modul geschaltet. Welche Weichen geschaltet werden sollen, wird in der Streckentabelle festgelegt. Diese Tabelle kann vom Benutzer manuell erstellt werden, sie kann aber auch mit dem “Lua ATC Code Generator” automatisch generiert werden.
Schritte zur Erstellung eines automatischen Zugverkehrs in EEP
1. Entwerfen Sie eine (Modell)-Eisenbahnanlage und planen Sie den Zugverkehr, d. h. entscheiden Sie, wo die verschiedenen Züge fahren (dürfen) und wo sie halten (können).
2. Verlegen Sie die Gleise in EEP.
3. Die Züge werden von Block zu Block fahren. Erstellen Sie die Blöcke, die den vorgesehenen Zugverkehr ermöglichen, indem Sie ein Signal am Ende und einen Kontakt am Anfang jedes Blocks platzieren.
4. Gehen Sie in den 3D-Modus und platzieren Sie die gewünschten Züge. Geben Sie ihnen einen Namen und die gewünschte Geschwindigkeit. Fahren Sie sie bis zu einem roten Signal, wo sie anhalten werden.
5. Speichern Sie das EEP-Layout.
6. Öffnen Sie das Gleisplan-Programm in einer Browser-Registerkarte und laden Sie das Layout.
https://frankbuchholz.github.io/EEP_convert_an…_Gleisplan.html
7. Öffnen Sie den Lua ATC Code Generator in einer anderen Browser-Registerkarte und klicken Sie auf die Schaltfläche "Generieren".
https://frankbuchholz.github.io/EEP_convert_an…ockControl.html
8. Fügen Sie im 3D-Modus den Lua-Code in den Skript-Editor ein und klicken Sie auf "Skript neu laden", um den Code auszuführen. Dadurch werden die Lua-Funktionen erstellt, die die Kontakte auslösen werden.
9. Geben Sie in jeden Kontakt die Lua-Funktion: blockControl.enterBlock_# ein, wobei # die Nummer des Blocksignals ist.
10. Erstellen Sie die Tabellen, die die zulässigen Blöcke pro Zug oder Zuggruppen definieren.
11. Bearbeiten Sie die Zugtabelle so, dass jeder Zug eine Tabelle mit erlaubten Blöcken (allowed=...) besitzt, sowie optional ein Ein/Aus-Zugsignal (signal=#) und nur für EEP-Versionen 14.1 oder niedriger, einen Slot (slot=#) zum Speichern von Daten hat.
12. Speichern Sie das EEP-Layout. Gehen Sie in den 3D-Modus, öffnen Sie den Skript-Editor und klicken Sie auf "Skript neu laden", um den Code auszuführen. Lua wird im Modus "Zugsuche" gestartet.
13. Wenn alle Züge gefunden sind, schalten Sie den Hauptschalter sowie einen oder mehrere der einzelnen Zugschalter ein und ... staunen Sie und haben Sie Spaß!
Jeder Schritt wird in der Dokumentation ausführlich behandelt und in Demo-Anlagen vorgestellt.
Folgen Sie diesem Link zum YouTube-Video 9 für eine Einführung in Version 2.3:
Grüße,
Rudy & Frank
_______________________________________________________________________________________________________
EEP Lua Automatic Train Control (ATC)
This Lua module automates train traffic on any EEP layout, without the need to write any Lua code yourself. All that is needed from the user is to describe which trains are allowed in which blocks in Lua tables. Stop times, for example at railway stations, can be specified in these tables too, per train (group) and per block.
The Lua module is going to drive trains from block to block. A block is a stretch of track that starts with a contact that triggers a Lua function when a train has entered the block, and that ends with a signal that is controlled by the Lua module to halt or to release a train.
The turnouts between the blocks are switched by the Lua module. Which turnouts to switch, is defined in the routes table. This table can be manually created by the user, but it can also be automatically generated with the Lua ATC Code Generator tool.
Steps to Create Automatic Train Traffic in EEP
1. Design a (model) railway layout and plan the train flow, which means, decide where different trains should (be allowed to) go, and where they should (be able to) stop.
2. Lay the tracks in EEP.
3. Trains will drive from block to block. Create the blocks that will make the intended train traffic possible by placing a signal at the end, and a contact at the start of each block.
4. Go to 3D mode and place the desired trains. Give them a name and give them their intended speed. Drive them to a red signal, where they will stop.
5. Save the EEP layout.
6. Open the EEP Layout Tool in a browser tab and load the layout.
https://frankbuchholz.github.io/EEP_convert_an…_Gleisplan.html
7. Open the Lua ATC Code Generator in another browser tab and press the ‘Generate’ button.
https://frankbuchholz.github.io/EEP_convert_an…ockControl.html
8. While in 3D mode, paste the Lua code into the Script Editor and click ‘Reload script’ to run the code. This creates the Lua functions that the contacts are going to trigger.
9. In each contact enter the Lua function: blockControl.enterBlock_# , where # is the block signal number.
10. Create the tables that define the allowed blocks per train, or train groups.
11. Edit the trains table such that each train has a table containing allowed blocks (allowed=...), and optionally an on/off train signal (signal=#), and, only for EEP versions 14.1 or lower, a slot (slot=#) to store data.
12. Save the EEP layout. Go to 3D mode, open the Script Editor and click ‘Reload script’ to run the code. Lua starts up in ‘Train Find Mode’.
13. When all trains are found, turn the main switch on, as well as one or more of the individual train switches and … be amazed and have fun!
Each step is discussed in detail in the documentation and presented in demo layouts.
Follow this link to YouTube-Video 9 for an introduction into version 2.3:
https://youtu.be/KGXL2a99CjMGreetings,
Rudy & Frank
-
Version
-
icke (LP1) -
6. November 2022 um 10:29 -
32,64 MB -
546 Downloads
Die Version 2.4.1 enthält Änderungen
- zum Schutz von Kreuzungen (siehe Kapitel "Kollisionen an Kreuzungen vermeiden")
- zur Unterstützung von EEP-Depots (siehe Kapitel zur Demo-Anlage "EEP_LUA_ATC_Depots")
- zum frühzeitigem Freigeben von Weichen über die BetterContacts-Funktion "releaseTurnout" (siehe Kapitel "Lua-Funktion zur Freigabe einer Weiche")
--
This version 2.4.1 contains changes
- to protect intersections (see chapter "How to Prevent Collisions on Crossings")
- to support EEP depots (see chapter on demo system "EEP_LUA_ATC_Depots")
- for early release of turnouts via the BetterContacts function "releaseTurnout" (see chapter "Lua function to release a turnout")
-
-
Version
-
icke (LP1) -
22. Juli 2022 um 22:35 -
19,82 MB -
382 Downloads
-