EDH0162En1040 – 06/99
3.188
MM4005
YF — Scale variable
Usage
IMM
PGM
MIP
Syntax
xxYFnn
Parameters
Description
xx
[int]
— Variable number.
nn
[int]
— Scaling factor.
Range
xx
—
1
to
100
(integers) and
101
to
120
(floats).
nn
—
-32767
to
32767.
Units
xx
— None.
nn
— None.
Defaults
xx
Missing: Error O.
Out of range: Error O.
Floating point: Error A.
nn
Missing: Error C.
Out of range: Error C
.
Description
This command scales the values of a variable. The value of variable
xx
is
multiplied by the constant
nn
and the result placed in variable
xx
. If the
value of
nn
is zero, the operation is not performed and error H is generat-
ed. If the result of the multiplication is outside the -32767 to 32767 range,
the operation is not performed and error H is generated. The decimal part
of the multiplication result is truncated.
Returns
None.
Errors
A
—
Unknown message code.
C
—
Parameter out of limits.
H
—
Calculation overflow.
O
—
Variable number out of range
.
Rel. Commands
YA
—
Add to variable.
YD
—
Divide variable.
YS
—
Initialize variable.
Example
1YR3 |
Load analog port #3 value into variable #1.
3YY1 |
Copy variable #1 in variable #3.
3YA-32 |
Subtract 32 from variable #3.
3YF0.5555556
|
Multiply variable #3 by 0.5555556; if variable #1 represents a tem-
perature measured in degrees Fahrenheit, variable #3 will be the
equivalent temperature in degrees Celsius.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com