Publication 1747-RM001G-EN-P - November 2008
Math Instructions 4-13
Scale with Parameters
(SCP)
Use the SCP instruction to produce a scaled output value that has a linear
relationship between the input and scaled values. This instruction supports
integer and floating point values. Use this instruction with SLC 5/03 (OS302),
SLC 5/04 (OS401), and SLC 5/05 processors.
Use the following formula to convert analog input data to engineering units.
y = mx + b
Where:
y = scaled output
m = slope = (scaled MAX. - scaled MIN.) / (input MAX. - input MIN.)
x = input value
b = offset (y intercept) = scaled MIN - (input MIN. x m)
Entering Parameters
Enter the following parameters when programming this instruction.
• Input value can be a word address or an address of floating point data
elements.
• Input Minimum and Input Maximum values determine the range of
data that appears in the Input Value parameter. The value can be a word
address, an integer constant, floating point data element, or a floating
point constant.
• Scaled Minimum and Scaled Maximum values determine the range
of data that appears in the Scaled Output parameter. The value can be a
word address, an integer constant, floating point data element, or a
floating point constant.
• Scaled Output value can be a word address or an address of floating
point data elements.
SCP
Scale w/Parameters
Input N7:30
100<
Input Min. 0
0<
Input Max. 32767
32767<
Scaled Min. 0
0<
Scaled Max. 10000
10000<
Output N7:31
0<
SCP
Output Instruction
Fixed SLC
5/01
SLC
5/02
SLC
5/03
SLC
5/04
SLC
5/05
•••
TIP
The Input Minimum, Input Maximum, Scaled
Minimum, and Scaled Maximum are used to
determine the slope and offset values. The input
value can go outside of the specified input limits and
no ordering is required. For example, the scaled
output value is not necessarily clamped between the
scaled minimum and scaled maximum values.