Description
Calculates an output based on a given input using the linear function.
Function
Set the following before using this function block:
- Specify the input.
- Set the input and output limits (Input_Limit1, Input_Limit2, Output_Limit1 and Output_Limit2).
After the above settings are complete, this function block calculates the output based on the following linear curve function:
Out = (Y2 - Y1) * (In - X1) / (X2 - X1) + Y1
Input
PIN | Description |
---|---|
INPUT | Analog input to be linearly transformed |
Input_Limit1 | Min. input limit (X1) |
Input_Limit2 | Max. input limit (X2) |
Output_Limit1 | Min. output limit (Y1) |
Output_Limit2 | Max. output limit (Y2) |
Output
PIN | Description |
---|---|
Linearly transformed output | Output value (Out) calculated from inputs (In) following the linear function |
Input value
PIN | Data type | Unit | Default value | Range |
---|---|---|---|---|
INPUT | Analog | N/A | N/A | -999999...999999 |
Input_Limit1 | Analog | N/A | N/A | Less than "Input_Limit2" |
Input_Limit2 | Analog | N/A | N/A | Greater than "Input_Limit1" |
Output_Limit1 | Analog | N/A | N/A | Less than "Output_Limit2" |
Output_Limit2 | Analog | N/A | N/A | Greater than "Output_Limit1" |
Output value
PIN | Data type | Unit | Default value | Range |
---|---|---|---|---|
Linearly transformed output | Analog | N/A | N/A | Between "Output_Limit1" and "Output_Limit2" (including limits) |
Example
During cooling in summer, when the unit switch (DI) is closed, the PID controller calculates based on the room temperature (AI) and temperature setpoint, then drives the cooling valve (AO) accordingly.
The linear transformation in the example is to convert the output of the PID block from 0 to 100 linearly into 0 to 10. The transformed value can then be sent to a 0...10 V water valve as its output.