Omron C200HX 用户手册

下载
页码 564
222
Flags
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.)
Example
In the following example, the 2
nd
 byte of LR 10 and the 1
st
 byte of LR 11 are con-
verted to hexadecimal values and those values are written to the first and se-
cond bytes of IR 010.
@HEX(––)
HR 10
LR 10
00000
010
Address
Instruction
Operands
00000
LD
00000
00001
@HEX(––)
LR
10
HR
10
010
3 1 3 0
LR 10
4 2 3 2
Conversion to
hexadecimal
LR 11
0 0 2 1
010
3 5 3 4
LR 12
0 1 1 0
HR 10
5-18-12 SCALING – SCL(––)
S: Source word
IR, SR, AR, DM, HR, TC, LR, #
Ladder Symbols
Operand Data Areas
@SCL(––)
S
P1
R
R: Result word
IR, SR, AR, DM, HR, LR
P1: First parameter word
IR, SR, AR, DM, HR, TC, LR
SCL(––)
S
P1
R
Limitations
P1 and P1+2 must be BCD.
P1 through P1+3 must be in the same data area.
P1+1 and P1+3 must not be set to the same value.
Description
SCL(––) 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
hex
 
 S
BCD
), SCL(––) can convert the hexadecimal value ac-
cording 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(––) is not executed. When the execu-
tion condition is ON, SCL(––) 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 result in R. The result is rounded off to the nearest integer. If the result
is less than 0000, then 0000 is written to R, and if the result is greater than 9999,
then 9999 is written to R.
Data Conversion
Section 5-18