TapHome

Resi Dali - Configuration

Modbus RTU
Submitted by
Last updated: 04. 2026

Requires external gateway

Resi RESI-DALI-PS — product page

Resi Dali - Configuration

The Resi Dali - Configuration template is a one-off commissioning and addressing tool for the RESI-DALI-SIO and RESI-DALI-ETH Modbus-to-DALI gateway from RESI Informatik & Automation GmbH. It drives the DALI 2.0 random-addressing algorithm from TapHome to assign short addresses 0–63 to control gears on a newly wired DALI bus, probes each address for the DALI device type, and offers broadcast ON/OFF sanity tests — everything needed to bring a fresh installation to a state where lamps can be individually controlled.

Communication with the gateway uses Modbus RTU at 9600 baud 8N1. The template also exposes an IpAddress import parameter so the same flow works through a serial-to-IP bridge (Moxa NPort, USR-TCP232) or a RESI-DALI-ETH configured for transparent RTU-over-Ethernet mode.

This template is intentionally addressing-only. Once short addresses are assigned, remove the Resi Dali - Configuration module and use the sibling operational template Resi Dali (Dali.xml) for day-to-day control — individual lamp dimming, groups, scenes and DT6/DT8 RGB/tunable-white colour control. The commissioning module is not designed to stay in the project after initial setup.

Hardware connection

The RESI-DALI-SIO is a DIN-rail master gateway (17.5 × 90 × 56.4 mm, CEM17) that sits between a serial/Ethernet host and a DALI lighting bus. The gateway does not power the DALI bus — a companion DALI bus power supply (RESI-DALI-PS or any compliant 200 mA DALI PSU) is mandatory.

Connecting the RESI-DALI-SIO (RS-485)
RESI-DALI-SIO connection diagram — external DALI PSU (top) and with RESI-DALI-PS (bottom)

Terminals on the left side of the RESI-DALI-SIO (top → bottom): GND, +12..48V=, RS485 DATA+ (A+), RS485 DATA- (B-), RS485 GND, RS232 TX, RS232 RX, RS232 GND. The DALI bus terminals on the opposite side are D+ / N/C / D- (3-pin USLIM block, N/C stays unconnected).

For a TapHome installation use the RS-485 interface:

  • RS485 DATA+ (A+) → A+/D+ on the TapHome RS-485 bus
  • RS485 DATA- (B-) → B-/D- on the TapHome RS-485 bus
  • RS485 GND → GND on the TapHome power supply (recommended for stable communication)
  • +12..48V= / GND → 12–48 V DC primary power
Connecting the RESI-DALI-ETH (Ethernet)
RESI-DALI-ETH connection diagram — external DALI PSU (top) and with RESI-DALI-PS (bottom)

The Ethernet variant has the same DALI bus terminals (D+ / N/C / D-) and primary power (GND, +12..48V=), plus a single RJ45 connector for 10/100 Mbit Ethernet. Default IP settings out of the factory are 192.168.0.191 / 255.255.255.0 / 192.168.0.1 with Modbus Unit ID 255; web UI credentials are RESI / RESI. TapHome talks to the ETH variant via Modbus TCP, or in transparent RTU-over-Ethernet mode that this commissioning template expects (see Configuration below).

DALI bus power supply
RESI-DALI-PS — powering the DALI bus standalone (top) and in combination with a SIO/ETH gateway (bottom)

The RESI-DALI-PS delivers up to 200 mA on the DALI bus (short-circuit current ~225 mA, bus voltage typical 14–18 V) and supports up to 64 DALI 1.0 ballasts or DALI 2.0 control gears on a single line. Primary side accepts the same 12–48 V DC supply as the SIO/ETH unit. The gateway and PSU tap into the same D+ / D- pair — the PSU energises the bus while the gateway reads and writes DALI frames.

Three LEDs on the PSU help during commissioning: POWER (primary 12–48 V OK, always on), DALI (flashes briefly during bus traffic), ERR (steady on PSU fault, DALI short circuit or bus overload — must be off in normal operation).

DALI bus rules

A DALI line imposes a few hard constraints that directly affect commissioning success:

Conductor cross-sectionMax DALI cable length
1.5 mm²300 m
1.0 mm²238 m
0.75 mm²174 m
0.5 mm²116 m

The limit comes from the maximum permitted 2 V voltage drop across the DALI cable. Other rules:

  • Maximum 64 DALI 1.0 ballasts and up to 64 DALI 2.0 control gears per bus (separate short-address spaces).
  • Tree topology only — no rings, no loops.
  • Actual gear count also depends on the PSU current rating (typically 200 mA on the RESI-DALI-PS, budget ~2 mA per gear plus reserve).

RESI-DALI-PS (or equivalent DALI PSU) is mandatory. Without it the RESI-DALI-SIO/ETH cannot drive the bus and the commissioning wizard will time out on every step. If a second PSU is used on a long line, insert a DALI choke or split the bus into galvanically separate segments.

Configuration

Enabling Modbus communication

All host serial parameters on the RESI-DALI-SIO are selected by a 4-position DIP switch on the module. The TapHome template pins 9600 baud 8N1, so the DIP switches must be set accordingly.

DIP1DIP2Baud rate
OFFOFF9600 bd (required by TapHome)
ONOFF19200 bd
OFFON38400 bd
ONONUses FLASH-programmed baud rate (factory default 57600 bd)
DIP4Modbus Unit ID source
OFFFLASH register H:65221 — required for the Set Slave ID action to take effect
ONForced to 255 (hardware fallback, FLASH value ignored)

DIP3 is a product-specific reserved bit; leave it in the factory position unless the RESI service manual explicitly instructs otherwise. Parity is fixed at None (8N1) in the FLASH defaults — the template does not expose the parity/stop-bit registers.

RS-485 termination: terminate the bus with 120 Ω at both ends. TapHome Core provides one termination on its BUS terminals; if the RESI gateway is the last device on the line, add a discrete 120 Ω resistor across A+/B- on its RS-485 terminals.

RTU-over-TCP setup: the template has both SlaveId and IpAddress import parameters because the same DALI commissioning flow also works through a serial-to-IP bridge (Moxa NPort, USR-TCP232) or through the RESI-DALI-ETH in transparent RTU-over-Ethernet mode. In that case point IpAddress at the bridge / ETH unit IP and keep the rest of the settings identical to the RS-485 variant. For pure Modbus/TCP on RESI-DALI-ETH a TCP-based template would be more natural — the DaliConfig template specifically assumes framed RTU traffic.

Setting the gateway Slave ID

Factory default Unit ID is 255. To change it:

  1. Set DIP4 = OFF on the gateway so the FLASH Unit ID is honoured.
  2. Import the template in TapHome with SlaveId = 255 (current address).
  3. Open the “Resi Dali - Configuration” module service settings and trigger the Set Slave ID action with the desired new ID (range 1–255). The action writes the value to register H:65221 and immediately triggers a software reset via H:6000 = 1 so the gateway reboots with the new address.
  4. Remove the template and re-import it with SlaveId set to the new value. The module can then be used for commissioning.

The Reset Gateway action (writes 1 to H:6000) is also available as a standalone recovery step — useful after a DALI bus short that left the gateway’s DALI engine in a degraded state.

Only one Modbus master at a time. Neither DALI nor the Modbus RTU bus arbitrate between concurrent masters. If a PLC, BMS or PC tool (for example MODBUSConfigurator) is also polling the gateway during commissioning, short-address programming will collide and the wizard will report errors.

Device capabilities

The template is built around a single Modbus module — Resi Dali - Configuration — that bundles the commissioning wizard, a DALI device-type probe for every short address 0–63 and four gateway-level actions.

Commissioning wizard — Find New Devices

Find New Devices is a ten-state multi-value switch that drives the DALI 2.0 random-addressing algorithm in discrete steps. Each state name corresponds to one phase of the DALI 2.0 commissioning sequence; selecting a state causes the template to issue the right raw 16-bit DALI frame on H:541 / H:542 and then poll the DALI RX status on H:550 for the gateway’s response.

StepStateWhat it does
0TERMINATEDALI TERMINATE frame (0xA100) — abort the current addressing session and reset gateway state. Always safe to call
1StartINITIALISE (0xA5FF) + RANDOMISE (0xA700) — switches all un-addressed gears into the addressing pool and asks every gear to pick a 24-bit random address
2Scan Short AddressProbes the next short address slot; returns status code 7 when no gear answers
3Set SEARCHADDRLoads the upper/middle/lower SEARCHADDR bytes (0xB500/0xB300/0xB100) for the binary search
4COMPARESends COMPARE (0xA900) and narrows the 24-bit search window based on the response
5PROGRAM SHORT ADDRESSWrites the verified short address via 0xB7xx — the gear is now permanently addressed
6CheckVerifies the programmed address with a second COMPARE at the final SEARCHADDRL
7Try againCollision / timeout recovery — halves the current search interval and retries
8Reset Short AddressesDALI DTR = 0xFF (0xA3FF) + REMOVE SHORT ADDRESS broadcast — wipes all existing short addresses, ready for a full re-addressing
9FinishReads the DALI result byte, emits a TapHome info/error message and leaves the wizard

