Chapter 3 · How Programming Works
Function Blocks
Between an input and an output sits the logic, and in LOXONE that logic is built from function blocks. A block is a ready made piece of intelligence. Some are simple, like an AND. Some are whole systems, like the Lighting Controller with all its moods and automation built in.
Learning to work with blocks is learning to program LOXONE.
By the end of this lesson you will be able to:
- Insert a function block into a program
- Name a block and assign it to a room and category correctly
- Reveal the inputs and parameters a block does not show by default
The situation
Connecting a button straight to a light works for the simplest case. But a real building needs more: a light that dims, that remembers moods, that comes on with movement.
That intelligence does not have to be built from scratch. It already exists inside function blocks, and your job is to place the right one and set it up well.
What is a function block?
A function block represents a logical part of a program. Most blocks have inputs, outputs and parameters, and many have deeper settings that open when you double click them, such as the Lighting Controller or the Schedule.
Some blocks are large and do a great deal on their own, like the Lighting Controller or Automatic Shading. Others are small logical pieces, like AND and OR, or analogue functions like a Threshold Switch.
Inserting a block
Add a block to the programming page, then set it up.
- Click Add Function Block on the ribbon. The arrow below it opens a menu sorted by category, where you can find the block you want. Or press F5, type the block’s name, and insert it straight from the results.
- Place the block on the page, and connect its inputs and outputs.
- If the block has more settings, double-click it. The Lighting Controller is one example.
What the customer may see in the app
Shown by default
Reveals the hidden inputs and parameters
Naming and assigning a block
How you name and assign a block matters, because blocks create what the customer sees in the app.
The naming rule is simple. If a room has only one block of a given type, the app shows the room name. If a room has two or more of the same type, for example two Lighting Controllers, the app shows the block name instead, so it needs a meaningful one. A block referenced elsewhere in your logic should always have a clear name so you can identify it.
The block type itself cannot be renamed. What you must set is the room and the category, because both decide where and how the block appears in the app.
Block name
Block type
Room name
Category
Showing hidden inputs and parameters
A block only shows some of its inputs and outputs by default, to keep the page tidy. The rest are still there, waiting to be revealed.
Under the small expand sign on the block, you can show the other available inputs and parameters. Parameters can even be driven by your own logic, so a value from elsewhere in the program can change how the block behaves as it runs.
Blocks build the app
A function block is not only logic. Because blocks create the visualisation in the app, a block that is well named and correctly assigned to a room and category gives the customer a clean, understandable app. A block left with a default name and no room assignment gives a messy one.
The care you take here is not just for you. It is what the customer lives with every day.