Y_YA_Scaler
This function block performs the calculation y:= mx + b.
Parameters:
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
|
VAR_INPUT
|
||||
| B | Enable | BOOL | The function will continue to execute every scan while Enable is held high and there are no errors. | FALSE |
| V | Input | LREAL | The x variable of y:=mx + b. | LREAL#0.0 |
| V | CalX1 | LREAL | Datapoint specifying a line along which data is to be scaled. | LREAL#0.0 |
| V | CalY1 | LREAL | Datapoint specifying a line along which data is to be scaled. | LREAL#0.0 |
| V | CalX2 | LREAL | Datapoint specifying a line along which data is to be scaled. | LREAL#0.0 |
| V | CalY2 | LREAL | Datapoint specifying a line along which data is to be scaled. | LREAL#0.0 |
| VAR_OUTPUT | ||||
| B | Valid | BOOL | Indicates that the function is operating normally and the outputs of the function are valid. | |
| V | Output | LREAL | The result of the calculation y:=mx + b. | |
| V | m | LREAL | The calculated slope of the line. | |
| V | b | LREAL | The calculated intercept of the line. | |
| B | Error | BOOL | Set high if an error has occurred during the execution of the function block. This output is cleared when 'Execute' or 'Enable' goes low. | |
| B | ErrorID | UINT | If Error is true, this output provides the Error ID. This output is reset when 'Execute' or 'Enable' goes low. | |
Note:
- m is determined by the slope of a line specified by Cal_X1, Cal_Y1, Cal_X2, Cal_Y2.
- x is the 'Input'
- b is determined by calculating the Y intercept of the line.
Error Description
See the
Function Block ErrorID List