2 Instructions
2-286 CP1E CPU Unit Instructions Reference Manual(W483)
Hint
SCL3(487) is used to convert data using a user-defined scale to signed binary for Analog Output Units.For example, SCL3(487) can convert 0 to 200 °C to 0000 to 1770 (hex) and output an analog outputsignal 1 to 5 V from the Analog Output Unit.
Sample program
When a value from 0 to 200 is scaled to an analog signal (1 to 5 V, for example), a signed BCD value of0000 to 0200 is converted (scaled) to signed binary value of 0000 to 1770 for an Analog Output Unit.When CIO 0.00 turns ON in the following example, the contents of D0 is scaled using the linear functiondefined by X (0200), Y (1770), and the offset (0). These values are contained in D100 to D102. Thesign of the BCD value in D0 is indicated by the Carry Flag. The result is output to CIO 103.
S (signed BCD)
Offset Offset
S (signed BCD)
Offset of 0000
Positive Offset
R (signed binary)
R (signed binary)
R (signed binary)
Negative Offset
Max conversion
Min. conversion
Max conversion
Min. conversion
Max conversion
Min. conversion
S (signed BCD)
X
Y
X
Y
X
Y
SCL3
D0
D100
103
0.00
S
P1
R
P1 :D100
P1+1:D101
P1+2:D102
P1+3:D103
P1+4:D104
Offset
X
Y
Max. conversion
Min. conversion
0000
-010
1770
189C
0200 2010
X(0200)
Y(1770 Hex)
FED4
Contents of R (2011, signed binary)
Contents of S (D0, signed BCD)
0000
0200
1770
189C
FED4