Typical commissioning workflow:

  1. Power the DALI bus (RESI-DALI-PS), wire gears in a tree topology and make sure nothing else is driving the bus.
  2. (Optional but recommended) run Reset Short Addresses first, to start from a clean state with every gear un-addressed.
  3. Run Start — this issues INITIALISE + RANDOMISE so every gear picks a fresh 24-bit random address.
  4. Run Scan Short AddressSet SEARCHADDRCOMPAREPROGRAM SHORT ADDRESSCheck in sequence. The states encapsulate the DALI 2.0 binary search; each step advances the algorithm by one phase.
  5. If a step reports a collision or timeout, call Try again and rerun the compare/program sequence.
  6. When all visible gears have been programmed, run TERMINATE and then Finish to exit the wizard cleanly.
  7. Use the Gear 0 … Gear 63 service attributes and the Turn On / Off All Lamps actions to verify that short addresses 0–N are now populated (see below).

The wizard is designed to be stepped through one state at a time — the template does not automate the entire loop because the installer needs to watch the DALI bus behaviour (lamps pulsing, STATE LED rhythm on the gateway) to catch miswired or missing gears.

DALI gear probe — Gear 0 … Gear 63

Each of the 64 service attributes Gear 0, Gear 1, … Gear 63 probes one DALI short address with the DALI 2.0 QUERY DEVICE TYPE command (0x99). Internally the template writes (SA << 8) | 0x99 to H:511, polls H:550 bits 0–2 until a response arrives, then reads the answer byte back from H:511.

Possible return values in the TapHome service UI:

  • DT{n} — a control gear is programmed at this address and answered with device type n. Typical values: DT0 (fluorescent), DT1 (emergency), DT2 (HID), DT5 (0–10 V), DT6 (LED driver), DT7 (relay), DT8 (colour / tunable white), DT9 (sequencer).
  • -- — either no gear is programmed at this address or the gateway returned the 0x8000 “no answer / already consumed” sentinel.

The probe gives a quick pass/fail overview of which short addresses are populated after commissioning and which device types were discovered — this is the primary verification step before switching the project to the operational Resi Dali template.

Gateway-level actions

Four service actions on the module drive the gateway directly:

  • Reset Gateway — writes 1 to H:6000 (DIP SWITCH / SOFTWARE RESET). Reboots the gateway; useful after a bus short circuit to recover the DALI engine.
  • Set Slave ID — writes the new Unit ID (1–255) to FLASH register H:65221, then resets via H:6000. Requires DIP4 = OFF to take effect.
  • Turn On All Lamps — writes 0xFE (arc power 254 = 100 %) to the DALI broadcast level register H:530. Fires every gear on the bus regardless of short address — a quick visual confirmation that the bus and PSU are healthy.
  • Turn Off All Lamps — writes 0x00 to H:530, turning every gear off. Same broadcast path, opposite value.

The Slave ID service attribute on the module reads back the current Unit ID from FLASH register H:65221 so the currently programmed address can be verified before sending Set Slave ID.

Run Turn On All Lamps immediately after wiring, before starting the addressing wizard. Every powered and correctly-connected gear on the bus will come on at 100 %, which is a very fast way to spot missing or miswired fixtures before spending time on short-address programming.

Troubleshooting

Wizard times out on every step
  1. Verify the DALI bus voltage at the PSU terminals — it must be 11.5–22.5 V (typical 14–16 V). A significantly lower reading usually indicates a DALI short circuit.
  2. Check the RESI-DALI-PS ERR LED — if it is lit, the bus is shorted, overloaded or the PSU itself is faulty.
  3. Check the gateway STATE LED — a slow 1 s rhythm means DALI bus is healthy, a fast ~250 ms rhythm indicates a bus error, short or missing DALI power.
  4. Make sure no other Modbus master (MODBUSConfigurator, BMS, PLC) is talking to the gateway at the same time.
Gear 0–63 all report -- after commissioning
  1. Measure the DALI voltage at the gear farthest from the PSU — it must be above 9.5 V. If it is lower, the bus is too long for the cable cross-section (see the DALI cable length table above). Split the bus into two segments with a second PSU.
  2. Re-run the wizard starting from Reset Short Addresses. Do not run Start on a bus that still contains previously programmed gears unless you also reset first — the algorithm only finds gears without a short address.
  3. Look for loops in the wiring. DALI tolerates no rings; cut any loop you find and re-terminate both open ends.
