This figure shows the pin diagram of the FB_Scaling function block:
The FB_Scaling function block is developed to convert an input value to a specified output range linearly and an error is detected in case of an invalid parameter.
This function block scales an input signal to a linear output, relative to a defined maximum and minimum range.
The input signal is scaled in a linear manner with reference to two value ranges as shown in the figure below:
The output changes dynamically based on the change in input:
oSlope = (i_rMaxOput-i_rMinOput) / (i_rMaxIput - i_rMinIput)
oOffset = i_rOutMax - (Slope * i_rMaxIput)
oq_rOput = (Slope * i_rIput) + Offset
For an i_rIput in the range of i_rMinIput and i_rMaxIput, q_rOput scaled to a range of i_rMinOput and i_rMaxOput. The q_xEn is TRUE as long as the input i_xEn is TRUE, regardless of a detected error, as shown in the figure:
An invalid parameter at the function block inputs results in a detected error and a corresponding detected error ID is generated. The output is set to zero during a detected error. The detected error can be reset only through a rising edge of i_xErrRst. The input q_xBusy is TRUE whenever the function block is enabled and there is no detected error.