Memory blocks
Blocks that remember something: a latched on/off state, or a named value shared across every flow on the server.
1.SR and RS flip-flops
A latch: one pulse switches it on, another switches it off, and it holds in between. Both blocks have the same pins and differ only in who wins a tie.
| Pin | Direction | Description |
|---|---|---|
| S | Input | Set — a pulse switches the output on. |
| R | Input | Reset — a pulse switches the output off. |
| Tg | Input | Toggle — a pulse flips the output to whatever it is not. |
| O | Output | The latched state. |
| Parameter | Description | Default |
|---|---|---|
| Rem | Keeps the latched state across a restart or a redeploy. | 0 |
- Only the rising edge counts. The block acts when a pin goes from false to true. Holding a pin true does nothing further, and releasing it does nothing at all.
- It only sends when the state actually changes. A reset pulse while the output is already off produces nothing downstream.
- A pin that has never fired counts as false, so the very first true pulse on any pin is always seen as a rising edge.
Use
Tg alone to turn a single button into an on/off switch: wire the button's trigger to Tg and the output to the light.2.Which input wins
The only difference between the two blocks, and the reason to pick one over the other.
| Block | Priority | Means |
|---|---|---|
| RS flip-flop | Set beats Reset | While S is held high, a reset pulse is ignored. The output stays on. |
| SR flip-flop | Reset beats Set | While R is held high, a set pulse is ignored. The output stays off. |
In both blocks Tg comes last: it is only evaluated when neither set nor reset acted on that event.
For anything safety-shaped, pick the block whose dominant input is the safe direction. A fan that must stop when a window opens wants reset to win — the SR flip-flop — so a stuck "on" signal can never hold it running.
3.What Rem really does
What it covers, and the one thing it does not.
| Event | With Rem on | With Rem off |
|---|---|---|
| Server restart or power cut | The latch comes back exactly as it was. | The latch comes back off. |
| Re-deploying the flow | The latch keeps its state. | Reset to off. |
Rem covers a redeploy as well as a restart, so changing something unrelated in a flow no longer resets every latch, disarms the alarm or returns a room controller to its defaults. Pending timers are still dropped by a deploy — a delay that was counting down does not resume — so deploy with that in mind on a live site.
Turn Rem on for anything a customer would notice coming back wrong — a holiday mode, a disabled automation, a manual override. Leave it off for anything that should start clean, which is most things during commissioning.
4.Memory flags
A named value you set in one place and read in another — the way to get information between flows.
| Block | Pins | What it does |
|---|---|---|
| Memory flag set | Input I, output O | Stores whatever arrives under the flag name, and passes the same value straight out of O so the flow can continue. |
| Memory flag get | Output O only | Has no input. It emits the flag's value automatically whenever something sets it, and once when its flow starts if the flag already has a value. |
| Parameter | Description |
|---|---|
| Flag key | The name of the flag. Both blocks must use exactly the same text — it is matched literally. |
The Flag key box on a new Memory flag set block shows
flag_1 as a suggestion, but nothing is stored until you type in it. Click into the field and enter the name — even if you want flag_1 — or saving the flow fails with "requires a non-empty flag key".- A flag holds any kind of value — true/false, a number, a text — exactly as it arrived.
- One flow may contain only one set block per flag name, and that block takes a single input.
- You can have as many get blocks as you like, in as many flows as you like.
5.Flag scope and lifetime
Flags are more global, and more permanent, than anything else in the flow editor.
- They are server-wide. A flag is not scoped to a flow — setting
holidayin one flow is immediately visible to every get block in every other flow. - They are saved automatically. Flags survive restarts and re-deploys. There is no Rem switch because they are always remembered.
- They are never cleared. Once set, a flag keeps its value until something writes a different one. There is no expiry and no reset button.
Two different flows can both set the same flag name — nothing warns you, and whichever ran last wins. Treat flag names like global variables: give them specific names (
holiday_mode, not mode) and keep a note of where each one is written.Because a get block emits when its flow starts, a flag is a good way to restore a mode after a restart: the flows that depend on
holiday_mode pick up its stored value as they come up, without anyone pressing anything.Back to all function blocks, or see a flag used in the holiday simulation example.