Set Slave ID does not change the address
  1. Confirm DIP4 = OFF on the gateway. When DIP4 = ON the hardware forces Unit ID 255 regardless of the FLASH value.
  2. Confirm the gateway actually rebooted after the action (gateway LEDs briefly go dark). If it did not, trigger Reset Gateway manually.
  3. Re-import the template with the new SlaveId import parameter — the previously imported module is still polling at the old address.
Communication works briefly then fails
  1. Check that RS485 GND is connected between the gateway and the TapHome power supply common. Missing GND is the most common RS-485 fault.
  2. Verify termination — 120 Ω at both ends of the RS-485 bus. For RTU-over-TCP through a serial bridge, make sure the bridge is in framed RTU mode, not raw TCP, and that the inter-character gap on the serial side matches 9600 baud 8N1 timing.
  3. Reduce the number of DALI queries in parallel — the gateway serialises DALI transactions and does not arbitrate between multiple Modbus masters.

Available devices

Resi Dali - Configuration Module
Service Attributes
Slave IDReads the Modbus Unit ID stored in FLASH register H:65221 — used to verify the current gateway address
Gear 0DALI device-type probe at short address 0 — returns DT{n} when a control gear answers, or -- when the address is free
Gear 1DALI device-type probe at short address 1 — returns DT{n} or --
Gear 2DALI device-type probe at short address 2 — returns DT{n} or --
Gear 3DALI device-type probe at short address 3 — returns DT{n} or --
Gear 4DALI device-type probe at short address 4 — returns DT{n} or --
Gear 5DALI device-type probe at short address 5 — returns DT{n} or --
Gear 6DALI device-type probe at short address 6 — returns DT{n} or --
Gear 7DALI device-type probe at short address 7 — returns DT{n} or --
Gear 8DALI device-type probe at short address 8 — returns DT{n} or --
Gear 9DALI device-type probe at short address 9 — returns DT{n} or --
Gear 10DALI device-type probe at short address 10 — returns DT{n} or --
Gear 11DALI device-type probe at short address 11 — returns DT{n} or --
Gear 12DALI device-type probe at short address 12 — returns DT{n} or --
Gear 13DALI device-type probe at short address 13 — returns DT{n} or --
Gear 14DALI device-type probe at short address 14 — returns DT{n} or --
Gear 15DALI device-type probe at short address 15 — returns DT{n} or --
Gear 16DALI device-type probe at short address 16 — returns DT{n} or --
Gear 17DALI device-type probe at short address 17 — returns DT{n} or --
Gear 18DALI device-type probe at short address 18 — returns DT{n} or --
Gear 19DALI device-type probe at short address 19 — returns DT{n} or --
Gear 20DALI device-type probe at short address 20 — returns DT{n} or --
Gear 21DALI device-type probe at short address 21 — returns DT{n} or --
Gear 22DALI device-type probe at short address 22 — returns DT{n} or --
Gear 23DALI device-type probe at short address 23 — returns DT{n} or --
Gear 24DALI device-type probe at short address 24 — returns DT{n} or --
Gear 25DALI device-type probe at short address 25 — returns DT{n} or --
Gear 26DALI device-type probe at short address 26 — returns DT{n} or --
Gear 27DALI device-type probe at short address 27 — returns DT{n} or --
Gear 28DALI device-type probe at short address 28 — returns DT{n} or --
Gear 29DALI device-type probe at short address 29 — returns DT{n} or --
Gear 30DALI device-type probe at short address 30 — returns DT{n} or --
Gear 31DALI device-type probe at short address 31 — returns DT{n} or --
Gear 32DALI device-type probe at short address 32 — returns DT{n} or --
Gear 33DALI device-type probe at short address 33 — returns DT{n} or --
Gear 34DALI device-type probe at short address 34 — returns DT{n} or --
Gear 35DALI device-type probe at short address 35 — returns DT{n} or --
Gear 36DALI device-type probe at short address 36 — returns DT{n} or --
Gear 37DALI device-type probe at short address 37 — returns DT{n} or --
Gear 38DALI device-type probe at short address 38 — returns DT{n} or --
Gear 39DALI device-type probe at short address 39 — returns DT{n} or --
Gear 40DALI device-type probe at short address 40 — returns DT{n} or --
Gear 41DALI device-type probe at short address 41 — returns DT{n} or --
Gear 42DALI device-type probe at short address 42 — returns DT{n} or --
Gear 43DALI device-type probe at short address 43 — returns DT{n} or --
Gear 44DALI device-type probe at short address 44 — returns DT{n} or --
Gear 45DALI device-type probe at short address 45 — returns DT{n} or --
Gear 46DALI device-type probe at short address 46 — returns DT{n} or --
Gear 47DALI device-type probe at short address 47 — returns DT{n} or --
Gear 48DALI device-type probe at short address 48 — returns DT{n} or --
Gear 49DALI device-type probe at short address 49 — returns DT{n} or --
Gear 50DALI device-type probe at short address 50 — returns DT{n} or --
Gear 51DALI device-type probe at short address 51 — returns DT{n} or --
Gear 52DALI device-type probe at short address 52 — returns DT{n} or --
Gear 53DALI device-type probe at short address 53 — returns DT{n} or --
Gear 54DALI device-type probe at short address 54 — returns DT{n} or --
Gear 55DALI device-type probe at short address 55 — returns DT{n} or --
Gear 56DALI device-type probe at short address 56 — returns DT{n} or --
Gear 57DALI device-type probe at short address 57 — returns DT{n} or --
Gear 58DALI device-type probe at short address 58 — returns DT{n} or --
Gear 59DALI device-type probe at short address 59 — returns DT{n} or --
Gear 60DALI device-type probe at short address 60 — returns DT{n} or --
Gear 61DALI device-type probe at short address 61 — returns DT{n} or --
Gear 62DALI device-type probe at short address 62 — returns DT{n} or --
Gear 63DALI device-type probe at short address 63 — returns DT{n} or --
Service Actions
Reset GatewayWrites 1 to register H:6000 to reboot the RESI-DALI gateway — required after changing the Slave ID or to recover the DALI engine after a bus short
Set Slave IDWrites the new Modbus Unit ID to FLASH register H:65221 and triggers a reset so the gateway reboots with the new address (1–255, DIP4 must be OFF)
Turn On All LampsWrites 0xFE to the DALI broadcast level register H:530 — turns every control gear on the bus to maximum brightness (quick commissioning sanity test)
Turn Off All LampsWrites 0x00 to the DALI broadcast level register H:530 — turns every control gear on the bus off

