FB_BA_ProjectEx

FB_BA_ProjectEx 1:

This template is derived from the basic function block FB_BA_Project.

It provides the project version number for information purposes and ensures that persistent data is saved.

The writing of persistent data has 2 modes:

Commissioning is complete and the system is running.

The persistent data is written at a fixed interval tPrsData_DefaultPeriod, pre-set to 30 minutes. This protects the memory card. Parameterizing tPrsData_DefaultPeriod below 10 minutes resets this value to 30 minutes as a precaution.

By automatically detecting an online change, the system switches to commissioning mode and the persistent data is now saved at shorter intervals. The interval tPrsData_ComissioningPeriod, which is pre-set to 10 minutes, applies here. Parameterizing tPrsData_ComissioningPeriod below 30 seconds resets this value to 5 minutes as a precaution.

If no online change is detected after a fixed DETECT_COMISSIONING_DURATION time of 60 minutes, the routine returns to normal operation.

Syntax

FUNCTION_BLOCK FB_BA_ProjectEx EXTENDS FB_BA_Project
VAR_INPUT CONSTANT PERSISTENT
  tPrsData_DefaultPeriod         : TIME := T#30M;
  tPrsData_ComissioningPeriod    : TIME := T#10M;
END_VAR
VAR_INPUT CONSTANT
  bPrsData_ManualWriteData       : BOOL;
END_VAR
VAR_INPUT
  bWrtPrsOnPowerFail             : BOOL;
END_VAR
VAR_OUTPUT
  nPrsDataWritten                : UINT;
END_VAR

FB_BA_ProjectEx 2: Inputs CONSTANT PERSITENT

Name

Type

Description

tPrsData_DefaultPeriod

TIME

Storage interval in normal state.

tPrsData_ComissioningPeriod

TIME

Storage interval in commissioning state.

FB_BA_ProjectEx 3: Inputs CONSTANT

Name

Type

Description

bPrsData_ManualWriteData

BOOL

This variable can be set to TRUE for commissioning purposes. This triggers a one-time saving of the persistent variables.

FB_BA_ProjectEx 4: Inputs

Name

Type

Description

bWrtPrsOnPowerFail

BOOL

Input variable for linking with a UPS function block

FB_BA_ProjectEx 5: Outputs

Name

Type

Description

nPrsDataWritten

UINT

Counter output for the executed write cycles.

Requirements

Development environment

Necessary function

TwinCAT from v3.1.4024.62

TF8040 | TwinCAT Building Automation from V5.9.0.0