User Tools

Site Tools


addressing:accessory-pg-en

Addressing Accessory Decoders - A Practical Guide

ContentBasics



Addressing of switches and signals



1.0 Introduction

This guide is meant to explain the different addressing types available for accessory decoders. The following text is written for both switches and signals, respectively. It is also valid for outputs. To keep it simple, only the word 'switch(es)' is used instead of 'switch(es) / signal(s)'.

1.1 Terms

  • Address is either the "name" of a switch or it refers to the module (see below).
    • To avoid confusions the address of a switch will be called number in the following text whereas address means the address of a module.
  • Module is another name for a standard decoder. A standard decoder usually offers connectors for four accessories (e.g. switches), that is four ports (see below).
  • A port is a pair of two gates (see below). A switch is connected to both gates of one port (plus a third connector often marked "C" (common) or coloured yellow).
  • A gate is a single output of a port. Gates are often marked as or coloured "red" and "green" or marked "Out A" and "Out B" for example.


1.2 Addressing

For addressing accessories always both fields Address and Port are used. Both fields represent one unit and have to be considered together. The values in both fields together add up to the addressing type (cf. chapter 2.0).

Remember: Even though seemingly self-evident the address of a switch (which is therefore called Switch Number in this document) is not necessarily typed into the address field!
  • If the field Address contains a value greater than zero and the field Port contains a value greater than zero Rocrail takes this as MADA addressing: The field Address holds the address of the module, field Port holds the number of the port.
  • If the field Address contains value zero and field Port contains a value greater than zero Rocrail takes this as PADA addressing: Field Port holds the switch number.
  • If the field Address contains a value greater than zero and field Port contains value zero Rocrail takes this as FADA addressing: Field Address holds the running port number over all ports of all modules [or with some command stations, the switch number]

The above written can be summarised as follows:

Table 1.2: Setting addressing types. 0: zero, n: Number greater than zero

Value
field
Address
Value
field
Port
Results
in
addressing type
n n MADA
0 n PADA
n 0 FADA


2.0 Addressing Types

It depends on the command station which addressing scheme(s) can be used. If possible, it is recommended to use the PADA type of addressing.

2.1 Module Addressing (MADA)

Probably the oldest way to address is the Module Addressing (Module Accessory Decoder Address, MADA) where the address of the decoder and the port is entered. Switch number 5 will get address 2, port one (see table in 2.4 below).

However, a module is always considered as a device with four ports regardless of the number of ports offered by the actual decoder. Some decoders on the market have only two ports, others do offer six.

Module 1 Module 2 Module 3
4-port Decoder Decoder 1 Decoder 2 Decoder 3
2-port Decoder Decoder 1 Decoder 2 Decoder 3 Decoder 4 Decoder 5 Decoder 6
6-port Decoder Decoder 1 Decoder 2
Switch Number 1 2 3 4 5 6 7 8 9 10 11 12

A 4-port decoder perfectly fits within the module frame, whereas two 2-port decoders share one module address.

Note that 6-port decoders exceed the module frame! In the example the two last ports of decoder 1 belong to module 2 and the first two ports of the second 6-port decoder belong to module 2 whereas the remaining four ports belong to module 3.

Address and port for MADA addressing can be calculated from the switch number using the integer part of the result. # is the actual switch number.

Calculation Result for Switch No. 12
addr = (# - 1) / 4 + 1 3.75
port = (# - 1) modulo1) 4 + 1 4

Using only the integer part of the result switch number 12 has address 3 and port 4.

2.2 Port Addressing (PADA)

Port addressing (Port Accessory Decoder Address, PADA) addresses the ports directly: Switch number 5 will get address 0, port 5. With port addressing the address fields are always 0 (zero) and the port field holds the switch number.

2.3 Flat Addressing (FADA)

Flat addressing (Flat Accessory Decoder Address, FADA) usually addresses the gates directly: For switch number 5 this will be gates 9 and 10.

However, with some command stations flat addressing refers to a flat addressing of switch numbers, e.g. BiDiB. In these cases switch number 5 will get address 5, port 0. With this form of flat addressing the port fields are always 0 (zero) and the address field holds the switch number.

2.4 Overview

Table: Comparison of addressing schemes

MADA PADA Flat (e.g. BiDiB)
Switch Number Address Port Address Port Address Port
1 1 1 0 1 1 0
2 1 2 0 2 2 0
3 1 3 0 3 3 0
4 1 4 0 4 4 0
5 2 1 0 5 5 0
6 2 2 0 6 6 0
2 2 3 0 7 7 0
8 2 4 0 8 8 0
9 3 1 0 9 9 0
1)
Modular arithmetic; use for instance a Google search for (12-1) mod 4+1 to calculate the result
addressing/accessory-pg-en.txt · Last modified: 2019/05/09 14:16 by vt601