Function Block LINEARPOINTS

The function block LINEARPOINTS calculates a value from several points using the linear equation.

Note: The values X_MIN and X_MAX must be in ascending order. That is, X_MIN < X_MAX.

Note: This function block can have more than nine inputs. You can right-click on the function block to add another input.

The points are configured using the plugin XY Translation in the visualization. The points are positioned proportionally. That is, the scale may differ from the visualization. Thus, a dimming value in the PLC can range from 0..255 and on the visualization from 0..100.

Input IN

Expects a number to calculate the output OUT.

Input X_MIN

Defines the smallest value of the X-axis.

Input X_MAX

Defines the largest value of the X-axis.

Input Y_MIN

Defines the lower range of the Y-axis.

Input Y2

Defines the upper range of the Y-axis.

Input XY_START

Defines the first point as a string in the format "X;Y". The points X and Y are the coordinates of the point. Y is restricted to Y_MIN and Y_MAX. The value X is also restricted. However, the point may lie outside the range by a factor of 100.

Input XY_END

Defines the last point as a string in the format "X;Y". The points X and Y are the coordinates of the point. Y is restricted to Y_MIN and Y_MAX. The value X is also restricted. However, the point may lie outside the range by a factor of 100.

Input DIS

If true, the calculation is disabled. The output Q has 0. In the visualization, the current X position is no longer displayed.

Inputs VAR1..VAR#

The inputs define optional constants of the individual axes. For this purpose, the function block VAR_X or VAR_Y is used.

Warning: The constants are assigned to the number of the input. That is, removing an output can change the assignment of the output.

The value of the input is recalculated with the scaling of the function block and is calculated accordingly in the visualization. The values are limited in this process.

Output Q

The calculated output value between the points. By position IN. The value of the output is rounded to whole numbers.

Output COUNT

Returns the number of configured points.

Output P_START

Returns the first point as a string "X;Y".

Output P_END

Returns the last point as a string "X;Y".