710
Data Control Instructions
Section 3-18
Description
SCL2(486) is used to convert the signed binary data contained in the source
word S into signed BCD data (the BCD data contains the absolute value and
the Carry Flag shows the sign) and place the result in the result word R
according to the linear function defined by the slope (
∆
X,
∆
Y) and an offset.
The address of the first word containing
∆
X,
∆
Y, and the offset is specified for
the first parameter word P1. The sign of the result is indicated by the status of
the Carry Flag (ON: negative, OFF: positive).
The following equations are used for the conversion.
The offset and slope can be a positive value, 0, or a negative value. Using a
negative slope enables reverse scaling.
The result will be rounded to the nearest integer.
The result in R will be the absolute BCD conversion value and the sign will be
indicated by the Carry Flag. The result can thus be between –9999 and 9999.
If the result is less than –9999, –9999 will be output as the result. If the result
is greater than 9999, 9999 will be output.
SCL2(486) can be used to scale the results of analog signal conversion val-
ues from Analog Input Units according to user-defined scale parameters. For
example, if a 1 to 5-V input to an Analog Input Unit is input to memory as 0000
to 0FA0 hexadecimal, the value in memory can be scaled to –100 to 200
°
C
using SCL2(486).
SCL2(486) converts signed binary to signed BCD. Negative values can thus
be handled directly for S. SCL2(486) will also output negative values.
∆
Y
BCD conversion of
∆
X
The slope of the line is
∆
Y/
∆
X.
R =
x ((BCD conversion of S) – (BCD conversion of offset)
∆
Y
∆
X
∆
Y
∆
X
∆
Y
∆
X
∆
Y
∆
X
R (signed BCD)
S (signed binary)
P1
P1+1
P1+2
Positive Offset
Offset
R (signed BCD)
S (signed binary)
Negative Offset
Offset
R (signed BCD)
S (signed binary)
Offset of 0000
Offset = 0000 hex
Offset
(Signed binary)
(Signed binary)
(Signed BCD)
Summary of Contents for CJ1G-CPUxx
Page 3: ...iv N o t i c e ...
Page 5: ...vi ...
Page 21: ...xxii Conformance to EC Directives 6 ...
Page 35: ......
Page 1131: ...1110 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...