User Tools

Site Tools


addressing-en

Differences

This shows you the differences between two versions of the page.


addressing-en [2024/04/14 15:19] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +======Addressing & Co.======
 +[[english|{{  rocrail-logo-35.png}}]]
  
 +[[english|Content]] -> [[english#Basics|Basics]]
 +  * [[rocrail-components-en|Rocrail's Components]] | **Addressing**
 +    * [[addressing-examples-en|Examples]] | [[:addressing:accessory-pg-en|Addressing Accessory Decoders]]
 + \\
 +
 +^  __[[:english#command_stations|Check your Command Station which addressing scheme is supported.]]__  ^
 +
 + \\
 +
 +=====IID or Interface ID=====
 +Unique identification of a __**[[:english#command_stations|Command Station]]**__.\\
 +  * IIDs are __case sensitive__.
 +  * An IID must be unique.
 +  * Commas and other special characters are not allowed.
 +  * Avoid using blanks; Use dots or underscores instead.
 +
 + \\
 +=====ID=====
 +Unique identification of an __**[[:english#objects|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. (ASCII 7bit)
 +  * Replace blanks with dots or underscores. __Blanks in IDs will lead to unexpected behaviour.__
 +  * An ID for Block, Turntable, Staging Block and FiddleYard must be unique. (Block based objects.)
 +
 + \\
 +
 +=====CSV Lists=====
 +CSV lists in Rocrail must be separated with commas __without any additional blanks__.\\
 +
 + \\
 +
 +=====Node ID (Bus)=====
 +The meaning of the Node ID variable depends on the used system:
 +^ System ^ Value ^ Range ^ Remark ^
 +| **[[:bidib-en|BiDiB]]** | [[:bidib:bidib-config-en#unique-id|Unique-ID]] | 32 bit | With prefix 0x this value can also entered in hex notation. |
 +| **[[:cbus-en#addressing|CANBUS]]** | Node number | 16 bit |
 +| RCAN | Node ID | 8 bit | Zero is reserved for broadcast. |
 +| **[[:rocnet:rocnet-prot-en|RocNet]]** | [[:rocnet:rocnetnode-setup-en#id1|Node-ID]] | 16 bit |
 +| Selectrix | Bus | 7 bit | 
 +| **[[:roco:roco-z21-en|Roco Z21]]** | Sensor type | 0...2 | \\
 +| **[[:wio:overview-en|WIO]]** | Node ID | 8 bit | Zero is reserved for broadcast. |
 +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.\\
 +Towards addressing of switches, signals and outputs see also  __**[[:addressing:accessory-pg-en|Addressing Accessory Decoders - A Practical Guide]]**__ 
 +
 +
 +//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|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 % | [[http://en.wikipedia.org/wiki/Modulo_operation|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.\\
 + \\
 +**Note:** __[[:english#command_stations|Check your Command Station which addressing scheme is supported.]]__\\
 + \\
 +
 +==== 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.\\
 + \\
 +| :!: If the address value is set to zero and port > 0 then in some [[controllers-en|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
 + {{ :mada-adressen-berechnung.zip |calculation table}}\\
 +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 [[controllers-en|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+1) |\\
 +
 + \\
 +Check for FADA/PADA support the [[controllers-en|Command Stations]] page.\\
 +Sensors are always addressed with FADA in Rocrail (see next paragraph). \\
 +
 + \\
 +===== Addressing Sensors =====
 +|  The __[[:sensormon-en|Sensor Monitor]]__ is the first Tool to use for finding the right address.  |\\
 +
 +
 +{{sensor-int-en.png?480}}\\
 +
 + \\
 +Only the **Address** field is looked at. All other fields of the dialogue are described in detail on page **[[:sensor-int-en|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 ^
 +
 +> **Note**: With SwitchPilots from ESU, it is possible that the address is prefixed with 16.