Bcd_To_Int(_E) - Mitsubishi Electric MELSEC FX Series Structured Programming Manual

Hide thumbs Also See for MELSEC FX Series:
Table of Contents

Advertisement

FXCPU Structured Programming Manual
(Application Functions)

5.1.41 BCD_TO_INT(_E)

Outline
This function converts BCD data into word [signed] data, and outputs the data obtained by conversion.
1. Format
Function name
BCD_TO_INT
BCD_TO_INT_E
*1.
Output variable
2. Set data
Variable
EN
Input
variable
_BCD (
ENO
Output
variable
*1
In explanation of functions, I/O variables inside ( ) are described.
Explanation of function and operation
This function converts BCD data stored in a device specified in
data obtained by conversion to a device specified in
9999H
Word [unsigned]/
bit string [16-bit] data
8000 4000 2000 1000 800 400 200 100
9999H
1
0
Thousands place Hundreds place
3276516354 8192 4095 2048 1024 512 256 128
0
0
9999
Always becomes "0".
Cautions
Use the function having "_E" in its name to connect a bus.
Error
When the source data is not BCD (decimal number), M8067 (operation error) turns ON.
118
FX
3U(C)
Expression in each language
Structured ladder
BCD_TO_INT
D0
_BCD
X000
BCD_TO_INT_E
EN
D0
_BCD
Execution condition
Conversion source BCD data
)
s
Execution status
Word [signed] data after conversion
(
)
d
Word [signed] data
80
0
1
1
0
0
1
1
1
0
0
1
1
1
0
FX
FX
FX
3G
2N(C)
1N(C)
BCD_TO_INT(_BCD);
Example:
D10:=
*1
D10
BCD_TO_INT(D0);
BCD_TO_INT_E(EN,_BCD,
Output label);
ENO
Example:
*1
D10
BCD_TO_INT_E(X000,D0,D10);
Description
s
.
d
9999
40
20
10
8
4
2
0
0
1
1
0
0
Tens place
Ones place
Conversion into word [signed] data
64
32
16
8
4
2
0
0
0
1
1
1
5 Applied Functions
5.1 Type Conversion Functions
FX
FX
/FX
FX
1S
U
2C
ST
Data type
Bit
Word [unsigned]/
Bit String [16-bit]
Bit
Word [signed]
into word [signed] data, and outputs the
1
1
1
1
FX
0N
0(S)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx-kp-ok-e09r927

Table of Contents