Button4 (FB)

FUNCTION_BLOCK Button4

Functional Description

Switching element with four control inputs and four switching outputs.
A total output is also available.

Portrayal

../_images/Button4_FB.png

Interfaces

Inputs

Name

Datatype

Range

Init-Value

Function

xButton1 BOOL    

Input operating key 1

xButton2 BOOL    

Input operating key 2

xButton3 BOOL    

Input operating key 3

xButton4 BOOL    

Input operating key 4

Outputs

Name

Datatype

Range

Init-Value

Function

xQ1 BOOL    

Switching output 1

xQ2 BOOL    

Switching output 2

xQ3 BOOL    

Switching output 3

xQ4 BOOL    

Switching output 4

xQ BOOL    

Overall output

Functional Description

General

The four input for the control keys is permanently monitored on rising edges (= Key operated).
The switching outputs and the overall output are set depending on the input at which
a rising edge was detected. The input xButton1 has the highest priority, the input xButton2 the second highest
priority and so on. If no rising edge is detected on one of the four inputs, then the outputs will
be unchanged.

Overall output xQ

The overall output is activated (xQ = TRUE) if one of the four switching outputs is active.
It’s not activated (xQ = FALSE) if no switching output is active
xButton1 xButton2 xButton3 xButton4 xQ1 xQ2 xQ3 xQ4

Notes

L/H X X X TRUE FALSE FALSE FALSE

Operate - Key 1

FALSE, TRUE, H/L L/H X X FALSE TRUE FALSE FALSE

Operate - Key 2

FALSE, TRUE, H/L FALSE, TRUE, H/L L/H X FALSE FALSE TRUE FALSE

Operate - Key 3

FALSE, TRUE, H/L FALSE, TRUE, H/L FALSE, TRUE, H/L L/H FALSE FALSE FALSE TRUE

Operate - Key 4

Legend: X ... not relevant, L/H ... rising edge, H/L ... falling edge

Visualization




Information

Element

Authors

Date

Version

Notes

Function

Adam Bartod 09.2016 1.0

Initial version

Programming

Adam Bartod 09.2016 1.0

Initial version

Test Jochen Reu 09.2017 1.0

Initial version

Documentation

Jochen Reu 10.2017 1.0

Initial version

Documentation

Lukas Pfänder 11.2017 0.1.3.0

Revision: Input xButtonOff is missing

Codesys

InOut:
Scope Name Type Comment
Input xButton1 BOOL

Input operating key 1

xButton2 BOOL

Input operating key 2

xButton3 BOOL

Input operating key 3

xButton4 BOOL

Input operating key 4

xButtonOff BOOL

Input off

Output xQ1 BOOL

Switching output 1

xQ2 BOOL

Switching output 2

xQ3 BOOL

Switching output 3

xQ4 BOOL

Switching output 4

xQ BOOL

Overall output