FB_BA_PID

FB_BA_PID 1:

The template is a universal PID controller.

The PID controller is enabled via the input variable bEn.

FB_BA_PID 2:

The initialization of the template takes place within the method FB_Init.

Block diagram

FB_BA_PID 3:

Syntax

FUNCTION_BLOCK FB_BA_PID EXTENDS FB_BA_View
VAR_INPUT
  bEn      : BOOL;
  fW       : REAL;
  fX       : REAL;
  bSync    : BOOL;
  fSync    : REAL;
END_VAR
VAR_OUTPUT
  fY       : REAL;
  fMax     : REAL;
  fMin     : REAL;
END_VAR
VAR_INPUT CONSTANT
  Ctrl     : FB_BA_Loop;
END_VAR

FB_BA_PID 4: Inputs

Name

Type

Description

bEn

BOOL

General enable of the template

fW

REAL

Setpoint

fX

REAL

Actual value

bSync

BOOL

A rising edge at this input triggers synchronization of the loop object to the value of fSync.

fSync

REAL

Synchronization value

FB_BA_PID 5: Outputs

Name

Type

Description

fY

REAL

Control value output

fMax

REAL

Maximum controller value

fMin

REAL

Minimum controller value

FB_BA_PID 6: Inputs CONSTANT

Name

Type

Description

Ctrl

FB_BA_Loop

PID controller

Requirements

Development environment

Necessary function

TwinCAT from v3.1.4024.35

TF8040 | TwinCAT Building Automation from V5.0.0.0