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

# FanAnalog

## `FanAnalog` (FB)

FUNCTION\_BLOCK FanAnalog

### Short description

> Control of a variable-speed fan\
> Additional functions: manual overrides, repair switch, operating hours counter, air shortage\
> Typical application: controlling a fan with a frequency converter

### Representation

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

### Interfaces

#### Inputs

| Name       | Data type         | Value range                                                               | Initial value          | Function                                                                               |
| ---------- | ----------------- | ------------------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------- |
| *xEn*      | BOOL              |                                                                           |                        | Fan request (FALSE = Off, TRUE = On)                                                   |
| *rY*       | REAL              |                                                                           |                        | Control signal - speed 0.0 - 100.0 %                                                   |
| *xForce*   | BOOL              |                                                                           | FALSE                  | Forced lockout of the fan after manual override (FALSE = Off, TRUE = On)               |
| *xFb*      | BOOL              |                                                                           |                        | Operating message of the fan (FALSE = Off, TRUE = On)                                  |
| *xPFb*     | BOOL              |                                                                           |                        | Feedback of the air shortage monitoring (FALSE = air shortage, TRUE = no air shortage) |
| *xMSwitch* | BOOL              |                                                                           | TRUE                   | Feedback of the repair switch (FALSE = switch Off, TRUE = switch On)                   |
| *xAlarmIn* | BOOL              |                                                                           |                        | Fault message of the fan (FALSE = Off, TRUE = On)                                      |
| *eAOO*     | HVACTYPES.eManBin | HVACTYPES.eManBin.Auto, HVACTYPES.eManBin.ManOff, HVACTYPES.eManBin.ManOn | HVACTYPES.eManBin.Auto | Operating mode of the manual override - hardware for enable                            |
| *eAO*      | HVACTYPES.eManNum | HVACTYPES.eManNum.Auto, HVACTYPES.eManNum.Man                             | HVACTYPES.eManNum.Auto | Operating mode of the manual override - hardware for the control signal                |
| *rPoti*    | REAL              |                                                                           |                        | Manual value - manual override - hardware for the control signal                       |
| *rU*       | REAL              |                                                                           |                        | Feedback signal from the fan in %                                                      |
| *xQuit*    | BOOL              |                                                                           | FALSE                  | Reset of fault messages (monitors) (FALSE = Off, TRUE = On)                            |

#### Outputs

| Name                | Data type       | Value range | Initial value | Function                                                                               |
| ------------------- | --------------- | ----------- | ------------- | -------------------------------------------------------------------------------------- |
| *xHB*               | BOOL            |             |               | Enable - fan after manual override (FALSE = Off, TRUE = On)                            |
| *xAB*               | BOOL            |             |               | Enable - fan before manual override (FALSE = Off, TRUE = On)                           |
| *rHA*               | REAL            |             |               | Control signal - fan after manual override in %                                        |
| *rAA*               | REAL            |             |               | Control signal - fan before manual override in %                                       |
| *xAlarmFb*          | BOOL            |             |               | Fault message of the operating monitoring (FALSE = Off, TRUE = On)                     |
| *xAlarmPFb*         | BOOL            |             |               | Fault message of the air shortage monitoring (FALSE = Off, TRUE = On)                  |
| *dtLastFb*          | DATE\_AND\_TIME |             |               | Date / time of the fan's last operation                                                |
| *udiOperatingHours* | UDINT           |             |               | Operating hours of the fan                                                             |
| *udiCountFb*        | UDINT           |             |               | Number of fan switch-ons                                                               |
| *xAlarm*            | BOOL            |             |               | Collective fault message (FALSE = Off, TRUE = On)                                      |
| *xAuto*             | BOOL            |             |               | Collective message - automatic mode (FALSE = no automatic mode, TRUE = automatic mode) |

#### Setpoints / Parameters

| Name                  | Data type | Value range                                 | Initial value | Function                                                                     |
| --------------------- | --------- | ------------------------------------------- | ------------- | ---------------------------------------------------------------------------- |
| **udiPFbControlTime** | UDINT     | 0 … 3600s                                   | 60s           | Message delay of the air shortage monitoring in s                            |
| **xPFbControl**       | BOOL      |                                             | TRUE          | Enable / block of the air shortage monitoring (FALSE = block, TRUE = enable) |
| **xAlarmControl**     | BOOL      |                                             | TRUE          | Influence of *xAlarm* on *xAB* (FALSE = no influence, TRUE = block)          |
| **udiFbControlTime**  | UDINT     | 0 … 300s                                    | 60s           | Message delay of the operating monitoring in s                               |
| **xFbControl**        | BOOL      |                                             | TRUE          | Enable / block of the operating monitoring (FALSE = block, TRUE = enable)    |
| **rManValue**         | REAL      |                                             |               | Control signal in manual mode in %                                           |
| **eManModeN**         | eManNum   | eManNum.Auto, eManNum.man                   | eManNum.Auto  | Operating mode of the manual override for the control signal *rHA*           |
| **eManModeB**         | eMANBIN   | eMANBIN.Auto, eMANBIN.ManOff, eMANBIN.ManOn | eMANBIN.Auto  | Operating mode of the manual override for the digital output *xHB*           |

