> 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/control/out3p.md).

# Out3P

## `Out3P` (FB)

FUNCTION\_BLOCK Out3P

### Short description

> Conversion of an analog value (e.g. P controller) into output signals for a 3-point actuator (pulse-width modulation).\
> In addition, a reference position (limit switch) of the actuator can be detected.

### Representation

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

### Interfaces

#### Inputs

| Name      | Data type | Value range | Initial value | Function                                                          |
| --------- | --------- | ----------- | ------------- | ----------------------------------------------------------------- |
| *xEn*     | BOOL      |             |               | Enable of the function block                                      |
| *rIn*     | REAL      |             |               | Input signal                                                      |
| *xRefPos* | BOOL      |             |               | Digital input for detecting the reference position (limit switch) |

#### Outputs

| Name        | Data type | Value range | Initial value | Function                                    |
| ----------- | --------- | ----------- | ------------- | ------------------------------------------- |
| *xOutOpen*  | BOOL      |             |               | Output variable Plus/More for the actuator  |
| *xOutClose* | BOOL      |             |               | Output variable Minus/Less for the actuator |
| *rPos*      | REAL      | 0.0 … 100.0 |               | Analog signal for the current position      |

#### Setpoints / Parameters

| Name             | Data type | Value range | Initial value | Function                                                 |
| ---------------- | --------- | ----------- | ------------- | -------------------------------------------------------- |
| **iRefPosition** | INT       | 0 - 100     | 0%            | Reference position of the actuator                       |
| **tImpulsClose** | TIME      |             | 1s            | Duration of a pulse at output Minus/Less                 |
| **tImpulsOpen**  | TIME      |             | 1s            | Duration of a pulse at output Plus/More                  |
| **rMinLimit**    | REAL      |             | -100.0        | Integral value for pulse triggering at output Minus/Less |
| **rMaxLimit**    | REAL      |             | 100.0         | Integral value for pulse triggering at output Plus/More  |
| **rDuration**    | TIME      |             | 120s          | Actuator runtime                                         |
| **tIntegration** | TIME      |             | 100ms         | Time duration between two integration operations         |

### Functional description

#### General

This function block is used to convert an analog input signal *rIn* into the corresponding output signals *xOutOpen* and *xOutClose* in the form of pulse-width modulation.\
The pulse length is always constant (**tImpulsClose** or **tImpulsOpen**) while the pause between two pulses varies in length.\
With a current input signal *rIn* of 0.0, no output pulses are generated.\
If the current input signal is in the positive range (0.0 - +100.0), then only at output *xOutOpen* pulses are generated.\
If the current input signal is in the negative range (0.0 - -100.0), then only at output *xOutClose* pulses are generated.\
Enabling/disabling of the function block is done via the digital input *xEn*.\
Every rising edge at the digital input *xRefPos* (i.e. the actuator is currently in its reference position) causes a redefinition of the analog output signal *rPos* to the setpoint / parameter **iRefPosition**.

#### Enable input *xEn*

When the enable input is not active (*xEn* = FALSE) both outputs *xOutOpen* and *xOutClose* are reset. In addition, the integral is set to 0 and the digital signal for detecting the reference position *xRefPos* has no function.\
With each falling edge at the enable input, the output signal *xOutClose* for a duration of **rDuration** + 10 s is permanently activated and at the same time the output signal *xOutOpen* is deactivated (= forced movement of the actuator to the resting position).

#### Reference position

The digital input *xRefPos* allows readjustment of the position display *rPos* to a predefined value **iRefPosition** (0% = rest position - 100% = maximum position).\
Every rising edge at the digital input triggers a readjustment.

#### Signal generation

The analog input signal *rIn* (control deviation of a control process, signal symmetric about zero) is integrated over time in the interval **tIntegration** over time.\
That is, after each integration interval **tIntegration** the product of *rIn* and the **tIntegration** is formed and added to the current contents of the integration memory. A staircase function is therefore created.

> **Example**
>
> *rIn* = 100K, **tIntegration** = 100ms, old value of the integration memory = 500Ks, new value (after 100ms) = 510Ks.\
> If the integration value exceeds the limit value **rMaxLimit**, then at output signal *xOutOpen* a pulse of length **tImpulsOpen** is generated.

If the integration value falls below the limit value **rMinLimit**, then at output signal *xOutClose* a pulse of length **tImpulsClose** is generated.\
After each pulse generation, the integration value is reset to 0.\
The limit value **rMaxLimit** may only assume values > 0.0, the limit value **rMinLimit** may only assume values < 0.0.

> **Examples with different parameters**
>
> **tIntegration** = 100ms, **rMaxLimit** = 100.0, **rMinLimit** = -100.0: With an input signal *rIn* at a level of +5.0 at output *xOutOpen* a pulse of length 1s is generated every 4s.\
> **tIntegration** = 100ms, **rMaxLimit** = 100.0, **rMinLimit** = -100.0: With an input signal *rIn* at a level of -5.0 at output *xOutClose* a pulse of length 1s is generated every 4s.\
> \
> **tIntegration** = 200ms, **rMaxLimit** = 100.0, **rMinLimit** = -100.0: With an input signal *rIn* at a level of +5.0 at output *xOutOpen* a pulse of length 1s is generated every 2s.\
> **tIntegration** = 200ms, **rMaxLimit** = 100.0, **rMinLimit** = -100.0: With an input signal *rIn* at a level of -5.0 at output *xOutClose* a pulse of length 1s is generated every 2s.\
> \
> **tIntegration** = 100ms, **rMaxLimit** = 200.0, **rMinLimit** = -100.0: With an input signal *rIn* at a level of +5.0 at output *xOutOpen* a pulse of length 1s is generated every 8s.\
> **tIntegration** = 100ms, **rMaxLimit** = 200.0, **rMinLimit** = -100.0: With an input signal *rIn* at a level of -5.0 at output *xOutClose* a pulse of length 1s is generated every 8s.

#### Position display *rPos*

It is used to display the current position of the 3-point actuator in the range 0 - 100% and is calculated internally (0% = resting position, 100% = maximum position).\
To avoid deviations between the calculated and the actual position, regular triggering of the readjustment of the position display is recommended.\
The position display is independent of the signal generation, i.e. if the position display reaches an end position (0% or 100%), signals continue to be output at outputs *xOutOpen* or *xOutClose* is generated.

### CODESYS

InOut:

| Scope       | Name           | Type   | Initial      |
| ----------- | -------------- | ------ | ------------ |
| Input       | `xEn`          | `BOOL` |              |
| Input       | `rIn`          | `REAL` |              |
| Input       | `xRefPos`      | `BOOL` |              |
| Input Const | `iRefPosition` | `INT`  | 0            |
| Input Const | `tImpulsClose` | `TIME` | TIME#1s0ms   |
| Input Const | `tImpulsOpen`  | `TIME` | TIME#1s0ms   |
| Input Const | `rMinLimit`    | `REAL` | -100.0       |
| Input Const | `rMaxLimit`    | `REAL` | 100.0        |
| Input Const | `tDuration`    | `TIME` | TIME#2m0s0ms |
| Input Const | `tIntegration` | `TIME` | TIME#100ms   |
| Output      | `xOutOpen`     | `BOOL` |              |
| Output      | `xOutClose`    | `BOOL` |              |
| Output      | `rPos`         | `REAL` |              |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
