Train Numbers - nh-finescale/ln2block GitHub Wiki

Background

Some switch panels of some stations in the FREMO are equipped with fields that can display train numbers. Normaly the train number displays (short: displays) are located at least in the track of the platforms and the track between two stations. But there is the option to add one or two additional displays for each track between two stations:

  • to offer a train to the next station
  • to announce a train to the next station

Two neighbour stations have displays related to each other. These are:

  • display in the track between the two stations
  • display to offer a train
  • display to announce a train

This relationship means: whenever a train number is shown in one of these displays it should also appear in the related display of the neighbour station.

Why train numbers over block

At the moment train numbers are dispached with the help of a server, see: http://fremo-stw.sourceforge.net/ZNF800/index.de.html. This means that every switch panel of a station that will display train numbers needs a connection to a central server. During development of the ln2block software the idea came up to send train numbers directly from one station to another to get rid of the server. And since there is already a line between two stations (the block line), it made sense to use it for the train numbers as well.

Requirements for train numbers over block

  • configurable to each panel
  • no additional configuration between two FREMO meetings necessary
  • enable/disable sending of train numbers with the help of a loconet message

Technical solutions

How is the information transported?

First, there is a special loconet message to set a train number on a display (train number message). Now ln2block should transport this display message over the block line. When you look into the specification of block line packages you will find the broadcast message type. With this message type you can send any information you want over the block line. So for the train numbers the payload of the broadcast message is just the train number message.

Requirement: Configurable

There is a 'general enable' bit (TRAIN_NUMBERS) to enable the sending of train numbers over the block line. (see: Configuration / LNCV #2 settings) For each display type there is one LNCV to hold the address of the display.

  • LNCV 16: LNCV_ADR_TRAIN_NO_ENABLE for Track
  • LNCV 17: LNCV_ADR_TRAIN_NO_OFFER for an Offer (Hand over)
  • LNCV 18: LNCV_ADR_TRAIN_NO_ANNUNCIATOR for an Announcement (see: Configuration / LNCV configuration values) There is a LNCV to hold the address for the switch message to enable/disable the sending of train numbers during runtime.

Requirement: no additional configuration between two FREMO meetings

Since ln2block only knows the addresses of its own displays, there is no need to configure between two FREMO meetings. (also see below: What happens when ln2block detects a display message)

Requirement: enable/disable sending of train number messages

Whenever ln2block detects a switch message with direction 'green' to this address the sending of train numbers is enabled. If the direction is 'red' then the sending is disabled.

What happens when ln2block detects a display message

First ln2block checks if the address of the display message is one of the configured addresses for train number displays. If so, the message will be stored and the address will be replaced by a code to indicate the type of the display (track, offer or announce). Then the modified display message will be put as payload into the broadcast message and the broadcast message will be sent over the block line. On the other end of the block a ln2block-system detects the broadcast message and checks if the payload is a display message. If so, the display message will be stored and the indication code will be replaced by the related display address (track, offer or announce). Then the display message will be send to the loconet. That's all.