I have gone through various documents regarding the Commissioning in the DALI interface. But I finding it difficult to understand some of the points. So if anyone with DALI Commissioning can help me understand the commissioning procedure. I already know this part.

  1. first initialization command is sent.

  2. Then randomize command is sent which will generate 24-bit random address at ballast side.

After this how it assigns the short address to each ballast is out of my knowledge and this is where I am stuck right now. Any help would be much appreciated.

  • \$\begingroup\$ this might help dalibydesign.us/commissioning.html \$\endgroup\$ Jul 8, 2013 at 9:22
  • \$\begingroup\$ This isn't really an electronics design question, it is a question on an algorithm and a protocol. \$\endgroup\$
    – Martin
    Jul 8, 2013 at 9:29

2 Answers 2


After randomising the ballasts, the controller searches for the ballast with the lowest random number. It does this by issuing search address commands which contain the address that it is looking for, and compare commands which are queries, which get replies from all the ballasts that have that search address or lower as their random address.

Once the controller gets no replies, it backtracks one step to check the one ballast with that random address, then it assigns it a short address using a special program command which only takes effect in the ballast whose random address equals the search address. (This is technically called the "selected" state). Then the controller tells that ballast to withdraw from the process so it doesn't respond to further compares this time round, and the search can continue for the next highest ballast.

The standards don't actually dictate that binary search is the algorithm used, but it is assumed that this the best method. Note that some people use the term "long address" but this is not the correct name, there is only the random address and the search address (the current value guessed by the controller), and that the random address is not really an address mode of the commands (which are too short to contain it anyway). There is only 267 Program Short Address and 269 Query Short address commands that use the random/search address as the defining factor as to whether the command applies to them, and these are only valid between Initialise and Terminate.

There are many small details to this process which I have omitted for simpilicity, like dealing with duplicate random addresses, but this gives you the general idea.

Once the controller has identified one ballast by search address, it is free to chose a short address. Some controllers do this automatically, others allow the user to enter the number they would like to use. It is usual at this point to identify which ballast has been found by means of flashing the lamps, using the short address.

  • \$\begingroup\$ 1. How does the control device assigns short address to the ballast when it still doesn't know the short address to communicate with that ballast ? 2. How it finds the exact random address match since there are 2^24 combination due to 24-bit random address ? \$\endgroup\$
    – Jimit
    Jul 8, 2013 at 9:50
  • \$\begingroup\$ 1. Only the ballast with the random address matching the short address actually applies the Program Short Address command. 2. Start in the middle and do binary search, will get there in 24 steps. \$\endgroup\$
    – Martin
    Jul 8, 2013 at 9:55
  • \$\begingroup\$ correct me if I am wrong but random address is 24-bit and short address is 6-bit. So how can you justify the statement "Only the ballast with the random address matching the short address actually applies the Program Short Address command". Thanks for your quick reply. \$\endgroup\$
    – Jimit
    Jul 8, 2013 at 10:00
  • \$\begingroup\$ How does the protocol handles the multiple replies from ballasts since the condition "random address <= search address" can be equal for more than one ballasts ? \$\endgroup\$
    – Jimit
    Jul 8, 2013 at 10:48
  • 1
    \$\begingroup\$ Typo, I meant only the random address matching the search address actually applies it, as per the answer. Multiple replies collide, this is expected and normal and does not consume bandwidth. The controller has to treat collisions in a sensible way, that is down to controller design. No need to do anything complex with analysing collisions, just to notice presence of collision and make the right decision as to next command or query. \$\endgroup\$
    – Martin
    Jul 8, 2013 at 11:13

Since algorithm efficiency came up, I wanted to point out that a basic binary search is not the best algorithm.

The speed bottleneck is the total number of dali commands, and you set the 24-bit random address 8 bits at a time. So... the key is to change your search increments such that you send out a minimum of these 8-bit commands. So make sure you traverse not the whole range at once, but each 8 bit section in turn.

Also consider that you're looking for ANY DALI light, not a specific one, so doing a compare command on 1/2 of the range is not efficient than say 1/24 of the range (the most efficient number would be the "average" number of DALI devices on a bus+1). That and make sure to adjust your range as you permanently rule areas out with compare.

If you want to get fancy you can even use a bad backward frame on the compare command as information that tells you there are 2+ devices in that space instead of one.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.