${resi_dali_configuration}

Service Attributes
${xml_slave_id}
modbusr(H,65221,uint16)
Gear 0
var ShortAddress := 0;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 1
var ShortAddress := 1;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 2
var ShortAddress := 2;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 3
var ShortAddress := 3;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 4
var ShortAddress := 4;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 5
var ShortAddress := 5;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 6
var ShortAddress := 6;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 7
var ShortAddress := 7;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 8
var ShortAddress := 8;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 9
var ShortAddress := 9;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 10
var ShortAddress := 10;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 11
var ShortAddress := 11;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 12
var ShortAddress := 12;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 13
var ShortAddress := 13;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 14
var ShortAddress := 14;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 15
var ShortAddress := 15;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 16
var ShortAddress := 16;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 17
var ShortAddress := 17;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 18
var ShortAddress := 18;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 19
var ShortAddress := 19;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 20
var ShortAddress := 20;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 21
var ShortAddress := 21;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 22
var ShortAddress := 22;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 23
var ShortAddress := 23;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 24
var ShortAddress := 24;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 25
var ShortAddress := 25;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 26
var ShortAddress := 26;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 27
var ShortAddress := 27;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 28
var ShortAddress := 28;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 29
var ShortAddress := 29;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 30
var ShortAddress := 30;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 31
var ShortAddress := 31;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 32
var ShortAddress := 32;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 33
var ShortAddress := 33;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 34
var ShortAddress := 34;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 35
var ShortAddress := 35;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 36
var ShortAddress := 36;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 37
var ShortAddress := 37;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 38
var ShortAddress := 38;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 39
var ShortAddress := 39;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 40
var ShortAddress := 40;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 41
var ShortAddress := 41;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 42
var ShortAddress := 42;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 43
var ShortAddress := 43;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 44
var ShortAddress := 44;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 45
var ShortAddress := 45;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 46
var ShortAddress := 46;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 47
var ShortAddress := 47;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 48
var ShortAddress := 48;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 49
var ShortAddress := 49;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 50
var ShortAddress := 50;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 51
var ShortAddress := 51;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 52
var ShortAddress := 52;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 53
var ShortAddress := 53;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 54
var ShortAddress := 54;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 55
var ShortAddress := 55;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 56
var ShortAddress := 56;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 57
var ShortAddress := 57;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 58
var ShortAddress := 58;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 59
var ShortAddress := 59;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 60
var ShortAddress := 60;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 61
var ShortAddress := 61;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 62
var ShortAddress := 62;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Gear 63
var ShortAddress := 63;
modbusw(SH, 511, uint16, (ShortAddress << 8) + 0x99);
sleep(5); var rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
var x := modbusr(SH, 511, uint16);
if (x != 0x8000, return("DT" + x), return("--"));
Service Actions
${xml_reset_gateway}
modbusw(SH,6000,uint16,1)
${xml_set_slave_id}
Parameters: ${xml_slave_id} (1–255 SID)
modbusw(SH, 65221, uint16, SID);

