This function does not detect any error conditions.
15.1.9 FC 105 - SCALE - Scaling Values
The Scaling Values SCALE function takes an integer value IN and converts it to a real
value in engineering units scaled between a low and a high limit LO_LIM and HI_LIM.
The result is written to OUT. The SCALE function uses the equation:
The constants K1 and K2 are set based upon whether the input value is BIPOLAR or
UNIPOLAR.
n BIPOLAR:
– The input integer value is assumed to be between -27648 and 27648, therefore,
K1 = -27648,0 and K2 = +27648,0.
n UNIPOLAR:
– The input integer value is assumed to be between 0 and 27648, therefore,
K1 = 0,0 and K2 = +27648,0.
If the input integer value is greater than K2, the output OUT is clamped to HI_LIM, and an
error is returned. If the input integer value is less than K1, the output OUT is clamped to
LO_LIM, and an error is returned. Reverse scaling can be obtained by programming
LO_LIM > HI_LIM. With reverse scaling, the value of the output decreases as the value of
the input increases.
Parameters
Parameter Declaration Data Type Memory Area Description
EN INPUT BOOL I, Q, M, D, L
n Enable
– TRUE: activates the function
– FALSE: deactivates the function
ENO OUTPUT BOOL I, Q, M, D, L
n Status
– TRUE: function executed without
error
IN INPUT INT I, Q, M, D, L, con-
stant
The input value to be scaled to a REAL
value in engineering units
HI_LIM INPUT REAL I, Q, M, D, L, P, con-
stant
Upper limit in engineering units
LO_LIM INPUT REAL I, Q, M, D, L, P, con-
stant
Lower limit in engineering units
BIPOLAR INPUT BOOL I, Q, M, D, L A signal state of 1 indicates the input value
is bipolar, a signal state of "0" indicates uni-
polar
OUT OUTPUT REAL I, Q, M, D, L, P The result of the scale conversion
RET_VAL INPUT WORD I, Q, M, D, L, P Returns a value of W#16#0000 if the
instruction executes without error; see Error
Information for values other than
W#16#0000
Error Information
Description
VIPA SPEED7
Standard
Converting > FC 105 - SCALE - Scaling Values
HB00 | OPL_SP7 | Operation list | en | 18-30 800