Redundance8

Redundance8 (FB)

FUNCTION_BLOCK Redundance8

Short description

Redundant control of 0 - 8 identical devices Influencing factors: requirements, operating hours, operating and fault states Typical application: determination of lead and follower devices

Representation

Interfaces

Inputs

Name
Data type
Value range
Initial value
Function

wTotalNumberOfDevices

WORD

2

Total number of devices ( 0 - cwMaxMumberOfDevices )

wActiveNumberOfDevices

WORD

0

Number of active devices ( 0 - wTotalNumberOfDevices )

xFb1

BOOL

FALSE

Running - device 1 ( TRUE = running )

xFb2

BOOL

FALSE

Running - device 2 ( TRUE = running )

xFb3

BOOL

FALSE

Running - device 3 ( TRUE = running )

xFb4

BOOL

FALSE

Running - device 4 ( TRUE = running )

xFb5

BOOL

FALSE

Running - device 5 ( TRUE = running )

xFb6

BOOL

FALSE

Running - device 6 ( TRUE = running )

xFb7

BOOL

FALSE

Running - device 7 ( TRUE = running )

xFb8

BOOL

FALSE

Running - device 8 ( TRUE = running )

xAlarm1

BOOL

TRUE

Fault - device 1 ( TRUE = fault )

xAlarm2

BOOL

TRUE

Fault - device 2 ( TRUE = fault )

xAlarm3

BOOL

TRUE

Fault - device 3 ( TRUE = fault )

xAlarm4

BOOL

TRUE

Fault - device 4 ( TRUE = fault )

xAlarm5

BOOL

TRUE

Fault - device 5 ( TRUE = fault )

xAlarm6

BOOL

TRUE

Fault - device 6 ( TRUE = fault )

xAlarm7

BOOL

TRUE

Fault - device 7 ( TRUE = fault )

xAlarm8

BOOL

TRUE

Fault - device 8 ( TRUE = fault )

uiOperatingHours1

UDINT

0

Operating hours - device 1

uiOperatingHours2

UDINT

0

Operating hours - device 2

uiOperatingHours3

UDINT

0

Operating hours - device 3

uiOperatingHours4

UDINT

0

Operating hours - device 4

uiOperatingHours5

UDINT

0

Operating hours - device 5

uiOperatingHours6

UDINT

0

Operating hours - device 6

uiOperatingHours7

UDINT

0

Operating hours - device 7

uiOperatingHours8

UDINT

0

Operating hours - device 8

xUpdate

BOOL

Trigger recalculation of the sequence on every rising edge

Outputs

Name
Data type
Value range
Initial value
Function

udiCurrentSequence

UDINT

0

Current device sequence as integer

sCurrentSequence

STRING

‘’

Current device sequence as string

wNumberOfOperationalDevices

WORD

0

Number of operational-ready devices

xCmd1

BOOL

FALSE

Enable - device 1 ( TRUE = enable )

xCmd2

BOOL

FALSE

Enable - device 2 ( TRUE = enable )

xCmd3

BOOL

FALSE

Enable - device 3 ( TRUE = enable )

xCmd4

BOOL

FALSE

Enable - device 4 ( TRUE = enable )

xCmd5

BOOL

FALSE

Enable - device 5 ( TRUE = enable )

xCmd6

BOOL

FALSE

Enable - device 6 ( TRUE = enable )

xCmd7

BOOL

FALSE

Enable - device 7 ( TRUE = enable )

xCmd8

BOOL

FALSE

Enable - device 8 ( TRUE = enable )

wPrio1

WORD

0

Current priority of device 1 ( 0 = none, 1 - wTotalNumberOfDevices )

wPrio2

WORD

0

Current priority of device 2 ( 0 = none, 1 - wTotalNumberOfDevices )

wPrio3

WORD

0

Current priority of device 3 ( 0 = none, 1 - wTotalNumberOfDevices )

wPrio4

WORD

0

