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

Hide thumbs Also See for R16MTCPU:
Table of Contents

Advertisement

BCD -> BIN conversion: BIN
Format
BIN(S)
Setting data
■Usable data
: Usable
Setting
Usable Data
data
Bit
device
(S)
■Description, data type of result
Setting data
(S)
Processing details
• The BCD data specified with (S) is converted into BIN 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:
• A value other than 0 to 9 is in any digit of (S).
• (S) is an indirectly specified device and its device No. is outside the range.
Program example
■Program which converts the BCD data of D0 into BIN data and substitutes the result to #0
#0 = BIN(D0)
BIN 9999
b15
#0
0
0 1 0 0 1 1 1 0 0 0 0 1 1 1 1
4 OPERATION CONTROL PROGRAMS
158
4.7 Standard Functions
Number of basic steps
4
Word device
16-bit
32-bit
64-bit
integer
integer
floating
type
type (L)
point
type (F)
Description
BCD data which will be converted into BIN data
b0
Usable steps
F/FS
Constant
16-bit
32-bit
64-bit
integer
integer
floating
type
type
point
(K/H)
(K/H, L)
type (K)
BCD 9999
b15
b0
D0
1
0 1 1 0 1 0
0
0 1
0 1 0
1 0 1
Thousands Hundreds Tens Units
G
Calculation
Bit
expression
conditional
expression
Data type of result
Data type of (S) (Integer type)
Comparison
conditional
expression

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R64mtcpuMelsec iq-r seriesR32mtcpu

Table of Contents