LocoNet addressing

LocoNet systems address input sensors and output turnouts using numbers. This page talks about how those numbers are defined in JMRI, and how they relate to the numbers in other systems.

Addressing LocoNet turnouts in JMRI

Inside packets on the LocoNet, output turnouts are addressed with numbers from 0 to 4095. Throttles, however, address these with numbers from 1 to 4096. To avoid user confusion, JMRI uses the same numbering as the throttles: LT1 to LT4096.

Note that when the LocoNet monitor panel shows the contents of the LocoNet packets in text, it uses the same addressing, hence 1 to 4096. This is then different from the raw bytes that are displayed, but at least it's consistent with what users expect to see. We agree that's confusing, but there has to be some confusion somewhere, given the way this was set up.

Addressing LocoNet sensors in JMRI

Inside packets on the LocoNet, sensors are addressed with numbers from 0 to 4095. Digitrax documentation refers to these as 1 to 4096, however. Just like turnouts, we use the documentation numbering to define the sensor names: LS1 to LS4096.

The simplest way to find the right number for a given block is to open a "LocoNet monitor" window, and drop a locomotive onto the block you're interested in. You'll see the LocoNet message, complete with number, in the window that looks something like this:

   General sensor input report: contact 161 (DS54 switch 81 Aux input) (BDL16 11,1) is Hi 
The contact number, 161 in this case, is the address of the sensor. Prefix that with LS that to get the sensor name, e.g. LS161 in this case.

If you want to calculate the address of a BDL168 input, you can use

   number = 16 * (board number) + (channel number) - 16
where "channel number" runs from 1 to 16. For example, the first circuit (number 1) on board 11 has number:
   number = 16 * (11) + (1) - 16 = 161
as we saw in the example above.

If you want to calculate the address of a DS54 aux input, use:

   number = 2 * (turnout number - 1) + 1
For example, the aux input associated with turnout 81 has number:
   number = 2 * (81 - 1) + 1 = 161
If it's the switch input, you add one more to that:
   number = 2 * (turnout number - 1) + 2
For example, the switch input associated with turnout 12 has number:
   number = 2 * ( 12 - 1 ) + 2 = 24

Addressing Transponding in JMRI

Digitrax transponding is handled via the Reporter mechanism in JMRI. Reporters gather information from the layout and make it available when it changes.

The transponding zones are numbered sequentially from 1, so that 1 through 4 are on the 1st BDL16, etc.