Current priority of device 4 ( 0 = none, 1 - wTotalNumberOfDevices )

wPrio5

WORD

0

Current priority of device 5 ( 0 = none, 1 - wTotalNumberOfDevices )

wPrio6

WORD

0

Current priority of device 6 ( 0 = none, 1 - wTotalNumberOfDevices )

wPrio7

WORD

0

Current priority of device 7 ( 0 = none, 1 - wTotalNumberOfDevices )

wPrio8

WORD

0

Current priority of device 8 ( 0 = none, 1 - wTotalNumberOfDevices )

xErr

BOOL

FALSE

Output - fault

eOperationalCondition

eRedundance3_OperationalMode

Number / name of the current operating condition

Setpoints / parameters

Name
Data type
Value range
Initial value
Function

xConOperatingHours

BOOL

TRUE

FALSE = follower switching only allowed via input xUpdate, TRUE = follower switching automatic after operating hours

xEnFb

BOOL

TRUE

FALSE = switching based on enable ( xCmdX ), TRUE = switching based on running signal ( xFbX )

wTolerance

WORD

100

Threshold - operating hours difference for direct follower change in partial load operation

Function description

General

This function block is used for redundant control of 0 - 8 identical devices depending on the influencing variables requirements ( wActiveNumberOfDevices ), operating hours ( uiOperatingHours ), operating states ( xFb ) and fault states ( xAlarm ).\

Input wTotalNumberOfDevices

This input is used to set the total number of usable devices. Devices are assigned consecutively starting from the lowest device numbers. Example: wTotalNumberOfDevices = 3: Devices 1 - 3 ( inputs and outputs ) are used / considered. Allowed range: 0 - cwMaxNumberOfDevices\

Input wActiveNumberOfDevices

This input is used to set the number of devices that should currently be used. Allowed range: 0 - wTotalNumberOfDevices\

Input xUpdate

Each rising edge on this input triggers a recalculation of the current device sequence. Boundary conditions: xConOperationHours = FALSE, operating hours difference = 0 hours.\

Output udiCurrentSequence

This output always shows the current device sequence as an integer. The number of the device with the highest priority is always at the beginning, then follows the number of the device with the second highest priority, etc. Example: udiCurrentSequence = 145 means: device 1 = priority 1, device 4 = priority 2 and device 5 = priority 3\

Output sCurrentSequence

This output always shows the current device sequence as a string with separators. The same priority rules apply as for the output udiCurrentSequence. Example: sdiCurrentSequence = ‘1-4-5’ means: device 1 = priority 1, device 4 = priority 2 and device 5 = priority 3\

Output wNumberOfOperationalDevices

This output always shows the number of operational-ready devices.\

Output fault xErr

This output is active ( = TRUE ) if at least one of the following conditions is met.\

  1. wActiveNumberOfDevices > wTotalNumberOfDevices\

  2. wTotalNumberOfDevices > cwMaxNumberOfDevices\

  3. wActiveNumberOfDevices > wOperationalNumberofDevices\

In all other cases the output *xErr* is not active ( = FALSE ).\

Output eOperationalCondition

This output always represents the current load situation ( idle, partial load, full load ) depending on the setpoint / parameter xEnFb thereof. xEnFb = FALSE: The enable outputs xCmd of the operational-ready devices are evaluated / considered. xEnFb = TRUE: The running states xFb of the operational-ready devices are evaluated / considered. Example: xEnFb = TRUE, wTotalNumberOfDevices = 3 and xFb1 = TRUE and xFb2 = TRUE: Output = PartLoad_Inputs_Fb\

Setpoint / parameter xConOperatingHours

xConOperatingHours = FALSE: Switching of the device sequence is only triggered by a rising edge on input xUpdate triggered. xConOperatingHours = TRUE: Switching of the device sequence is triggered depending on operating hours, running signals ( when xEnFb = TRUE ) and the enables ( when xEnFb = FALSE ) is triggered.\