### Functional description

#### General

This function block controls a variable-speed fan by means of a continuous control signal *rHA*, which in automatic mode (**eManModeN** = eManNum.Auto) is taken unchanged from the input *rY* .\
The general enable of the fan is via the request *xEn*  and the enable signal *xHB*.\
The following function blocks are essentially used:

* ManBin
* ManNum
* AirShortage
* CTime
* OperatingHours

#### Enable - fan before manual override *xAB*

The enable - fan before manual override *xAB* is activated (= TRUE) if the following conditions are met at the same time:\
\
Case 1:\
\
*xEn* = TRUE\
*xMSwitch* = TRUE\
**xAlarmControl** = FALSE\
\
Case 2:\
\
*xEn* = TRUE\
*xMSwitch* = TRUE\
**xAlarmControl** = TRUE\
*xAlarm* = FALSE\
\
In all other situations, the enable - fan before manual override *xAB* is not activated (= FALSE).

#### Enable - fan after manual override *xHB*

The enable - fan after manual override *xHB* corresponds to the enable - fan before manual override *xAB*, additionally extended by a manual override module.\
The enable can generally only be given if the forced lockout of the fan after manual override is not active (*xForce* = FALSE)\
and the collective fault message is not active (*xAlarm* = FALSE).

| *xAB* | **eManModeB**  | *xHB* | Notes                                     |
| ----- | -------------- | ----- | ----------------------------------------- |
| FALSE | eMANBIN.Auto   | FALSE | Manual override module in automatic mode  |
| TRUE  | eMANBIN.Auto   | TRUE  | Manual override module in automatic mode  |
| X     | eMANBIN.ManOn  | TRUE  | Manual override module in manual mode On  |
| X     | eMANBIN.ManOff | FALSE | Manual override module in manual mode Off |

Legend: X = any

#### Maintenance switch message *xMSwitch*

*xMSwitch* = TRUE: repair switch has not been triggered (normal state)\
*xMSwitch* = FALSE: maintenance switch has tripped (fault state)

#### Forced lockout of the fan after manual override *xForce*

*xForce* = FALSE: no forced lockout (normal state)\
*xForce* = TRUE: forced lockout (exception state)

#### Operating hours and switch-on cycles

The number of operating hours and switch-on cycles are recorded (= counting process active) if the fan operating signal *xFb* is active and at the same time the collective fault message *xAlarm* is not active (= FALSE).\
The results are available at the counter outputs **udiOperatingHours** and **udiCountFb** .

> **Write access to the counter values**
>
> Via the path ‘InstanceName.\_OperatingHours.udiOperatingHours’ or ‘InstanceName.\_OperatingHours.udiCountFb’, write access to both counter values is possible.
>
> **Prerequisite for using the function block FanAnalog**
>
> For correct operation, the use of the TimeRead2 function block is required.

#### Date / time of the fan's last operation *dtLastFb*

At output *dtLastFb* the current date / current time is available during the counting process.\
At output *dtLastFb* the date / time at the end of the last counting process is available outside the counting process.\
At output *dtLastFb* the initialization value DT#1970-1-1-0.0.0 is output before the first counting process.

#### Operating supervision

The operating monitoring can be enabled or disabled by the setpoint / parameter **xFbControl** (= TRUE) or blocked (= FALSE).\
\
When monitoring is blocked, the fault message of the operating monitoring *xAlarmFb* is always blocked (= FALSE).\
When monitoring is enabled, the fault message of the operating monitoring *xAlarmFb* is activated (= TRUE) if the following states are present simultaneously during a minimum time period **udiFbControlTime** the following states are given:\
\
*xHB* and *xFb* = unequal (enable state and operating state do not match)\
*eAOO* = HVACTYPES.eManBin.Auto (manual override - hardware for enable in automatic mode)\
**xFbControl** = TRUE (operating monitoring is enabled)\
\
The fault message of the operating monitoring *xAlarmFb* is reset (= FALSE) if at least one of the following conditions is met:\
\
*eAOO* = HVACTYPES.eManBin.Auto (switching back to automatic mode of the manual override - hardware)\
*xQuit* = TRUE (reset of the monitors is active)\
**xFbControl** = FALSE (operating monitoring blocked)

