Scaling - Scl(66) - Omron CPM1 Programming Manual

Hide thumbs Also See for CPM1:
Table of Contents

Advertisement

Conversion Instructions
Flags
Example
00000
5-19-10 SCALING – SCL(66)
SCL(66)
S
P1
R
Limitations
Description
272
If the parity of the ASCII code in S does not agree with the parity specified in
Di, the ER Flag (SR 25503) will be turned ON and the instruction will not be
executed.
ER:
Incorrect digit designator, or data area for destination exceeded.
Indirectly addressed DM word is non-existent. (Content of DM word
is not BCD, or the DM area boundary has been exceeded.)
In the following example, the 2
converted to hexadecimal values and those values are written to the first and
second bytes of IR 010.
@HEX(––)
LR 10
HR 10
010
HR 10
LR 12
Ladder Symbols
@SCL(66)
S
P1
R
This instruction is available in the CQM1 only.
P1 through P1+3 must be in the same data area.
DM 6144 to DM 6655 cannot be used for P1 through P1+3 or R.
SCL(66) is used to linearly convert a 4-digit hexadecimal value to a 4-digit
BCD value. Unlike BCD(24), which converts a 4-digit hexadecimal value to its
4-digit BCD equivalent (S
value according to a specified linear relationship. The conversion line is
defined by two points specified in the parameter words P1 to P1+3.
When the execution condition is OFF, SCL(66) is not executed. When the exe-
cution condition is ON, SCL(66) converts the 4-digit hexadecimal value in S to
the 4-digit BCD value on the line defined by points (P1, P1+1) and (P1+2,
P1+3) and places the results in R. The results is rounded off to the nearest
nd
byte of LR 10 and the 1
Address Instruction
00000
LD
00001
@HEX(––)
0 1 1 0
3 5 3 4
LR 11
4 2 3 2
010
IR, SR, AR, DM, HR, TC, LR, #
S
), SCL(66) can convert the hexadecimal
hex
BCD
Section 5-19
st
byte of LR 11 are
Operands
00000
LR
HR
LR 10
3 1 3 0
Conversion to
hexadecimal
0 0 2 1
Operand Data Areas
S: Source word
P1: First parameter word
IR, SR, AR, DM, HR, TC, LR
R: Result word
IR, SR, AR, DM, HR, LR
10
10
010

Advertisement

Table of Contents
loading

Table of Contents