Chapter 3 · How Programming Works
Memory Flags and References
As a program grows, wires running everywhere become impossible to follow. LOXONE Config gives you two tools that carry a value from one place to another without that tangle: the Memory Flag and the Reference.
They are what keep a real project readable, and readable is what keeps it easy to fix.
By the end of this lesson you will be able to:
- Use a Memory Flag to send a value to several places in a program
- Use a Reference to connect points cleanly, even across different pages
- Choose the right one for a given situation
The situation
Your program is growing. A single value, say a signal that the house is in Night mode, now needs to reach several different places, and some of them are on other programming pages.
Running long wires across the project would turn it into a maze. Somebody opening that project in a year, possibly you, would struggle to follow it.
The Memory Flag
A Memory Flag carries a value to more than one place in a program. It can hold digital, analogue, text, T5 and Smart Actuator values, and it can be shown in the app if you want it to be.
Its great use is one to many. A value goes into the flag once, and every place that needs that value reads it from the flag, without a wire drawn to each one.
Inserting a Memory Flag
Create the memory flag once, then use it wherever the value is needed.
- In the list of peripherals, right-click Memory Flags and create a new memory flag.
- Place the memory flag on the programming page. It stays attached to the cursor until you click to drop it.
- Connect the source that sets the value of the memory flag.
- Read the memory flag wherever you need that value, in as many places as you like.
The Reference
A Reference is like a direct wire between two points, an input, an output, or a block, but drawn without the actual line. Its purpose is to keep the program clear, and it can reach across programming pages, which a normal wire cannot.
A reference always goes from one point, A, to another, B.
Connecting a reference
A reference connects two points without a visible line, even across programming pages.
- Drag a connection from an input or output into an empty area of the page. The reference is created automatically.
- To use the reference at another point, including on another page, choose it from the selection table.
- Double-click the reference to jump straight to its other end, wherever it is.
Which one to use
The two tools overlap, so a simple way to choose helps.
Reach for a Memory Flag when one value needs to go to many places, or when you want that value visible in the app.
Reach for a Reference when you simply want a clean connection between two specific points, especially across pages, without a visible flag.
| Situation | Use |
|---|---|
| One value needed in several places | Memory Flag |
| The value should be visible in the app | Memory Flag |
| A clean connection between two points | Reference |
| Connecting across programming pages | Reference |
Why this matters later
These two tools look like tidying. They are more than that.
Central functions such as Good Night and Leaving House are built from memory flags carrying a signal from one room to the whole building. When you reach those lessons, you will already know what the flags are doing.