Bin -> Bcd Conversion: Bcd - Mitsubishi Electric R16MTCPU Programming Manual

Hide thumbs Also See for R16MTCPU:
Table of Contents

Advertisement

BIN -> BCD conversion: BCD
Format
BCD(S)
Setting data
■Usable data
: Usable
Setting
Usable Data
data
Bit
Word device
device
16-bit
integer
type
(S)
■Description, data type of result
Setting data
Description
(S)
BIN data which will be converted into BCD data
Processing details
• The BIN data specified with (S) is converted into BCD data.
• If (S) is a 16-bit integer type, the data range is 0 to 9999.
• If (S) is a 32-bit integer type, the data range is 0 to 99999999.
Operation error
An operation error will occur if:
• The data is other than 0 to 9999 when (S) is a 16-bit integer type.
• The data is other than 0 to 99999999 when (S) is a 32-bit integer type.
• (S) is an indirectly specified device and its device No. is outside the range.
Program example
■Program which converts the BIN data of D0 into BCD data and substitutes the result to #0
#0 = BCD(D0)
BCD 9999
b15
#0
1
0 1 1 0 1 0
0
0 1
0 1 0
1 0 1
Thousands Hundreds Tens Units
Number of basic steps
4
Constant
32-bit
64-bit
16-bit
integer
floating
integer
type (L)
point
type
type (F)
(K/H)
b0
b15
D0
0
0 1 0 0 1 1 1 0 0 0 0 1 1 1 1
Usable steps
F/FS
Calculation
expression
32-bit
64-bit
integer
floating
type
point
(K/H, L)
type (K)
BIN 9999
b0
4 OPERATION CONTROL PROGRAMS
G
Bit
Comparison
conditional
conditional
expression
expression
Data type of result
Data type of (S) (Integer type)
4.7 Standard Functions
4
159

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R64mtcpuMelsec iq-r seriesR32mtcpu

Table of Contents