For each roller blind, you need two variables to store its status:
- movement = 1 – the blind is moving; = 0 – the blind is stationary
- direction = 1 – the blind is moving or was last moving upwards; = 0 – downwards
In addition, a timer T counting down 10 seconds, an input signal and the edge of the input signal, in the same way as for the lighting.
Variables for roller shutter 1 (assign the addresses to free memory cells yourself)
j1 (movement), k1 (direction), we1 (input), p1 (current input state), T1 (timer).
Additionally, nj1 and nk1 represent the next movement and direction states.
; zbocze na wejściu, postój, kier. był w górę
; - załącz jazdę w dół
|---|we1|---|/ p1|---|/ j1|---|k1|---+---[SET nj1
| +---[RES nk1
; zbocze na wejściu, postój, kier. był w dół
; - załącz jazdę w górę
|---|we1|---|/ p1|---|/ j1|---|/ k1|-+--[SET nj11
| +--[SET nk1
; zbocze na wejściu, trwa jazda - zatrzymaj
|---|we1|---|/ p1|---|j1|---------------[RES nj1
; zapamiętaj stan wejścia do jako stan "poprzedni"
|---|we1|----------------(p1)----|
; timer zlicza czas jazdy rolety
|---|j1|-----------------(T1)----|
| K100
; timer odmierzył 10 sek - zatrzymaj
|---|T1|----------------------[RES nj1
; przepisz nj na j1, nk na k1
|---|nj1|----------------(j1)----|
|---|nk1|----------------(k1)----|
Repeat the above section for each roller shutter control button. For group control buttons, make the following modification: in addition to SET/RES for the group, also perform SET/RES for each of the roller shutters belonging to the group.
; zbocze na wejściu, postój, kier. był w górę
; - załącz jazdę w dół
|---|weg|---|/ pg|---|/ jg|---|kg|---+---[SET njg
| +---[RES nkg
| +---[SET j1
| +---[RES k1
| +---[SET j2
| +---[RES k2
| +---[SET j..
| +---[RES k..
; zbocze na wejściu, postój, kier. był w dół
; - załącz jazdę w górę
|---|weg|---|/ pg|---|/ jg|---|/ kg|-+--[SET njg
| +--[SET nkg
| +--[SET j1
| +--[SET k1
| +--[SET j2
| +--[SET k2
| +--[SET j..
| +--[SET k..
; zbocze na wejściu, trwa jazda - zatrzymaj
|---|weg|---|/ pg|---|jg|-----------+---[RES njg
| +---[RES j1
| +---[RES j2
| +---[RES j...
; zapamiętaj stan wejścia do jako stan "poprzedni"
|---|weg|----------------(pg)----|
; timer zlicza czas jazdy rolety
|---|jg|-----------------(Tg)----|
| K100
; timer odmierzył 10 sek - zatrzymaj
|---|Tg|------------------+---[RES njg
| +---[RES j1
| +---[RES j2
| +---[RES j...
The order is important: first the individual roller shutters, then the groups (as many as needed), and finally – the most important group.
Finally, control the outputs based on the variables j... and k...
; wyjścia
|---|j1|---|k1|---------------(wy_jazda_w_górę_1)
|---|j1|---| / k1|------------(wy_jazda_w_dół_1)
...
|---|j10|---|k10|-------------(wy_jazda_w_górę_10)
|---|j10|---| / k10|----------(wy_jazda_w_dół_10)
Edit: correction in the programme