FUNCTION_BLOCK CALC5

Hover on a highlighted element
to pop up its description (if any).

ECC

An instance of this Function Block type implements a 5-button calculator.

Its operation is defined by the Execution Control Chart (ECC) shown above and the algorithms listed below.

See CALC5TS for a simplified implementation.

ALGORITHM RESET IN ST : OUT := 0.0; END_ALGORITHM
			
ALGORITHM ADD IN ST : OUT := OUT + IN; END_ALGORITHM

ALGORITHM SUB IN ST : OUT := OUT - IN; END_ALGORITHM

ALGORITHM MUL IN ST : OUT := OUT * IN; END_ALGORITHM

ALGORITHM DIV IN ST : OUT := OUT / IN; END_ALGORITHM