modbusw(SH,6000, uint16, 1);
${xml_turn_on_all_lamps}
modbusw(SH, 530, uint16, 0xFE)
${xml_turn_off_all_lamps}
modbusw(SH, 530, uint16, 0x00)
Find New Devices Multi-value Switch

Commissioning wizard that steps through the DALI 2.0 random-addressing algorithm to assign short addresses 0–63 to control gears

Register: H:541H:542 UInt16 numeric
Values / States: TERMINATE · ${xml_start} · ${xml_scan_short_address} · Set SEARCHADDR · COMPARE · PROGRAM SHORT ADDRESS · Check · Try again · ${xml_reset_short_addresses} · ${xml_finish}

Find New Devices

Read switch state
var x := 0x8000; var rx := 0;

if Mu = 1
	if exit <= 0
		status := 255;
        return(9);
    end
    # check SEARCHADDRH
    modbusw(SH, 541, uint16, 0xB500 + getbyte(SEARCHADDRH,0));
    sleep(500);
    modbusw(SH, 541, uint16, 0xB300 + getbyte(SEARCHADDRH,1));
    sleep(500);
    modbusw(SH, 541, uint16, 0xB100 + getbyte(SEARCHADDRH,2));
    sleep(500);
    modbusw(SH, 541, uint16, 0xA900);
    sleep(5); rx := getbits(modbusr(SH, 550, uint16), 0, 2);
    if !rx
        sleep(50);
        rx := getbits(modbusr(SH, 550, uint16), 0, 2);
    end
    if rx
        x := modbusr(SH, 541, uint16);
        if getbyte(x, 0) = 0xFF
            #match: lets check
            return(2);
        else
            return(7);
        end
    else
        return(7);
    end
end
if Mu = 2
    # find max short address
    if SHORTADDR >= 63
        status := 254;
        return(9);
    end
    if iterator >= 64
        status := 10;
        return(3);
    end
    modbusw(SH, 511, uint16, (iterator << 8) + 0x91);
    sleep(5); rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
    x := modbusr(SH, 511, uint16);
    if (x = 0xFF, SHORTADDR := iterator); 
    iterator := iterator + 1;
end
if Mu = 3
    # set SEARCHADDR
    SEARCHADDRM := SEARCHADDRH - ((SEARCHADDRH - SEARCHADDRL) >> 1);
    if(SEARCHADDRM = SEARCHADDRH or SEARCHADDRM = SEARCHADDRL, return(6));
    modbusw(SH, 541, uint16, 0xB500 + getbyte(SEARCHADDRM,0));
    sleep(50);
    modbusw(SH, 541, uint16, 0xB300 + getbyte(SEARCHADDRM,1));
    sleep(50);
    modbusw(SH, 541, uint16, 0xB100 + getbyte(SEARCHADDRM,2));
    sleep(50);
    return(4);
end
if Mu = 4
    # COMPARE
    modbusw(SH, 541, uint16, 0xA900);
    sleep(5); rx := getbits(modbusr(SH, 550, uint16), 0, 2);
    if !rx
        sleep(50);
        rx := getbits(modbusr(SH, 550, uint16), 0, 2);
    end
    if rx
        x := modbusr(SH, 541, uint16);
        #collision or match: lets search the lower segment
        SEARCHADDRH := SEARCHADDRM;
    else
        #no response: lets look up in the higher segment
        SEARCHADDRL := SEARCHADDRM;
    end
    return(3);
