L9P_CALC: Calculated Preset Formula
(Original Document)
Naming
Name in LL984 Editor
Function Block Name
name of legacy 984 instruction
name in other tools and editors like:
  • Type Library Browser
  • Data Editor
  • Animation Tables
  • Search Results
Function Description
The L9P_CALC DFB calculates a preset formula with up to 4 inputs, each characterized in a separate word of the parameter PAR.
Representation
Parameters
Input Pin
Name
Data Type
Address Range
Meaning
Top
ENABLE
ON = enables process control function
Node
Node Type
Name
Data Type
Address Range
Meaning
Middle
IN/OUT
PAR
ARRAY[1...14] OF UINT
%MW
see Parameter PAR below
Bottom
IN
LEN
UINT
14
length of parameter block (can not be changed)
Output Pin
Name
Data Type
Address Range
Meaning
Top
OUT
BOOL
ON = operation successful
Bottom
ERR
BOOL
ON = operation not successful
Parameter PAR
The data type of the parameter block is ARRAY[1...14] of UINT
Word
Content
Format
1, 2
reserved
DINT
3
output status
UINT
4
input status
UINT
5, 6
value of input A
REAL (Floating Point)
7, 8
value of input B
REAL (Floating Point)
9, 10
value of input C
REAL (Floating Point)
11, 12
value of input D
REAL (Floating Point)
13, 14
value of result (output)
REAL (Floating Point)
Output Status
Control Expert-IEC bits
Function
0...4
standard output bits (flags)
5
1 = bad input code chosen
6...15
not used
Input Status
Control Expert-IEC bits
Function
0...5
not used
6...9
formula code
Bit 9
Bit 8
Bit 7
Bit 6
formula
0
0
0
1
(A x B) + (C x D)
0
0
1
0
(A x B) - (C x D)
0
0
1
1
(A x B) / (C x D)
0
1
0
0
A / (B x C x D)
0
1
0
1
(A x B x C) / D
0
1
1
0
A x B x C x D
0
1
1
1
A + B + C + D
1
0
0
0
A x B (C - D)
1
0
0
1
A [(B / C)D]
1
0
1
0
A x LN (B / C)
1
0
1
1
(A - B) - (C - D) / LN [(A - B) / (C - D)]
1
1
0
0
(A / B) x EXP (-C / D)
1
1
0
1
(A - B) / (C - D)
10...11
not used
12...15
standard input bits (flags)