Converting Bcd To Int - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

25.37

Converting BCD to INT

BCD_TO_INT(_E)
RnPCPU
RnCPU RnENCPU
(Process)
These functions convert a value from BCD data type to INT data type.
Ladder, FBD/LD
[Without EN/ENO]
s
d
Setting data
■Description, type, data type
Argument
EN
s (IN)
ENO
d
Processing details
■Operation processing
• These functions convert the value input to (s) from BCD (WORD) data type to INT data type, and output the converted
value from (d).
9999H
BCD(WORD)
8000
4000
2000
9999H
1
0
0
(1)
32768
16384
8192
9999
0
0
1
(5)
(1) Thousands place
(2) Hundreds place
(3) Tens place
(4) Ones place
(5) Filled with 0s.
• Input a WORD data type value to (s) within the range of 0H to 9999H (range of each digit: 0 to 9).
■Operation result
1.
Function without EN/ENO
The operation processing is performed. The operation result is output from (d).
25 TYPE CONVERSION FUNCTIONS
1838
25.37 Converting BCD to INT
RnPCPU
RnSFCPU RnSFCPU
(Redundant)
(Standard)
(Safety)
[With EN/ENO]
EN
ENO
s
Description
Execution condition (TRUE: Executed, FALSE: Not executed)
Input
Output status (TRUE: Normal, FALSE: Abnormal)
Output
(s)
1000
800
400
200
100
80
40
1
1
0
0
1
1
0
(2)
INT
4096
2048
1024
512
256
128
64
0
0
1
1
1
0
0
Structured text
[Without EN/ENO]
d:=BCD_TO_INT(s);
[With EN/ENO]
d:=BCD_TO_INT_E(EN,ENO,s);
d
(d)
9999
INT
20
10
8
4
2
1
0
1
1
0
0
1
(3)
(4)
32
16
8
4
2
1
0
0
1
1
1
1
Type
Data type
Input variable
BOOL
Input variable
WORD
Output variable
BOOL
Output variable
INT

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents