FB_ScaleOutput - Scaling Analog IO
Function Block - Converts un-scaled LREAL values from a PLC program into units of type DINT.
Inputs
Input |
Data Type |
Range |
Unit |
Default |
Description |
---|---|---|---|---|---|
InputSignal |
LREAL |
0, 4 |
N/A |
No default |
Un-scaled input signal. |
InputMin |
LREAL |
0, 4 |
N/A |
No default |
Minimum value of accepted input signal range. |
InputMax |
LREAL |
0, 4 |
N/A |
No default |
Maximum value of accepted input signal range. |
OutputMin |
DINT |
0, 4 |
N/A |
No default |
Output value mapped to the InputMin. |
OutputMax |
DINT |
0, 4 |
N/A |
No default |
Output value mapped to the InputMax. |
Outputs
Output |
Data Type |
Range |
Unit |
Description |
---|---|---|---|---|
OutputSignal |
DINT |
|
N/A |
Scaled value of the Input Signal with type converted to DINT. Stays within specified Min/Max output values. |
OutsideRange |
BOOL |
|
N/A |
TRUE if the InputSignal is outside the range setup by min/max values, otherwise FALSE. |
Remarks
- The scale LREAL to DINT can be mapped to an analog output.
- The input signal is converted based on a linear mapping automatically calculated by two points entered.
- InputMin is mapped to OutputMin, InputMax is mapped to OutputMax, and all values in between are scaled automatically.
- If an input value is not between the selected Min/Max, the Boolean output OutsideRange turns TRUE.
- The OutputSignal is set to the corresponding OutputMin or OutputMax value.
This image shows the function or function block I/O.
Figure 1: FB_ScaleOutput
Usage
Scale an analog signal from a drive.
FBD Language Example
FFLD Language Example
IL Language Example
Not available.
ST Language Example
Inst_ScaleOutput1( ScaleOutput_In2, ScaleOutput_In2_Min,ScaleOutput_In2_Max, ScaledOutput_2_Min, ScaledOutput_2_Max );
ScaledOutput_2:=Inst_ScaleOutput1.OutputSignal;
ScaledOutput_2_Err:=Inst_ScaleOutput1.OutsideRange;
See Also