end
if Mu = 6
    # check SEARCHADDRL
    modbusw(SH, 541, uint16, 0xB500 + getbyte(SEARCHADDRL,0));
    sleep(50);
    modbusw(SH, 541, uint16, 0xB300 + getbyte(SEARCHADDRL,1));
    sleep(50);
    modbusw(SH, 541, uint16, 0xB100 + getbyte(SEARCHADDRL,2));
    sleep(50);
    modbusw(SH, 541, uint16, 0xA900);
    sleep(5); rx := getbits(modbusr(SH, 550, uint16), 0, 2);
    if !rx
        sleep(50);
        rx := getbits(modbusr(SH, 550, uint16), 0, 2);
    end
    if rx
        x := modbusr(SH, 541, uint16);
        if getbyte(x, 0) = 0xFF
            #exact match: we have it, lets finish
            return(5);
        else
            #collision: 2 gear with same SEARCHADDR or something went wrong, start over
            return(7);
        end
    end
    # check SEARCHADDRH
    modbusw(SH, 541, uint16, 0xB500 + getbyte(SEARCHADDRH,0));
    sleep(50);
    modbusw(SH, 541, uint16, 0xB300 + getbyte(SEARCHADDRH,1));
    sleep(50);
    modbusw(SH, 541, uint16, 0xB100 + getbyte(SEARCHADDRH,2));
    sleep(50);
    modbusw(SH, 541, uint16, 0xA900);
    sleep(5); rx := getbits(modbusr(SH, 550, uint16), 0, 2);
    if !rx
        sleep(50);
        rx := getbits(modbusr(SH, 550, uint16), 0, 2);
    end    
    if rx
        x := modbusr(SH, 541, uint16);
        if getbyte(x, 0) = 0xFF
            #exact match: we have it, lets finish
            return(5);
        else
            #collision: 2 gear with same SEARCHADDR or something went wrong, start over
            return(7);
        end
    else
        #no response: something went wrong, finish with error
        status := 220;
        #return(9);
        return(7);
    end
end
if Mu = 5
	exit := 3;
    # PROGRAM SHORT ADDRESS
    SHORTADDR := SHORTADDR + 1;
    #program
    modbusw(SH, 542, uint16, 0xB701 + (SHORTADDR << 1));
    sleep(100);
    #verify
    modbusw(SH, 541, uint16, 0xB901 + (SHORTADDR << 1));
    sleep(5); rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
    x := modbusr(SH, 541, uint16);
    if getbyte(x, 0) = 0xFF
        status := 0;
    else
        status := 230;
        #return(9);
        SHORTADDR := SHORTADDR - 1;
        return(7);
    end
    #blink
    modbusw(SH, 511, uint16, SHORTADDR + 0x06);
    sleep(500);
    modbusw(SH, 511, uint16, SHORTADDR + 0x05);
    sleep(500);
    modbusw(SH, 511, uint16, SHORTADDR + 0x06);
    #WITHDRAW
    modbusw(SH, 541, uint16, 0xAB00);
    sleep(100);
    SEARCHADDRH := 0xFFFFFF;
    SEARCHADDRL := 0;
    return(1);
end
if Mu = 9
    # finish
    if(status = 99, adderror("Timeout!"));
    if(status = 220, adderror("Check failed! (" + tostring(SEARCHADDRH, "X2") + " | " + tostring(SEARCHADDRL, "X2") + " )"));
    if(status = 230, adderror("Verify short address failed! (" + tostring(SHORTADDR, "X2") + " | " + tostring(x, "X2") + 
        " | " + tostring(SEARCHADDRH, "X2") + " | " + tostring(SEARCHADDRM, "X2") + " | " + tostring(SEARCHADDRL, "X2") + " )"));
    if(status = 231, adderror("Short address mismatch! (" + tostring(SHORTADDR, "X2") + " | " + tostring(x, "X2") + " )"));
    if(status = 254, adderror("All short addresses are in use!"));
    if status = 255
        modbusw(SH, 531, uint16, 0x96);
        sleep(5); rx := getbits(modbusr(SH, 550, uint16), 0, 2); if(rx, 0, sleep(50));
        x := modbusr(SH, 531, uint16);
        if getbyte(x, 0) = 0xFF
            adderror("Some gear is still missing short address, but no response from SEARCHADDRH! ( " + tostring(SEARCHADDRH, "X2") + " )");
        else    
            status := 1;
        end
    end
    if(status = 1, addinfo("Search finished")); 
    if(status = 200 or status = 230 or status = 231 or status = 254, iterator := 0); 
end
#debug
#if(Mu = 7, addinfo("Debug:" + tostring(x, "X2") + " | " + status),0);

