3 . I n s t r u c t i o n S e t
M N050 03003E F or mo re infor ma tio n vi sit:
w w w. e a t o n . c o m
3-63
API Mnemonic
Operands
Function
18
D BCD P
S, D
Convert BIN to BCD
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C D E
F
S
*
*
*
*
*
*
*
*
*
D
*
*
*
*
*
*
*
*
BCD, BCDP: 5 steps
DBCD, DBCDP: 9 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
S
: Source
D
: Converted result
Description:
1.
Convert BIN data (0 to 9999) of
S
into BCD and transfer the result to
D
.
2.
If the BCD conversion result is outside the valid range of 0 to 9999 (16-bit) or 0 to 99,999,999
(32-bit), an operation error occurs, the error flag M1067 and M1068 =ON, and D1067 will hold
error code H0E18.
3. If
operand
S
and
D
use index register F, only 16-bit values are available.
4.
Flags: M1067 (operation error), M1068 (operation error), D1067 (error code)
Program Example:
1.
When X0=ON, the binary data D10 is converted into BCD number, and stored at K1Y0
(Y0~Y3).
BCD
D10
K1Y0
X0
2.
When D10=001E (Hex) =0030(decimal), the result will be Y0~Y3=0000(BIN).
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...