Lookup Table 1D block

The one dimensional Lookup Table block performs a lookup in a user-defined table for values of the dependent variables using a single field as the index (the independent variable).  The output values of the block are the corresponding values in the output field columns of the lookup table.  Thus the table would have a column of values for the independent variable (the block input field) and one or more columns of values for the dependent variables (the output fields).  

Return to Overview of blocks

Lookup Table ID block

Description

The block does a lookup using the value of the input (the independent variable), in a table specified  by the user. The block uses the value of the independent field to find the corresponding values of each of the dependent variables (outputs).  If the value of the independent field falls between two table row entries, then the values of the dependent variables are calculated by a linear interpolation.

diagram showing the lookup table ID block

Block Type

Data Transformation block

Input/Output ports

The input field(s) must be of type double.  The block has one output port which contains all the dependent fields in the table. Thus the number of output fields is equal to the number of dependent fields contained in the lookup table.

Return to top

Functions performed on tags

  • On the values - If the input value is the same as one of the rows of the table, the output values are the corresponding values of the output columns on that row.  If the input value lies between two row entries in the table, the output value is computed by doing a linear interpolation on the interval in which the input value falls.  An example is shown below in which IM is the known intermediate value of the independent variable and IP is the interpolated value of the dependent variable.  The equation used to calculate IP is given below the example.   If the input value falls outside the range of the table, the output values are not set, and the qualities are set to bad.

 

  • On the timestamp - The output fields take the value of the time stamp attribute of the input field.

  • On the quality - If the input value's quality is bad, then all the output field qualities will also be set to bad.  If the input value's quality is good then the value is checked to see if it falls within the boundaries of the lookup table. If the input variable's value is smaller than the lower bound, or greater than the upper bound, then the quality will also be set to bad. If the input value falls within the range of the lookup table, the quality is set to good.

Return to top

Example

A 1-dimensional table is shown below.

Case 1: Assume that a good quality value of 0.83 enters for the independent variable (Independent_Var).  The table only has entries for 0.81 and 0.864 thus the block will perform a linear interpolation to determine the values of Dependent_Var_1 and Dependent_Var_2.  By making use of the interpolation equation shown above, we calculate that Dependent_Var_1 equals 0.867 and Dependent_Var_2 equals 1.187519.  

Case 2: Assume that a good quality value of 4.18 enters for the independent variable.  The table has an entry for 4.18 thus the values of Dependent_Var_1 and Dependent_Var_2 may be taken directly from the table, i.e. 2.305 and 9.455 respectively.

Case 3: Assume that a bad quality value of 8.88 enters for the independent variable.  The block will not do a lookup, the values of Dependent_Var_1 and Dependent_Var_2 will remain 2.305 and 9.455 respectively (i.e. keep last principle) and both will be bad quality.

Return to top

Case 4: Assume that a good quality value of 2.311 enters for the independent variable.  The table only has entries for 1.552 and 3.318 thus the block will perform a linear interpolation to determine the values of Dependent_Var_1 and Dependent_Var_2.  By making use of the interpolation equation shown above, we calculate that Dependent_Var_1 equals 1.74828 and Dependent_Var_2equals 5.289414.

Case 5: Assume that a good quality value of 10.233 enters for the independent variable.  The block will not do a lookup since this value lies outside the range of the table (too large), the values of Dependent_Var_1 and Dependent_Var_2 will remain 1.74828 and 5.289414 respectively and both will be bad quality.

Case 6: Assume that a good quality value of 0.36 enters for the independent variable.  The block will not do a lookup since this value lies outside the range of the table (too small), the values of Dependent_Var_1 and Dependent_Var_2 will remain 1.74828 and 5.289414 respectively and both will be bad quality.

The diagram below shows the block input (I_Var) and output (D_Var_1 and D_Var_2) for the above cases.

 

Return to top


Related topics:

  

CSense 2023- Last updated: June 24,2025