#if(Mu = 1, status := "rx:" + getbits(y, 0, 2) + "|" + getbits(y, 4, 1) + "|" + getbits(y, 5, 1), 0);
#if(Mu = 1, return(7),0);
if Mu = 7
	if SEARCHADDRH = SEARCHADDRL
    	SEARCHADDRH := 0xFFFFFF;
    	SEARCHADDRL := 0;
    	exit := exit -1;
        return(1);
    end
	SEARCHADDRH := SEARCHADDRH >> 1;
	SEARCHADDRL := 0;
	if(iterator < 64, SHORTADDR := -1);
	if(iterator < 64, iterator := 0);    
    # check SEARCHADDRH
    modbusw(SH, 541, uint16, 0xB500 + getbyte(SEARCHADDRH,0));
    sleep(500);
    modbusw(SH, 541, uint16, 0xB300 + getbyte(SEARCHADDRH,1));
    sleep(500);
    modbusw(SH, 541, uint16, 0xB100 + getbyte(SEARCHADDRH,2));
    sleep(500);
    modbusw(SH, 541, uint16, 0xA900);
    sleep(5); rx := getbits(modbusr(SH, 550, uint16), 0, 2);
    if !rx
        sleep(50);
        rx := getbits(modbusr(SH, 550, uint16), 0, 2);
    end
    if rx
        x := modbusr(SH, 541, uint16);
        if getbyte(x, 0) = 0xFF
            #match: lets check
            return(2);
        else
            return(6);
        end
    else
        return(6);
    end
end
return(Mu);
Write switch state
# TERMINATE
if(Mu = 0, modbusw(SH, 542, uint16, 0xA100), 0);
# INITIALIZE:CONTROL GEARS WITHOUT SHORT ADDRESS
if(Mu = 1, modbusw(SH, 542, uint16, 0xA5FF), 0);
if(Mu = 1, sleep(100));
# RANDOMIZE
if(Mu = 1, modbusw(SH, 542, uint16, 0xA700), 0);
if(Mu = 1, sleep(100));
# Init SEARCHADDR variables
if(Mu = 1, SEARCHADDRH := 0xFFFFFF, 0);
#if(Mu = 1, SEARCHADDRM := SEARCHADDRH / 2, 0);
if(Mu = 1, SEARCHADDRL := 0, 0);
if(Mu = 1, if(iterator < 64, SHORTADDR := -1, 0), 0);
if(Mu = 1, if(iterator < 64, iterator := 0, 0), 0);
if(Mu = 1, exit := 3, 0);
# Reset Short Addresses 
if(Mu = 8, modbusw(h, 541, uint16, 0xA3FF), 0);
if(Mu = 8, sleep(100));
if(Mu = 8, modbusw(h, 532, uint16, 0x80), 0);
if(Mu = 8, SHORTADDR := -1, 0);
if(Mu = 8, iterator := 64, 0);
# Reset All to Defaults 
#if(Mu = 7, modbusw(SH, 532, uint16, 0x20), 0);
#if(Mu = 7, sleep(100));
#collision: halve interval


sleep(100);
Connection: Modbus RTU • 9600 baud• 8N1 • Slave ID: $[SlaveId]
Possible improvements (9)
  • H:510 Lamp Level (per short address) — Daily operational dimming (upper 8b = short addr, lower 8b = arc power 0–254). Covered by the sibling operational template (Resi Dali, Dali.xml) — this commissioning template is intentionally addressing-only
  • H:520 Group Level — Group 0–15 arc power for daily group control — handled by the operational Resi Dali template
  • H:521 Group Command — Group commands (ON/OFF/scenes/recall) — not needed for addressing
  • H:531 Broadcast Command — The Finish state uses H:531=0x96 internally to poll QUERY MISSING SHORT ADDRESS, but the register is not exposed as a user action
  • H:551 DALI Bus Error (word) — 1 = DALI bus fault / short — useful diagnostic during commissioning, could be added as a module-level service attribute
  • H:100 DALI Priority Slot — 0–4 → 12–16 ms forward-frame slots, default 2. Bus-tuning parameter; safe to leave at default
  • H:65222 Baud Rate (FLASH) — Only honored when DIP1=DIP2=ON. Template pins 9600 baud via connection_details, so this register is out of scope
  • H:65224 Parity (FLASH) — 0=None, 1=Even, 2=Odd. Template hard-codes None (8N1)
  • H:65225 Stop Bits (FLASH) — 1 or 2. Template hard-codes 1

Sources