LinTransf (FUN)¶
FUNCTION LinTransf : REAL
Performs a linear transformation
The transformation is performed by using the minimum and maximum values of the inputs for a linear approximation of the output value.
Hint: there is similiar funtionality with Util.LIN_TRAFO (function block). LinTransf / Util.LIN_TRAFO doenst have any states, so there is no real need to implement this functionality as a function block - function would be sufficient. Util.LIN_TRAFO has been implemented as a function block in the past for historic reason (number of output arguments of functions limited to 1). Implementing LinTransf as a function is simply about bargaining application memory foodprint against application stack usage.
- InOut:
Scope
Name
Type
Comment
Return
LinTransfREALInput
rInREALInput value
rInMinREALMinimum input value
rInMaxREALMaximum input value
rOutMinREALCorresponding minimum output value
rOutMaxREALCorresponding maximum output value
Output
xErrorBOOLInconsistent inputs