# Position3P

## `Position3P` (FB)

FUNCTION\_BLOCK Position3P

### Short description

> Calculation of the current position of a 3-point actuator\
> Additionally, a reference position (limit switch) of the actuator can be captured.\
> Typical application: Position determination for a 3-point valve actuator

### Representation

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

### Interfaces

#### Inputs

| Name        | Data type | Value range | Initial value | Function                                                          |
| ----------- | --------- | ----------- | ------------- | ----------------------------------------------------------------- |
| *xOutOpen*  | BOOL      |             |               | Input - Enable - Open                                             |
| *xOutClose* | BOOL      |             |               | Input - Enable - Close                                            |
| *xRefPos*   | BOOL      |             |               | Digital input for detecting the reference position (limit switch) |

#### Outputs

| Name   | Data type | Value range                    | Initial value | Function                             |
| ------ | --------- | ------------------------------ | ------------- | ------------------------------------ |
| *rPos* | REAL      | **rMinLimit** to **rMaxLimit** |               | Display of the current position in % |

#### Setpoints / parameters

| Name             | Data type | Value range | Initial value | Function                           |
| ---------------- | --------- | ----------- | ------------- | ---------------------------------- |
| **iRefPosition** | INT       | 0 - 100     | 0%            | Reference position of the actuator |
| **rMinLimit**    | REAL      |             | 0.0           | Limit - Minimum position           |
| **rMaxLimit**    | REAL      |             | 100.0         | Limit - Maximum position           |
| **tDuration**    | TIME      |             | T#120s        | Runtime of the actuator            |

### Function description

#### General

This function block is used to calculate the current position of a 3-point actuator that has no position feedback.\
The calculation is performed based on the duration of the signals at the inputs Input - Enable - Open *xOutOpen* and Input - Enable - Close *xOutClose*.\
Any rising edge on the digital input *xRefPos* (i.e. the actuator is currently in its reference position) triggers a redefinition of the analog output signal *rPos* to the target value / parameter **iRefPosition**.

#### Reference position

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

#### Position display *rPos*

It is used to display the current position of the 3-point actuator in the range **rMinLimit** to **rMaxLimit** and is calculated internally.\
Signals at the input *xOutOpen* increase the value of the position display, signals at the input *xOutClose* decrease the value of the position display.

{% hint style="info" %}
**Limitations / Notes**

The 3-point actuator must move linearly, i.e. produce the same position changes in equal time intervals.\
A position change via any manual override hardware that may exist will not be registered.\
To avoid deviations between the calculated and the actual position, regular triggering of the position display readjustment is recommended.
{% endhint %}

### CODESYS

InOut:

| Scope       | Name           | Type   | Initial      |
| ----------- | -------------- | ------ | ------------ |
| Input       | `xOutOpen`     | `BOOL` |              |
| Input       | `xOutClose`    | `BOOL` |              |
| Input       | `xRefPos`      | `BOOL` |              |
| Input Const | `iRefPosition` | `INT`  | 0            |
| Input Const | `rMinLimit`    | `REAL` | 0.0          |
| Input Const | `rMaxLimit`    | `REAL` | 100.0        |
| Input Const | `tDuration`    | `TIME` | TIME#2m0s0ms |
| Output      | `rPos`         | `REAL` |              |
