ScaleLin
Function - Scaling - linear conversion.
Inputs
|
Input |
Data type |
Description |
|
IN |
REAL |
Real value. |
|
IMIN |
REAL |
Minimum input value. |
|
IMAX |
REAL |
Minimum input value. |
|
OMIN |
REAL |
Minimum output value. |
|
OMAX |
REAL |
Minimum output value. |
Outputs
|
Output |
Data type |
Description |
|
OUT |
REAL |
Result: OMIN + IN * (OMAX - OMIN) / (IMAX - IMIN). |

Truth table
|
Inputs |
OUT |
|
IMIN >= IMAX |
= IN |
|
IN < IMIN |
= OMIN |
|
IN > IMAX |
= OMAX |
|
other |
= OMIN + IN * (OMAX - OMIN) / (IMAX - IMIN) |
Remarks
In LD language, the operation is executed only if the input rung (EN) is TRUE. The output rung (ENO) keeps the same value as the input rung.
ST Language
OUT := ScaleLin (IN, IMIN, IMAX, OMIN, OMAX);
FBD Language

LD Language
The function is executed only if EN is TRUE.
ENO keeps the same value as EN.

ScaleLin |
|
IEC 61131-3 Automation platform > Programming - Reference guide > Mathematic operations > ScaleLin |
Created with the Personal Edition of HelpNDoc: Upgrade Your Documentation Process with a Help Authoring Tool

