LGF_NonLinearInterpolation (FB / V3.0.1)

Overview

Author: Siemens Digital Industries

Short description

This function implements a characteristic curve. The characteristic curve is defined via an interpolation point table with linear interpolation between the interpolation points. A prescribed input value generates an output value in each cycle based on the characteristic curve from the interpolation point table.

Block Interface

LGF_NonLinearInterpolation (FB)
LReal  value outputValue  LReal
    
LReal  defaultOutValue   
    
Bool  enDefaultOutValue   
    
Bool  track   
    
Bool  reset   
    
Array[*] of LGF_typeNonLinSetpoints  setpoints  Array[*] of LGF_typeNonLinSetpoints
       
   

Input parameter

IdentifierData type Default value Description
valueLReal 0.0 Input value for calculating the output value over the defined characteristic curve.
defaultOutValueLReal 0.0 Value for pre-assignment of the output variable
(`outputValue` = `defaultOutValue`)
enDefaultOutValueBool FALSE Assign default output value
(`outputValue` = `defaultOutValue`)
trackBool FALSE The value of the output `outputValue` follows the value of the input `value` without using the characteristic curve as long as this input is set. (`outputValue` = `value`)
resetBool FALSE If the interpolation point table is changed in running operation, the input `reset` must be activated afterwards. Otherwise, the block cannot guarantee correct execution.
(`outputValue` = 0.0)

Output parameter

IdentifierData type Description
outputValueLReal The output value that has been calculated from the input value over the defined characteristic curve.

In/Out parameter

IdentifierData type Description
setpointsArray[*] of LGF_typeNonLinSetpoints Setpoint point table for defining the characteristic curve (polynomial)

User defined datatype(s)

LGF_typeNonLinSetpoints (UDT / V3.0.1)

Data type to setup a setpoint table for the function LGF_NonLinearInterpolation

Identifier Data type Default value Description
inputValue LReal 0.0 Input value to be interpolated
outputValue LReal 0.0 Corresponding interpolated value

Functional description

The value of the output outputValue based on the following priority:

  1. As long as the input enDefaultOutValue is set, the value defined via the parameter defaultOutValue will be output as output value.
  2. As long as the input reset is set, the block is reset and the output value is 0.0.
  3. If the input track is set, the output value will be output directly as input value, without consideration of the characteristic curve.
  4. Based on the input value, a characteristic curve value is calculated via the linearly interpolated, interpolation point table and output as an output value.
Interpolation point table

The interpolation point table is implemented through a variable of the data type Array. The type of the array corresponds to the PLC data type LGF_typeNonLinSetpoints.

You can create the interpolation point table in any global data block. The size of the array depends on the number of interpolation points.


Figure: Sample path of the output signal

LGF_NonLinearInterpolation Setpoint table


NOTICE
To keep the computing time of the block as short as possible, there is no check of the parameterization or the data of the interpolation point table.

When entering the interpolation points in the interpolation point table, the following particularities must be considered. If these particularities are not taken into account, it can lead to a malfunction of the block.

Example

Figure: Sample data block

LGF_NonLinearInterpolation_Table Setpoint table

Change log

Version & DateChange description
01.00.00Siemens Industry Online Support
04.01.2017First released version
01.00.01Siemens Industry Online Support
17.08.2018Upgrade: TIA V15 Update 2
01.00.02Siemens Industry Online Support
23.11.2018Upgrade: TIA V15.1
01.00.06Simatic Systems Support
15.11.2019Regions, comments and constants are added
03.00.00Simatic Systems Support
23.04.2020Set version to V3.0.0, harmonize the version of the whole library
03.00.01Simatic Systems Support
22.03.2021Insert documentation