FB_BA_Cont4Stp01

FB_BA_Cont4Stp01 1:

The function block FB_BA_Cont4Stp01 determines the resulting control steps of a multi-stage aggregate depending on the input signal.
Four switch-on thresholds and four hystereses can be parameterized.

Diagram 01

Control direction of parameter bActn = FALSE = Reverse = Heating

FB_BA_Cont4Stp01 2:


nStp

nNumOfStp

fSwiOn

fSwiOff

nRemTiDlyOn

nRemTiDlyOff

bQ01

bQ02

bQ03

bQ04

0

0

fSwiOn01

fSwiOn01 - fHys01

nDlyOn01

0

FALSE

FALSE

FALSE

FALSE

1

>= 1

fSwiOn02

fSwiOn01 - fHys01

nDlyOn02

nDlyOff01

TRUE

FALSE

FALSE

FALSE

2

>= 2

fSwiOn03

fSwiOn02 - fHys02

nDlyOn03

nDlyOff02

TRUE

TRUE

FALSE

FALSE

3

>= 3

fSwiOn04

fSwiOn03 - fHys03

nDlyOn04

nDlyOff03

TRUE

TRUE

TRUE

FALSE

4

>= 4

fSwiOn04

fSwiOn04 - fHys04

0

nDlyOff04

TRUE

TRUE

TRUE

TRUE

Diagram 02

Control direction parameter bActn = TRUE = Direct = Cooling

FB_BA_Cont4Stp01 3:

nStp

nNumOfStp

fSwiOn

fSwiOff

nRemTiDlyOn

nRemTiDlyOff

bQ01

bQ02

bQ03

bQ04

0

0

fSwiOn01

fSwiOn01 + fHys01

nDlyOn01

0

FALSE

FALSE

FALSE

FALSE

1

>= 1

fSwiOn02

fSwiOn01 + fHys01

nDlyOn02

nDlyOff01

TRUE

FALSE

FALSE

FALSE

2

>= 2

fSwiOn03

fSwiOn02 + fHys02

nDlyOn03

nDlyOff02

TRUE

TRUE

FALSE

FALSE

3

>= 3

fSwiOn04

fSwiOn03 + fHys03

nDlyOn04

nDlyOff03

TRUE

TRUE

TRUE

FALSE

4

4

fSwiOn04

fSwiOn04 + fHys04

0

nDlyOff04

TRUE

TRUE

TRUE

TRUE

Diagram 03

Timing of the switch-on and switch-off delays

At time t1 fIn jumps from fSwiOn01 to fSwiOn04

At time t2 fIn jumps from fSwiOn04 to fSwiOn01 - fHys01

FB_BA_Cont4Stp01 4:

FB_BA_Cont4Stp01 5: Inputs

VAR_INPUT
  bEn             : BOOL;
  fIn             : REAL;
  fSwiOn01        : REAL
  fHys01          : REAL;
  nDlyOn01        : UDINT;
  nDlyOff01       : UDINT;
  fSwiOn02        : REAL;
  fHys02          : REAL;
  nDlyOn02        : UDINT;
  nDlyOff02       : UDINT;
  fSwiOn03        : REAL;
  fHys03          : REAL;
  nDlyOn03        : UDINT;
  nDlyOff03       : UDINT;
  fSwiOn04        : REAL;
  fHys04          : REAL;
  nDlyOn04        : UDINT;
  nDlyOff04       : UDINT;
  nNumOfStp       : UDINT;
  bActn           : BOOL;
END_VAR

Name

Type

Description

bEn

BOOL

General enable of the function block. If bEn is FALSE, all outputs are set to 0.

fIn

REAL

Input value, from which the switching state is derived.

fSwiOn01

REAL

Switch-on point step 01

fHys01

REAL

Absolute value hysteresis step 01

nDlyOn01

UDINT

Start-up delay step 01

nDlyOff01

UDINT

Switch-off delay step 01

fSwiOn02

REAL

Switch-on point step 02

fHys02

REAL

Absolute value hysteresis step 02

nDlyOn02

UDINT

Start-up delay step 02

nDlyOff02

UDINT

Switch-off delay step 02

fSwiOn03

REAL

Switch-on point step 03

fHys03

REAL

Absolute value hysteresis step 03

nDlyOn03

UDINT

Start-up delay step 03

nDlyOff03

UDINT

Switch-off delay step 03

fSwiOn04

REAL

Switch-on point step 04

fHys04

REAL

Absolute value hysteresis step 04

nDlyOn04

UDINT

Start-up delay step 04

nDlyOff04

UDINT

Switch-off delay step 04

nNumOfStp

UDINT

Input of the number of steps required.
The input is limited from 0 to 4.

bActn

BOOL

Input variable with which the control direction of the step switch is determined.
TRUE = Direct = Cooling; FALSE = Reverse = Heating

FB_BA_Cont4Stp01 6: Outputs

VAR_OUTPUT
  bQ01               : BOOL;
  bQ02               : BOOL;
  bQ03               : BOOL;
  bQ04               : BOOL;
  nStp               : UDINT;
  fSwiOn             : REAL;
  fSwiOff            : REAL;
  nRemTiDlyOn        : UDINT;
  nRemTiDlyOff       : UDINT;
END_VAR

Name

Type

Description

bQ01

BOOL

Display of status step 01
TRUE = ON; FALSE = OFF
nStp >= 1

bQ02

BOOL

Display of status step 02
TRUE = ON; FALSE = OFF
nStp >= 2

bQ03

BOOL

Display of status step 03
TRUE = ON; FALSE = OFF
nStp >= 3

bQ04

BOOL

Display of status step 04
TRUE = ON; FALSE = OFF
nStp >= 4

nStp

UDINT

Shows the current step of the step switch

fSwiOn

REAL

Shows the next switch-on point

fSwiOff

REAL

Shows the next switch-off point

nRemTiDlyOn

UDINT

If the switch-on point for switching to the next level is met, the progress of the switch-on delay time is displayed here.

nRemTiDlyOff

UDINT

If the switch-off point for switching down to the next level is met, the progress of the switch-off delay time is displayed here.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.22

Tc3_BA2 from v5.2.5.0