Addressing
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.
Glossary
| iid | interface ID. Only used if you have more than one Central Station. Leave blank if not sure. |
| bus | system bus (Common on Selectrix based systems.) |
| module | collection of ports (Accessory decoder) |
| modulesize | number of ports per module (swmodsize) |
| port or pair | collection of 2 gates |
| gate | 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:
- 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.
- Port Addressing (PADA) specifies the Address of a single device, using two the Gates.
- 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.
| |
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 | 10 | 11 | 12 | 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.
| |
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.
| |
Trace: » ldt-inter10-en » loc-index-de » mdrrc-nl » railcom-en » rfid12-en » zimo-en » orphans » bs-1-de » mgv102-en » addressing-en-flat

