E L C P r o g r a m m i n g M a n u a l
F o r m o r e i nf o r m a t i o n v i sit :
w w w. e a t o n . c o m
MN05003003E
3-64
API Mnemonic
Operands
Function
19
D BIN P
S, D
Convert BCD to BIN
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
*
*
*
*
*
*
*
*
BIN, BINP: 5 steps
DBIN, DBINP: 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.
Converts BCD data (0 to 9,999) of
S
into BIN and transfer the result to
D
.
2.
The valid range of source
S
: BCD (0 to 9,999), DBCD (0 to 99,999,999)
3.
If the content of
S
is not a valid BCD value, an operation error will occur, error flags M1067 and
M1068 =ON, and D1067 holds error code H0E18.
4.
If operand S and D use index register F, only a 16-bit compare is available.
5.
Flags: M1067 (operation error), M1068 (operation error), D1067 (error code)
Program Example:
When X0=ON, the BCD data K1X20 is converted to BIN data, and result stored at D10.
X0
BIN
D10
K1X20
1.
The BIN instruction is used to covert the source data into BIN data. An example could be when
the ELC reads a BCD value from a thumbwheel switch and this BCD value needs to be
converted to BIN.
2.
When X0=ON, convert K4X20 (BCD data) into BIN data and move it to D100. Then, convert
BIN data of D100 into BCD data and move it to K4Y20.
BCD
D100
K4Y20
X0
BIN
D100
K4X20
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...