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.
LGF_NonLinearInterpolation (FB) | ||||||||
---|---|---|---|---|---|---|---|---|
LReal | value | outputValue | LReal | |||||
LReal | defaultOutValue | |||||||
Bool | enDefaultOutValue | |||||||
Bool | track | |||||||
Bool | reset | |||||||
Array[*] of LGF_typeNonLinSetpoints | setpoints | Array[*] of LGF_typeNonLinSetpoints | ||||||
Identifier | Data type | Default value | Description |
---|---|---|---|
value | LReal | 0.0 | Input value for calculating the output value over the defined characteristic curve. |
defaultOutValue | LReal | 0.0 | Value for pre-assignment of the output variable (`outputValue` = `defaultOutValue`) |
enDefaultOutValue | Bool | FALSE | Assign default output value (`outputValue` = `defaultOutValue`) |
track | Bool | 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`) |
reset | Bool | 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) |
Identifier | Data type | Description |
---|---|---|
outputValue | LReal | The output value that has been calculated from the input value over the defined characteristic curve. |
Identifier | Data type | Description |
---|---|---|
setpoints | Array[*] of LGF_typeNonLinSetpoints | Setpoint point table for defining the characteristic curve (polynomial) |
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 |
The value of the output outputValue
based on the following priority:
enDefaultOutValue
is set, the value defined via the parameter defaultOutValue
will be output as output value.reset
is set, the block is reset and the output value is 0.0
.track
is set, the output value will be output directly as input value, without consideration of the characteristic curve.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
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.
Figure: Sample data block
Version & Date | Change description | |
---|---|---|
01.00.00 | Siemens Industry Online Support | |
04.01.2017 | First released version | |
01.00.01 | Siemens Industry Online Support | |
17.08.2018 | Upgrade: TIA V15 Update 2 | |
01.00.02 | Siemens Industry Online Support | |
23.11.2018 | Upgrade: TIA V15.1 | |
01.00.06 | Simatic Systems Support | |
15.11.2019 | Regions, comments and constants are added | |
03.00.00 | Simatic Systems Support | |
23.04.2020 | Set version to V3.0.0, harmonize the version of the whole library | |
03.00.01 | Simatic Systems Support | |
22.03.2021 | Insert documentation |