9 binary-to-bcd (bcd), Joverview, Jdescription designation method – Yaskawa MP900 Series Motion Programming Manual User Manual
Page 168: Data types, Jprogramming examples
4.6 Basic Functions
4 -35
4.6.9 BINARY-TO-BCD (BCD)
J
Overview
The BCD command converts binary data to BCD data.
Only integer data can be used. If the binary data is 9999 or higher or is a negative value, a cor-
rect result cannot be obtained.
J
Description
Designation Method
MW00100=BCD(MW00101);
MW00100=BCD(1234);
MF00200=BCD(ML00202);
Data Types
Bit (B)
Integer (W)
Double Integer
(L)
Real Number
(F)
Constant
No
Yes
Yes
No
Yes
J
Programming Examples
Type
Motion Program
Ladder Logic Program
B
−
−
W
MW00101=BCD(MW00100);
MW00100 BCD
⇒ MW00101
L
ML00102=BCD(ML00100);
ML00100 BCD
⇒
ML00102
F
−
−
Example 1:
MW00101
Conversion
MW00100
2
3
4
1
4
D
2
0
(1234H)
1234 (decimal)
Example 2:
0
3
9
3
MW00101
Conversion
3
4
5
C
MW00100
(C345H)
12345 (decimal)
If the binary data is greater than 9999, a correct result cannot be obtained.
4
A
EXAMPLE
"
INFO