681
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Data Control Instructions
3
SCL3
z Operand Specifications
Flags
Function
SCL3(487) is used to convert the signed BCD data (the BCD data contains the absolute value and the
Carry Flag shows the sign) contained in the source word S into signed binary data and place the result
in the result word R according to the linear function defined by the slope (∆X, ∆Y) and an offset. The
maximum and minimum conversion values are also specified. The address of the first word containing
∆X, ∆Y, the offset, the maximum conversion, and the minimum conversion 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). Use
STC(040) and CLC(041) to turn the Carry Flag ON and OFF.
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 source value in S is treated as an absolute BCD value and the sign is indicated by the Carry
Flag. The source value can thus be between –9999 and 9999.
• If the result is less than the minimum conversion value, the minimum conversion value will be output
as the result. If the result is greater than the maximum conversion value, the maximum conversion
value will be output.
Area
Word addresses
Indirect DM/EM
addresses
Con-
stants
Registers Flags
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
TK CF
S
OK OK OK OK OK OK OK OK OK OK ---
OK
--- OK --- --- --- ---P1 ---
R OK
Name Label Operation
Error Flag ER • ON if the contents of S is not BCD.
• ON if the contents of C+1 (∆X) is not between 0001 and 9999 BCD.
• OFF in all other cases.
Equals Flag = • ON if the result is 0.
• OFF in all other cases.
Negative Flag N • ON when the MSB of the R (the result) is 1.
• OFF in all other cases.
∆Y
R =
Binary conversion of ∆X
× ((Binary conversion of S)+(Offset))
Note: The slope of the line is ∆Y/∆X.