276
Conversion Instructions Section 5-19
5-19-12BCD TO SIGNED BINARY SCALING – SCL3(––)
Limitations This instruction is available in the CQM1-CPU4@-E/-EV1 only.
S, P1+1 must be BCD.
P1 through P1+4 must be in the same data area.
DM 6144 to DM 6655 cannot be used for R.
Description SCL3(––) is used to linearly convert a 4-digit 4-digit BCD value to 4-digit
signed hexadecimal. SCL3(––) converts the BCD value according to a speci-
fied linear relationship. The conversion line is defined by the y-intercept and
the slope of the line specified in the parameter words P1 to P1+2.
When the execution condition is OFF, SCL3(––) is not executed. When the
execution condition is ON, SCL3(––) converts the 4-digit BCD value in S to
the 4-digit signed hexadecimal value on the line defined by the y-intercept (0,
P1) and the slope (P1+2
÷ P1+1) and places the result in R. The result is
rounded off to the nearest integer.
The content of S can be 0000 to 9999, but S will be treated as a negative
value if CY=1, so the effective range of S is actually –9999 to 9999. Be sure to
set the desired sign in CY using STC(40) or CLC(41).
Parameter words P1+3 and P1+4 define upper and lower limits for the result.
If the result is greater than the upper limit in P1+3, then the upper limit is writ-
ten to R. If the result is less than the lower limit in P1+4, then the lower limit is
written to R.
Note The upper and lower limits for a 12-bit Analog Input Unit would be 07FF and
F800.
The following table shows the functions and ranges of the parameter words:
S: Source word
IR, SR, AR, DM, HR, LR
Ladder Symbols Operand Data Areas
@SCL3(––)
S
P1
R
R: Result word
IR, SR, AR, DM, HR, LR
P1: First parameter word
IR, SR, AR, DM, HR, LR
SCL3(––)
S
P1
R
Parameter Function Range
P1 x-intercept (signed hex.) 8000 to 7FFF (–32,768 to 32,767)
P1+1 ∆X (BCD) 0001 to 9999
P1+2 ∆Y (signed hex.) 8000 to 7FFF (–32,768 to 32,767)
P1+3 Upper limit (signed hex.) 8000 to 7FFF (–32,768 to 32,767)
P1+4 Lower limit (signed hex.) 8000 to 7FFF (–32,768 to 32,767)