#### Air shortage monitoring

The air shortage monitoring is carried out by evaluating the states at the inputs *xPFb* or *xFb*.\
\
The fault message of the air shortage monitoring *xAlarmPFb* is activated (= TRUE) if, with monitoring enabled (**xPFbControl** = TRUE) during the message delay of the air shortage monitoring **udiPFbControlTime** the input *xPFb* is permanently not active (= FALSE) and the\
input *xFb* is active (= TRUE).\
\
The fault message of the air shortage monitoring *xAlarmPFb* is deactivated (= FALSE) if the conditions for activation are no longer met and at the same time the monitoring is blocked (**xPFbControl** = FALSE) and / or the reset of the fault messages (monitors) active (*xQuit* = TRUE).

#### Collective fault message *xAlarm*

The collective fault message is activated (= TRUE) if at least one of the conditions described below is met.\
\
*xAlarmIn* = TRUE (fault message of the fan is active)\
*xAlarmFB* = TRUE (fault from the operating monitoring)\
*xAlarmPFB* = TRUE (fault from the air shortage monitoring)\
*xMSwitch* = FALSE (repair switch in Off position)\
\
In all other cases, the collective fault is not active (= FALSE).

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

The control signal of the fan before manual override *rAA* is taken unchanged from the input control signal - speed *rY*  if either the output *xHB*  and / or the input *xFb*  are active.\
In all other situations the control signal *rAA* is fixed to the value 0.0 %.

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

The actuating signal of the damper actuator after manual override *rHA* corresponds to the control signal of the fan before manual override *rAA* additionally extended by a manual override module.

| *rAA* | **eManModeN** | *rHA*         | Notes                                    |
| ----- | ------------- | ------------- | ---------------------------------------- |
| X     | eMANNUM.Auto  | *rAA*         | Manual override module in automatic mode |
| X     | eMANNUM.Man   | **rManValue** | Manual override module in manual mode    |

Legend: X = any

#### Collective automatic operation message *xAuto*

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

* Input *eAOO* = HVACTYPES.eManBin.Auto
* Input *eAO* = HVACTYPES.eManNum.Auto
* Setpoint / parameter **eManModeB** = eMANBIN.Auto
* Setpoint / parameter **eManModeN** = eMANNUM.Auto

### CODESYS

InOut:

| Scope       | Name                | Type    | Initial      |
| ----------- | ------------------- | ------- | ------------ |
| Input       | `xEn`               | `BOOL`  |              |
| Input       | `rY`                | `REAL`  |              |
| Input       | `xForce`            | `BOOL`  | FALSE        |
| Input       | `xFb`               | `BOOL`  |              |
| Input       | `xPFb`              | `BOOL`  |              |
| Input       | `xMSwitch`          | `BOOL`  | TRUE         |
| Input       | `xAlarmIn`          | `BOOL`  |              |
| Input       | `eAOO`              | eManBin | eManBin.Auto |
| Input       | `eAO`               | eManNum | eManNum.Auto |
| Input       | `rPoti`             | `REAL`  |              |
| Input       | `rU`                | `REAL`  |              |
| Input       | `xQuit`             | `BOOL`  | FALSE        |
| Output      | `xHB`               | `BOOL`  |              |
| Output      | `xAB`               | `BOOL`  |              |
| Output      | `rHA`               | `REAL`  |              |
| Output      | `rAA`               | `REAL`  |              |
| Output      | `xAlarmFb`          | `BOOL`  |              |
| Output      | `xAlarmPFb`         | `BOOL`  |              |
| Output      | `dtLastFb`          | `DT`    |              |
| Output      | `udiOperatingHours` | `UDINT` |              |
| Output      | `udiCountFb`        | `UDINT` |              |
| Output      | `xAlarm`            | `BOOL`  |              |
| Output      | `xAuto`             | `BOOL`  |              |
| Input Const | `udiPFbControlTime` | `UDINT` | 60           |
| Input Const | `xPFbControl`       | `BOOL`  | TRUE         |
| Input Const | `xAlarmControl`     | `BOOL`  | TRUE         |
| Input Const | `udiFbControlTime`  | `UDINT` | 60           |
| Input Const | `xFbControl`        | `BOOL`  | TRUE         |
| Input Const | `rManValue`         | `REAL`  |              |
| Input Const | `eManModeN`         | eMANNUM | eMANNUM.Auto |
| Input Const | `eManModeB`         | eMANBIN | eMANBIN.Auto |

Methods:

> mQuit

> mResetOperatingHours

Structure:

* mQuit (Method)
* mResetOperatingHours (Method)


---

# 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/components/fananalog.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.
