# ValveAnalog

## `ValveAnalog` (FB)

FUNCTION\_BLOCK ValveAnalog

### Short description

> Control of a continuous valve actuator with anti-blocking function and continuous position feedback\
> \
> Typical application: control valve in a heating circuit

### Representation

<figure><img src="/files/e3553bf41a7800e17311af2999edea370fb23895" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name       | Data type         | Value range                                   | Initial value          | Function                                             |
| ---------- | ----------------- | --------------------------------------------- | ---------------------- | ---------------------------------------------------- |
| *rY*       | REAL              |                                               |                        | Control signal from controller                       |
| *xForce*   | BOOL              |                                               | FALSE                  | Forced override after manual override                |
| *xAlarmIn* | BOOL              |                                               | FALSE                  | Actuator fault message                               |
| *rU*       | REAL              |                                               | 0.0                    | Position feedback from the control valve             |
| *eAO*      | HVACTYPES.eManNum | HVACTYPES.eManNum.Auto, HVACTYPES.eManNum.Man | HVACTYPES.eManNum.Auto | Feedback - automatic operation                       |
| *rPoti*    | REAL              |                                               |                        | Feedback - control signal from hardware manual level |

#### Outputs

| Name          | Data type       | Value range | Initial value | Function                                        |
| ------------- | --------------- | ----------- | ------------- | ----------------------------------------------- |
| *rHA*         | REAL            |             |               | Control signal after manual override            |
| *rAA*         | REAL            |             |               | Control signal before manual override           |
| *xAlarmPos*   | BOOL            |             |               | Fault message from position monitoring          |
| *dtAbsLastOn* | DATE\_AND\_TIME |             |               | Date / time of the last anti-blocking operation |
| *xAlarm*      | BOOL            |             |               | Collective fault indication                     |
| *xAuto*       | BOOL            |             |               | Collective automatic-mode message               |

#### Setpoints / parameters

| Name               | Data type | Value range                                 | Initial value | Function                                                  |
| ------------------ | --------- | ------------------------------------------- | ------------- | --------------------------------------------------------- |
| **udiControlTime** | UDINT     | 0 … 600s                                    | 180s          | Duration of the position monitoring                       |
| **rControlDiff**   | REAL      |                                             | 7.0%          | Monitoring of valve position: maximum position deviation  |
| **xControl**       | BOOL      |                                             | TRUE          | Enablement of the position monitoring                     |
| **xForceOption**   | BOOL      |                                             | TRUE          | State of the output *rHA* during forced override          |
| **rAbsMaxLimit**   | REAL      |                                             | 100.0         | Upper limit for the control signal before manual override |
| **rAbsMinLimit**   | REAL      |                                             | 0.0           | Lower limit for the control signal before manual override |
| **udiAbsTime**     | UDINT     | 10s … 600s                                  | 180s          | Duration of the anti-blocking operation in seconds        |
| **tAbsStartTime**  | TOD       | 00:00:00 - 23:59:59                         | 08:00:00      | Time of the anti-blocking operation                       |
| **eAbsDay**        | eDoW      | eDow\.Inactive, eDoW\.Monday … eDoW\.Sunday | eDoW\.Monday  | Weekday of the anti-blocking operation                    |
| **rManValue**      | REAL      |                                             | 0.0           | Manual override: manual value                             |
| **eManModeN**      | eMANNUM   | eMANNUM.Auto, eMANNUM.Man                   |               | Manual override: operating mode                           |

### Function description

#### Control signal before manual override *rAA*

The control signal before manual override *rAA* is influenced by the anti-blocking module.\
The anti-blocking module is parameterized by the setpoints/parameters *udiAbsTime*, **tAbsStartTime** and **eAbsDay** as input signal the position feedback from the control valve *rU* is used.\
The minimum change of the valve position to lock the anti-blocking function is fixed at 10.0%.\
The control signal before manual override *rAA* is limited by the two absolute limits **rAbsMinLimit** and **rAbsmaxLimit** is limited.\
The position feedback from the control valve *rU* may be replaced by the control signal from the controller *rY* if no position feedback is available.

#### Control signal after manual override *rHA*

The control signal after manual override *rHA* is influenced by the output of the anti-blocking module, the control signal from the controller *rY*, the manual override and the forced control.

