Data Control Instructions
Flags
Precautions
658
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.
Positive Offset
R (signed BCD)
Offset
X
S (signed binary)
(Signed binary)
Offset
P1
Y
(Signed binary)
P1+1
X
P1+2
(Signed BCD)
Offset = 0000 hex
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. The result of scaling in R and the Carry Flag can
also be used to output negative values for the scaling result.
Name
Label
Error Flag
ER
Equals Flag
=
Carry Flag
CY
An error will occur and the Error Flag will turn ON if the value for X (C+1) is
0000 or if the value for Y (C+2) is not BCD.
The Equals Flag will turn ON when the contents of the result word D is 0000.
The Carry Flag will turn ON if the value placed in the result word is negative.
Negative Offset
R (signed BCD)
Y
X
Offset
Offset of 0000
R (signed BCD)
X
Operation
ON if the contents of C+1 ( X) is 0000.
ON if the contents of C+2 ( Y) is not BCD.
OFF in all other cases.
ON if the result is 0.
OFF in all other cases.
ON if the result is negative.
OFF if the result is zero or positive.
Section 3-17
Y
S (signed binary)
Y
S (signed binary)
Need help?
Do you have a question about the CP - PROGRAMMING MANUAL 05-2007 and is the answer not in the manual?
Questions and answers