Ради вашего удобства наш сайт использует cookies! Узнать больше! Мы используем cookies

ZE Train Module Template

Overview

  • Blank template for making a custom module.
  • You can connect your controllers for previous non-modular version of the system to this template and use it as an adapter to convert them into a single module.
  • Composite signal from the Multiple-Unit data node comes 1 time tick earlier before the signal from the module input node. This is done intentionally to switch the composite switchboxes in time and have seamless data flow when changing the master car. If you need simultaneous input from those nodes, use empty composite switchboxes in order to equalize signal delays.

How to make a custom module

  • Install the Multiple-Unit controller, connect the template module input and module output nodes to any module slot, and connect the Multiple-Unit data node.
  • Assign an arbitrary unique module ID in range from 1 to 90. A module on the master car with a given ID communicates with all slave car modules that have the same ID. The module ID should be written to the numerical channel 32 of the composite module output.
  • Define what functional data and on what composite channels your module will transmit as a master and receive as a slave. Boolean channels 1 - 32 and numeric channels 1 - 3 are available. Transmitting channels on the master car module are the same as the receiving channels on the slave car modules.
  • Inside the controller, replace the master broadcast nodes with composite gates that writes and reads from defined channels.
  • (Optional) Determine whether your module will transmit functional data to the master while being a slave. If no, you can remove the slave feedback nodes and skip this and the next step. If yes, define what functional data your module will transmit, but only boolean channels 1 - 2 are available. The module on the master car receives that data from all slave cars on merged channels 1 - 32. The channels correspond to the slave car position number, so channels 1 - 2 are for the module from the first car, channels 3 - 4 are for the module from the second car, and so on. Maximum of 16 cars, data from cars with higher positions will be ignored.
  • (Optional) Inside the controller, replace the slave feedback nodes with composite gates that writes to defined channels and reads all 32 boolean channels. You can use a simple LUA script that scans all channels using a for loop.
  • Using the train information from the Multiple-Unit data node, make the rest of your module logic.