α
2
Simple Application Controllers
Function Blocks 6
6 - 55
6.26 Calculation Block
The function block creates an expression using up to four input word data (A, B, C and D)
using five operators (+, -, * , /, %) and outputs the calculation result to Y. A maximum of 64
terms can be included in the calculation expression. Nesting using parenthesis is available up
to 6 times.
Table 6.26: Calculation Function Block
Table 6.26.1: Calculation Function Block terms
Function
Set Item
Description
7
I
Input pin for multiplication function block
FB
This function block creates an expression using up to 4 input words
(A, B, C, D), 5 operators (+, /,
∗
, /, %) and outputs the calculation
result to Y. A maximum of 64 terms can be included in the calculation
expression. Nesting using parenthesis is available up to a maximum
of 6 levels.
Input values A, B, C, and D set the following values
- Constant value (Setting range:-32768 to 32767
- Analog value
- FB value
Output
1) Word Output (Y)
When the input pin is ON, Q=A
/
B, R=A%B and the word output will
be given the result. When the input pin is OFF the expression is not
executed and the Q and R values will retain the last result.
2) Bit Output
- Operation result Y<-32768: Output pin is turned ON and the
Quotient (Q) will be set to -32768.
- Operation result Y>32767: Output pin is turned ON and the
Quotient (Q) will be set to 32767.
- The divisor is 0: Output pin is turned ON and the Quotient (Q) will
be reset to 0
Term
Description
Y
Operation result
A, B, C and D
Input value
+
Calculation sign for addition
-
Calculation sign for subtraction
∗
Calculation sign for multiplication
/
Calculation sign to request the Quotient
%
Calculation sign to request the reminder
0 0
0
A
C
O
I
L
P