Scale – Rockwell Automation 1336T Function Block Prog. Manual, Series A/B User Manual
Page 109
Function Block Library
4–47
1336 FORCE — 5.9 August 1995
Bit 31 is the sign bit, the most significant bit for 32 bit values. For 16
bit values, bit 15 (the sign bit) is the most significant bit.
EXAMPLES
Example 1
EXAMPLE 2
EXAMPLE 2
Input
32767
56
– 2
Mult
32767
128
16383
Div
1
10
1
Out LSW
1
716
32770
Out MSW
16383
0
– 1
OUTPUT VALUE
1073676289
716
– 32766
Example 1 — Double Word Output Value = 1073676289 = 32767
Ч
32767
ч
1
16383
dec
1
dec
3FFF
hex
0001
hex
Most Significant Word
Node 4
Least Significant Word
Node 3
Important:
The output range of the multiplied values can be critical. Should only one
output word (LSW node) of the SCALE block be used, it will appear to roll
over or under if the product exceeds
±
32767.
+ 16383 (Upper Waveform)
"
t1
"
SCALE
Out LSW
"
SCALE Input
"
+ 32767 (Upper Waveform)
"
0 (Upper Waveform)
"
0 (Lower Waveform)
"
"
– 32767 (Upper Waveform)
+ 32767 (Lower Waveform)
– 32767 (Lower Waveform)
"
In the Upper Waveform above, the SCALE Input (node 0), is multiplied by a
Mult (node 1) value of 2 and divided by a Div (node 2) value of 1. As the
input value increases beyond 16383 (time t1), the product increases
beyond + 32767. Although the Out LSW output (node 3) has a range of 0 to
65535 (0 to FFFF
hex
), the analog input has a single word signed range of
±
32767. When the input reaches 16385, the multiplied output of 32770
(8002
hex
) is interpreted by the signed analog output parameter as having a
value of – 32766 which makes it appear to roll over.
SCALE
(continued)