Setpoint / parameter xEnFb

xEnFb = FALSE: The enable outputs ‘xCmd’ of the operational-ready devices are evaluated / considered. xEnFb = TRUE: The running states ‘xFb’ of the operational-ready devices are evaluated / considered.\

Setpoint / parameter wTolerance

This setpoint determines the maximum operating hours difference before switching the device sequence due to operating hours. \

Determination of the device sequence

A switch of the device sequence can generally only occur if at least one of the following conditions is met: \

  1. The fault state of at least one device ( devices 1 - wTotalNumberOfDevices ) has changed ( high priority )\

  2. The total number of devices ( input wTotalNumberOfDevices ) ( 1 - cwMaxNumberOfDevices ) has changed ( high priority )\

  3. The operating hours count of at least one operational-ready device ( devices 1 - wTotalNumberOfDevices ) has changed ( low priority )\

Definition - Idle: **xEnFb** = FALSE: The enable outputs ‘xCmd’ of all ready-for-operation devices ( devices 1 - *wTotalNumberOfDevices* ) are inactive ( = FALSE ) **xEnFb** = TRUE: The running-status signals ‘xFb’ of all ready-for-operation devices ( devices 1 - *wTotalNumberOfDevices* ) are inactive ( = FALSE ) Definition - Full load: **xEnFb** = FALSE: The enable outputs ‘xCmd’ of all ready-for-operation devices ( devices 1 - *wTotalNumberOfDevices* ) are active ( = TRUE ) **xEnFb** = TRUE: The running-status signals ‘xFb’ of all ready-for-operation devices ( devices 1 - *wTotalNumberOfDevices* ) are active ( = TRUE ) Definition - Partial load: **xEnFb** = FALSE: The number of enable outputs *xCmd* of all ready-for-operation devices in the active state ( = TRUE ) is greater than or equal to 1 and less than the number of all ready-for-operation devices ( devices 1 - *wTotalNumberOfDevices* ) **xEnFb** = FALSE: The number of running-status signals *xFb* of all ready-for-operation devices in the active state ( = TRUE ) is greater than or equal to 1 and less than the number of all ready-for-operation devices ( devices 1 - *wTotalNumberOfDevices* ) Switching with **high** priority ( = immediate ) depending on the fault states ( inputs *xAlarm* ) and the input

*

wTotalNumberOfDevices’ The fault state of each device in the range 1 - wTotalNumberOfDevices is recorded cyclically and evaluated for changes. The input wTotalNumberOfDevices is recorded cyclically and evaluated for changes. Each faulty device ( input xAlarm = TRUE ) in the range 1 - wTotalNumberOfDevices is no longer operational-ready. Any change in the fault state of at least one device in the range 1 - wTotalNumberOfDevices triggers an immediate recalculation of the device sequence. Any change on the input wTotalNumberOfDevices triggers an immediate recalculation of the device sequence. Switching with lower priority depending on operating hours ( inputs udiOperationHours ), operating states ( inputs xFb ) and enable outputs ( outputs xCmd ) of devices 1 - 3. The operating hours of each operational-ready device in the range 1 - wTotalNumberOfDevices are recorded cyclically and evaluated for changes. The operating states and enable outputs of each operational-ready device in the range 1 - wTotalNumberOfDevices are recorded cyclically. The recalculation of the device sequence takes place as soon as one of the situations described below applies: Situation 1 ( xConOperationHours = FALSE, rising edge on input xUpdate ) A recalculation of the device sequence is performed with an operating hours difference of 0 hours, i.e. the non-faulty device with the lowest operating hours has the highest priority ( in case of equal operating hours the device with the lower number has the higher priority ). Situation 2 ( xConOperationHours = TRUE, idle or full load ) In idle or under full load a recalculation of the device sequence is performed with an operating hours difference of 0 hours, i.e. the non-faulty device with the lowest operating hours has the highest priority ( in case of equal operating hours the device with the lower number has the higher priority ). The recalculation of the device sequence is triggered if the operating hours of at least one operational-ready device have changed. Situation 3 ( xConOperationHours = TRUE, partial load ) On the first transition to partial load operation a recalculation of the device sequence is performed with an operating hours difference of 0 hours, i.e. the non-faulty device with the lowest operating hours has the highest priority ( in case of equal operating hours the device with the lower number has the higher priority ). In regular partial load operation a recalculation of the device sequence is performed with an operating hours difference of wTolerance hours. The recalculation of the device sequence is triggered if the operating hours of at least one operational-ready device have changed. \