| **eManModeN** | Anti-blocking process | *xForce* | **xForceOption** | *rHA*                               | Notes                                                  |
| ------------- | --------------------- | -------- | ---------------- | ----------------------------------- | ------------------------------------------------------ |
| eMANNUM.Auto  | FALSE                 | FALSE    | X                | *rY*                                | Automatic operation with passive anti-blocking process |
| eMANNUM.Auto  | TRUE                  | FALSE    | X                | Output of the anti-blocking process | Automatic operation with active anti-blocking process  |
| eMANNUM.Man   | X                     | FALSE    | X                | **rManValue**                       | Manual override                                        |
| X             | X                     | TRUE     | FALSE            | 0.0                                 | Forced override 0.0%                                   |
| X             | X                     | TRUE     | TRUE             | 100.0                               | Forced override 100.0%                                 |

Legend: X = any

#### Position monitoring

The position monitoring can be enabled (**xControl** = TRUE) or disabled (**xControl** = FALSE).\
When position monitoring is enabled, the absolute value of the difference between the control signal after manual override *rHA* and the position feedback from the control valve *rU* is determined and compared with the threshold **rControlDiff** .\
If this difference permanently exceeds the threshold during a reporting delay **udiControlTime** an alarm signal is generated, provided at the same time the feedback - automatic operation *eAO* signals automatic operation (*eAO* = HVACTYPES.eManNum.Auto).\
This alarm signal is passed to the output *xAlarmPos* ( *xAlarmPos* = TRUE).\
The alarm signal is deactivated again (*xAlarmPos* = FALSE) as soon as the difference falls below the threshold for the first time.

#### Position feedback from the control valve *rU*

The position feedback from the control valve *rU* may be replaced by the control signal from the controller *rY* if no position feedback is available.

#### Anti-blocking module

The anti-blocking module is implemented by the numerical anti-blocking module with adjustable duration (FB: AbsA).\
The duration *udiAbsTime*, the time **todAbsStartTime** and the weekday **eAbsDay** are adjustable.\
The minimum runtime to lock the anti-blocking operation is 30s.\
The timestamp (date / time) of the last anti-blocking operation *dtAbsLastOn* is available.

#### Aggregate fault *xAlarm*

The aggregate fault *xAlarm* is activated (= TRUE) if *xAlarmPos* or the input *xAlarmIn* is active.\
In all other cases the collective fault is *xAlarm* is not activated (= FALSE).

#### Collective automatic-mode message *xAuto*

The collective automatic-mode message *xAuto* is activated (= TRUE) if the input *eAO* has the value HVACTYPES.eManNum.Auto and the setpoint / parameter **eManModeN** contains the value eMANNUM.Auto.\
In all other cases the collective message is automatic operation *xAuto* is not activated (= FALSE).

#### Forced override *xForce*

The forced override acts directly on the output *rHA*. The parameter **xForceOption** determines which state the output *rHA* assumes when TRUE at the input *xForce* takes.\
\
At **xForceOption** = FALSE\
If the input *xForce* is TRUE, then the output *rHA* is set to 0.\
\
At **xForceOption** = TRUE\
If the input *xForce* is TRUE, then the output *rHA* set to 100.

### CODESYS

InOut:

| Scope       | Name              | Type    | Initial           |
| ----------- | ----------------- | ------- | ----------------- |
| Input       | `rY`              | `REAL`  |                   |
| Input       | `xForce`          | `BOOL`  | FALSE             |
| Input       | `xAlarmIn`        | `BOOL`  | FALSE             |
| Input       | `rU`              | `REAL`  | 0                 |
| Input       | `eAO`             | eManNum | eManNum.Auto      |
| Input       | `rPoti`           | `REAL`  |                   |
| Output      | `rHA`             | `REAL`  |                   |
| Output      | `rAA`             | `REAL`  |                   |
| Output      | `xAlarmPos`       | `BOOL`  |                   |
| Output      | `dtAbsLastOn`     | `DT`    |                   |
| Output      | `xAlarm`          | `BOOL`  |                   |
| Output      | `xAuto`           | `BOOL`  |                   |
| Input Const | `udiControlTime`  | `UDINT` | 200               |
| Input Const | `rControlDiff`    | `REAL`  | 7                 |
| Input Const | `xControl`        | `BOOL`  | TRUE              |
| Input Const | `xForceOption`    | `BOOL`  | TRUE              |
| Input Const | `rAbsMaxLimit`    | `REAL`  | 100               |
| Input Const | `rAbsMinLimit`    | `REAL`  | 0                 |
| Input Const | `udiAbsTime`      | `UDINT` | 180               |
| Input Const | `todAbsStartTime` | `TOD`   | TIME\_OF\_DAY#8:0 |
| Input Const | `eAbsDay`         | eDoW    | eDow\.Monday      |
| Input Const | `rManValue`       | `REAL`  | 0                 |
| Input Const | `eManModeN`       | eMANNUM | eMANNUM.Auto      |


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
