291
Conversion Instructions
Section 5-20
Description
When the execution condition is OFF, ZCPL(––) is not executed. When the
execution condition is ON, ZCPL(––) compares the 8-digit value in CD, CD+1
to the range defined by lower limit LL+1,LL and upper limit UL+1,UL and out-
puts the result to the GR, EQ, and LE flags in the SR area. The resulting flag
status is shown in the following table.
Precautions
Placing other instructions between ZCPL(––) and the operation which
accesses the EQ, LE, and GR flags may change the status of these flags. Be
sure to access them before the desired status is changed.
Flags
ER:
Indirectly addressed EM/DM word is non-existent.
(Content of
*
EM/
*
DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
LL+1,LL is greater than UL+1,UL.
EQ:
ON if LL+1,LL
≤
CD, CD+1
≤
UL+1,UL
LE:
ON if CD, CD+1 < LL+1,LL.
GR:
ON if CD, CD+1 > UL+1,UL.
5-20 Conversion Instructions
5-20-1 BCD-TO-BINARY – BIN(23)
Limitations
DM 6144 to DM 6655 cannot be used for R.
Description
When the execution condition is OFF, BIN(23) is not executed. When the exe-
cution condition is ON, BIN(23) converts the BCD content of S into the numer-
ically equivalent binary bits, and outputs the binary value to R. Only the
content of R is changed; the content of S is left unchanged.
BIN(23) can be used to convert BCD to binary so that displays on the Pro-
gramming Console or any other programming device will appear in hexadeci-
mal rather than decimal. It can also be used to convert to binary to perform
binary arithmetic operations rather than BCD arithmetic operations, e.g.,
when BCD and binary values must be added.
Comparison result
Flag status
GR
(SR 25505)
EQ
(SR 25506)
LE
(SR 25507)
CD, CD+1< LL+1,LL
0
0
1
LL+1,LL
≤
CD, CD+1
≤
UL+1,UL
0
1
0
UL+1,UL < CD, CD+1
1
0
0
S
:
Source word (BCD)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
R
:
Result word
IR, SR, AR, DM, EM, HR, LR
Ladder Symbols
Operand Data Areas
BIN(23)
S
R
@BIN(23)
S
R
S
R
BCD
Binary
Содержание SYSMAC CQM1H Series
Страница 3: ...iv...
Страница 5: ...vi...
Страница 9: ......
Страница 11: ......
Страница 15: ...xvi...
Страница 87: ...62 Calculating with Signed Binary Data Section 1 7...
Страница 169: ...144 Serial Communications Board Section 2 6...
Страница 537: ......
Страница 565: ......
Страница 569: ......
Страница 573: ......
Страница 577: ......