Topic: DMD0025

SCALE - Scale Value


The Scale Value (SCALE) instruction converts the Input value from input units to scaled (engineering) units.

 

The formula used in the conversion is:

 

         (( Input - In Min) * ( Out Max - Out Min ))

Output = ------------------------------------------- + Out Min

                     ( In Max - In Min )

Parameters:

Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.

 

Input - designates the location of the value to scale. This value can be any readable numeric location.

 


In Min - designates the minimum raw value for the Input variable. This can be any constant value or any readable numeric location.

 

In Max - designates the maximum raw value for the Input variable. This can be any constant value or any readable numeric location.

 

Note: if the Input value is an Integer, both the In Min and In Max values should also be integers. if the Input value is a Real, both the In Min and In Max values should also be Real values.

 


Out Min - designates the minimum scaled value for the Input variable. This value should be the output equivalent of the In Min value. This can be any constant value or any readable numeric location.

 

Out Max - designates the maximum scaled value for the Input variable. This value should be the output equivalent of the In Max value. This can be any constant value or any readable numeric location.

 

Note: if the Output value is an Integer, both the Out Min and Out Max values should also be integers. if the Output value is a Real, both the Out Min and Out Max values should also be Real values.

 


Output - designates the location to store the scaled value. This value can be any writable numeric location.

 

Note: refer to the example, Input (WX0) is an Integer so In Min and In Max values are also Integers (the values are 0 and 4095, not 0.0 and 4095.0), The output (R0) is a Real value, so Out Min and Out Max are Real values as well (the values are 32.0 and 212.0, not 32 and 212).

 


See Also:

 


Related Topics:

 


Rung Example: