L9P_LKUP: Look-up Table
(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_LKUP DFB establishes a look-up table using a linear algorithm to interpolate between points. L9P_LKUP can handle variable point intervals and variable numbers of points.
If the input (x) is outside the specified range of points, the output (y) is clamped to the corresponding output y0 or yn. If the number of points is out of range, the function does not check the xn because the information from that pointer is invalid.
Points to be interpolated are determined by a search algorithm starting at the end of the table. The search is valid for x1 < x < xn. The variable x may occur multiple times with the same value, the value chosen from the look-up table is the last instance found.
For example, if the table is:
x
y
10.0
1.0
20.0
2.0
30.0
3.0
30.0
3.5
40.0
4.0
then an input of 30.0 finds the last instance of 30.0 and assigns 3.5 as the output. An input of 31.0 would assign the value 3.55 as the output.
NOTE: No sorting is done on the contents of the lookup table. Independent variable table values should be entered in ascending order to prevent unreachable gaps in the table.
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...39] OF UINT
%MW
see Parameter PAR below
Bottom
IN
LEN
UINT
39
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...39] of UINT
Word
Content
Format
1, 2
input
REAL (Floating Point)
3
output status
UINT
4
input status
UINT
5
number of point pairs
UINT
6, 7
point x1
REAL (Floating Point)
8, 9
point y1
REAL (Floating Point)
10, 11
point x2
REAL (Floating Point)
12, 13
point y2
REAL (Floating Point)
...
...
...
34, 35
point x8
REAL (Floating Point)
36, 37
point y8
REAL (Floating Point)
38, 39
output
REAL (Floating Point)
Output Status
Control Expert-IEC bits
Function
0...4
standard output bits (flags)
5
1 = invalid number of points
6
1 = input clamped, i.e. out of table’s range
7...15
not used
Input Status
Control Expert-IEC bits
Function
0...11
not used
12...15
standard input bits (flags)