Enable outputs <br/>*<br/> xCmd’

The states of the outputs of the devices in the range 1 - *wTotalNumberOfDevices* are finally determined as follows: The enable outputs of the operational-ready devices in the range 1 - *wTotalNumberOfDevices* are activated if their current priority <= the number of requested devices ( input *wActiveNumberOfDevices* ). The enable outputs of the operational-ready devices in the range 1 - *wTotalNumberOfDevices* are deactivated if their current priority > the number of requested devices ( input *wActiveNumberOfDevices* ). \

Priority outputs wPrio

The priority outputs of each device always contain the current priority in the range 0 - *wTotalNumberOfDevices*. Priority = 0: The device has no or an invalid priority Priority = 1: The device has the highest priority Priority = 2: The device has the second highest priority Priority = 3: The device has the third highest priority etc.\

CODESYS

InOut:

Scope
Name
Type
Initial

Input

wTotalNumberOfDevices

WORD

2

Input

wActiveNumberOfDevices

WORD

0

Input

xFb1

BOOL

FALSE

Input

xFb2

BOOL

FALSE

Input

xFb3

BOOL

FALSE

Input

xFb4

BOOL

FALSE

Input

xFb5

BOOL

FALSE

Input

xFb6

BOOL

FALSE

Input

xFb7

BOOL

FALSE

Input

xFb8

BOOL

FALSE

Input

xAlarm1

BOOL

TRUE

Input

xAlarm2

BOOL

TRUE

Input

xAlarm3

BOOL

TRUE

Input

xAlarm4

BOOL

TRUE

Input

xAlarm5

BOOL

TRUE

Input

xAlarm6

BOOL

TRUE

Input

xAlarm7

BOOL

TRUE

Input

xAlarm8

BOOL

TRUE

Input

udiOperatingHours1

UDINT

0

Input

udiOperatingHours2

UDINT

0

Input

udiOperatingHours3

UDINT

0

Input

udiOperatingHours4

UDINT

0

Input

udiOperatingHours5

UDINT

0

Input

udiOperatingHours6

UDINT

0

Input

udiOperatingHours7

UDINT

0

Input

udiOperatingHours8

UDINT

0

Input

xUpdate

BOOL

Input Const

xConOperatingHours

BOOL

TRUE

Input Const

xEnFb

BOOL

TRUE

Input Const

wTolerance

WORD

100

Output

udiCurrentSequence

UDINT

0

Output

sCurrentSequence

STRING

‘’

Output

wNumberOfOperationalDevices

WORD

0

Output

xCmd1

BOOL

FALSE

Output

xCmd2

BOOL

FALSE

Output

xCmd3

BOOL

FALSE

Output

xCmd4

BOOL

FALSE

Output

xCmd5

BOOL

FALSE

Output

xCmd6

BOOL

FALSE

Output

xCmd7

BOOL

FALSE

Output

xCmd8

BOOL

FALSE

Output

wPrio1

WORD

0

Output

wPrio2

WORD

0

Output

wPrio3

WORD

0

Output

wPrio4

WORD

0

Output

wPrio5

WORD

0

Output

wPrio6

WORD

0

Output

wPrio7

WORD

0

Output

wPrio8

WORD

0

Output

xErr

BOOL

FALSE

Output

eOperationalCondition

eRedundance3_OperationalMode

Last updated