> For the complete documentation index, see [llms.txt](https://support.powerio.com/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.powerio.com/hub/codesys-hvac/en/hvac-library/functionblocks/components/shade.md).

# Shade

## `Shade` (FB)

FUNCTION\_BLOCK Shade

### Short description

> Control of a blind actuator with open/close commands and central control\
> Additional functions: slat adjustment / central control / comfort functions\
> Typical application: control of a standard blind actuator

### Representation

<figure><img src="https://2592874069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-05606e7315a62c71a5b0e8b296b6b068218df5f3%2FShade_FB.png?alt=media" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name           | Data type         | Range of values                                                           | Initial value          | Function                                                    |
| -------------- | ----------------- | ------------------------------------------------------------------------- | ---------------------- | ----------------------------------------------------------- |
| *xButtonUp*    | BOOL              |                                                                           |                        | Request - blind opening via button                          |
| *xButtonDown*  | BOOL              |                                                                           |                        | Request - blind closing via button                          |
| *xCentralUp*   | BOOL              |                                                                           |                        | Request - blind opening via central control                 |
| *xCentralDown* | BOOL              |                                                                           |                        | Request - blind closing via central control                 |
| *eAOOUp*       | HVACTYPES.eManBin | HVACTYPES.eManBin.Auto, HVACTYPES.eManBin.ManOff, HVACTYPES.eManBin.ManOn | HVACTYPES.eManBin.Auto | Manual override operating mode - hardware for blind opening |
| *eAOODown*     | HVACTYPES.eManBin | HVACTYPES.eManBin.Auto, HVACTYPES.eManBin.ManOff, HVACTYPES.eManBin.ManOn | HVACTYPES.eManBin.Auto | Manual override operating mode - hardware for blind closing |

#### Outputs

| Name    | Data type | Range of values | Initial value | Function                          |
| ------- | --------- | --------------- | ------------- | --------------------------------- |
| *xUp*   | BOOL      |                 |               | Enable - blind opening            |
| *xDown* | BOOL      |                 |               | Enable - blind closing            |
| *xAuto* | BOOL      |                 |               | Collective message automatic mode |

#### Setpoints / parameters

| Name              | Data type | Range of values                             | Initial value | Function                                                                    |
| ----------------- | --------- | ------------------------------------------- | ------------- | --------------------------------------------------------------------------- |
| **tFullMovement** | TIME      |                                             | T#30s         | Time duration for complete opening / closing                                |
| **tPulse**        | TIME      |                                             | T#600ms       | Time duration of the pulse for slat adjustment                              |
| **tButton**       | TIME      |                                             | T#900ms       | Time duration for distinguishing slat adjustment / complete opening/closing |
| **tWaitReverse**  | TIME      |                                             | T#2s          | Waiting time for switching between opening and closing                      |
| **eManModeUp**    | eMANBIN   | eMANBIN.Auto, eMANBIN.ManOff, eMANBIN.ManOn | eMANBIN.Auto  | Operating mode of manual override - blind opening                           |
| **eManModeDown**  | eMANBIN   | eMANBIN.Auto, eMANBIN.ManOff, eMANBIN.ManOn | eMANBIN.Auto  | Operating mode of manual override - blind closing                           |

### Function description

#### General

This function block controls a blind actuator with open (*xUp*) and close commands (*xDown*).\
The open and close commands can be overridden by the parameters **eManModeUp** or **eManModeDown** independently of the automatic functions.\
Operation is via the pushbutton inputs *xButtonUp* and *xButtonDown*.\
A central control is possible via the inputs *xCentralUp* and *xCentralDown* .\
The actuation time of the inputs *xButtonUp* and *xButtonDown* determines the executed function (actuation time < **tButton**: complete opening/closing, actuation time >= **tButton**: slat adjustment).\
In addition, a forced control of the outputs *xUP* and *xDown* takes place, i.e. if output *xUp* is active (= TRUE), then output *xDown* is deactivated (= FALSE) at the same time. This also applies to the reverse case.\
If during a complete opening / closing one of the two buttons (*xButtonUp* = TRUE and / or *xButtonDown* = TRUE) is pressed, the opening / closing is interrupted immediately.

#### Central control

Every rising edge at the input Request - blind opening via central control *xCentralUp* triggers complete opening of the blind (*xUp* = TRUE and *xDown* = FALSE during the time duration **tFullMovement**).\
Every rising edge at the input Request - blind closing via central control *xCentralDown* triggers complete closing of the blind (*xDown* = TRUE and *xUp* = FALSE during the time duration **tFullMovement**).\
If the inputs for central control are permanently active (= TRUE), operation via the buttons *xButtonUp* and *xButtonDown* is not possible.

#### Waiting time for switching between opening and closing **tWaitReverse**

The switching from opening to closing of the blind and vice versa can be delayed in time by this setpoint / parameter.\
The value 0.0s allows immediate switching.

#### Slat adjustment

The slat adjustment is triggered by a continuous actuation of the operating buttons *xUp* or *xDown* for a duration greater than the time duration for the distinction slat adjustment / complete opening/closing **tButton** .\
During the actuation of the respective button, a symmetrical output signal (pause duration = pulse duration = **tPulse**) is generated at the assigned output.

#### Complete opening / closing

The complete opening / closing is triggered by actuating the respective assigned buttons *xUp* or *xDown* for a duration less than the time duration for the distinction slat adjustment / complete opening/closing **tButton** .\
At the corresponding output, a signal (state = TRUE) with a duration of **tFullMovement** is then generated without further influence.\
At the respective other output, no signal (state = FALSE) is generated during this time duration.

#### Collective message automatic mode *xAuto*

The collective message automatic mode *xAuto* is activated (= TRUE) if the following conditions are simultaneously met:

* Input *eAOOUp* = HVACTYPES.eManBin.Auto
* Input *eAOODown* = HVACTYPES.eManBin.Auto
* Setpoint / parameter **eManModeUp** = eMANBIN.Auto
* Setpoint / parameter **eManModeDown** = eMANBIN.Auto

### CODESYS

InOut:

| Scope       | Name            | Type    | Initial      |
| ----------- | --------------- | ------- | ------------ |
| Input       | `xButtonUp`     | `BOOL`  |              |
| Input       | `xButtonDown`   | `BOOL`  |              |
| Input       | `xCentralUp`    | `BOOL`  |              |
| Input       | `xCentralDown`  | `BOOL`  |              |
| Input       | `eAOOUp`        | eManBin |              |
| Input       | `eAOODown`      | eManBin |              |
| Output      | `xUp`           | `BOOL`  |              |
| Output      | `xDown`         | `BOOL`  |              |
| Output      | `xAuto`         | `BOOL`  |              |
| Input Const | `tFullMovement` | `TIME`  | TIME#30s0ms  |
| Input Const | `tPulse`        | `TIME`  | TIME#600ms   |
| Input Const | `tButton`       | `TIME`  | TIME#900ms   |
| Input Const | `tWaitReverse`  | `TIME`  | TIME#2s0ms   |
| Input Const | `eManModeUp`    | eMANBIN | eMANBIN.Auto |
| Input Const | `eManModeDown`  | eMANBIN | eMANBIN.Auto |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://support.powerio.com/hub/codesys-hvac/en/hvac-library/functionblocks/components/shade.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
