Addressing

IID

Interface ID. Only needed if more than one Command Station is defined.

  • IIDs are case sensitive.
  • An IID must be unique.
  • Commas and other special characters are not allowed.


ID

Unique identification of an Object of a certain type.

  • IDs are case sensitive.
  • An ID must be unique in its object group.
  • Commas and other special characters are not allowed.


Bus

The meaning of the Bus variable depends on the used system:

System Value Range
BiDiB Unique-ID 32 bit
MERG CBUS Node number 16 bit
RocNet Node-ID 16 bit
Selectrix Bus 7 bit
Roco Z21 Sensor type 0…2

For all other systems this value can be set to zero and has no effect.


Addressing of sensors, switches, signals and outputs

This page outlines the addressing scheme used in Rocrail, and how to map different manufacturer's address settings to Rocrail and vice-versa.
This page may not make sense if you are just reading about Rocrail for the first time. You may skip it for now, but refer back here when configuring your devices.

Address value zero is in Rocrail regarded as “Not Used”.
Rocrail will decrease the address value by one If the underlaying hardware starts addressing with offset zero.


Glossary

iid interface ID. Only used if you have more than one Command Station. Leave blank if not sure.
bus Extra identification; System dependent.
module collection of ports (Accessory decoder)
modulesize number of ports per module (swmodsize)
port or pair collection of 2 gates
gate or coil output capable of doing ON/OFF
address the address of an output is calculated as: module * modulesize + port *2 + gate
modulo or % the remainder of division



Addressing Basics

Most devices on the layout are controlled by a single Address. Mobile decoders (locomotives) are usually controlled by a single Address.
Some devices, notably switches and signals connected to stationary/accessory decoders, are controlled by an Address and Port pair. This is because one decoder can handle 2 or more devices.
The original standard has a single decoder controlling four devices. The decoder has a single Address, but an additional Port parameter is used to select one of four devices at that Address.(NMRA)

A port can have 1 or more Gates. Mobile decoders (locomotives) don't have a Gate, you just use their address. But a typical solenoid turnout needs 2 gates, one for straight and one for turnout. The default for a stationary device is 2 Gates for an Address and Port.


NMRA Accessory Decoder

Module 1…1023
Port 0 Port 1 Port 2 Port 3
gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1


There are three basic schemes for addressing Stationary Decoders:

  1. NMRA like Addressing (MADA) specifies the Address of a Module, and then the Port on that module. Each Module has a size, which is the number of Ports it can control. Each Port has two Gates, one for each wire used to switch the device. The number of Ports defaults to 4.
  2. Port Addressing (PADA) specifies the Address of a single device, using two the Gates.
  3. Flat Addressing (FADA) specifies the Address of a single Gate.


Module Accessory Decoder Address (MADA)

This is almost the same as the NMRA addressing except for the Ports, they are numbered from 1 to 4.

Attribute NMRA MADA
addr 1…1023 1…*
port 0…3 1…4
gate 0…1 0…1
swmodsize 4 4


In Rocrail gate 0 equals RED, and gate 1 equals GREEN on the decoder port/pair.

1 2 MADA (addr)
1 2 3 4 1 2 3 4 MADA (port)
gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1



Port Accessory Decoder Address (PADA)

PADA is a scheme at port level. A module with 4 ports has 4 PADA addresses.
Port addressing is in between NMRA-DCC and FADA, and is only supported in a few libraries.

:!: If the address value is set to zero and port > 0 then in some libraries PADA will be activated.


Calculating to PADA from MADA:

PADA = (addr-1) * 4 + port


Calculating back from PADA to MADA:

  • addr = (PADA-1) / 4 + 1
  • port = (PADA-1) modulo 4 + 1


The PADA points to one gate pair, starting with 1 for the first in a system.

Module 1 Module 2
1 2 3 4 5 6 7 8 PADA (port)
gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1 gate 0 gate 1


Flat Accessory Decoder Address (FADA)

This addressing scheme is at gate(output) level.
A module with 4 ports has 8 FADA addresses.

:!: If the port value of a accessory is set to zero and address > 0 then in some libraries FADA will be activated.


Calculating to FADA from MADA:

FADA = (addr-1) * 8 + (port-1) * 2 + gate


Calculating back from FADA to MADA:

  • addr = (FADA / 8) + 1
  • port = (FADA modulo 8) / 2 + 1
  • gate = (FADA modulo 8) modulo 2


Module 1 Module 2
Port 1 Port 2 Port 3 Port 4 Port 1 Port 2 Port 3 Port 4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 FADA (addr)


Check for FADA/PADA support the Command Stations page.
Sensors are always addressed with FADA in Rocrail (see next paragraph).


Addressing Sensors


Only the Address field is looked at. All other fields of the dialogue are described in detail on page Sensors: Interface.

Sensors are always addressed flat in Rocrail starting with 1. The address of a single sensor connected to a 16-port sensor module is calculated as follows:

Address = ( Module - 1 ) * 16 + Port
Example: Port 5 of the second module has the address ( 2 - 1 ) * 16 + 5 = 21
Note: With Lenz command stations the first module has the module address 65 and the addressing is based on 8-port modules. The first port of the first module has address 512:
( 65 - 1 ) * 8 + 1 - 1 = 512 or in general
Address = ( Module - 1 ) * 8 + Port - 1

Personal Tools