Int_To_Bcd(_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.19 INT_TO_BCD(_E)

Outline
This function converts word [signed] data into BCD data, and outputs the data obtained by conversion.
1. Format
Function name
INT_TO_BCD
INT_TO_BCD_E
*1.
Output variable
2. Set data
Variable
EN
Input
variable
_INT (
ENO
Output
variable
*1
In explanation of functions, I/O variables inside ( ) are described.
Explanation of function and operation
This function converts word [signed] data stored in a device specified in
data obtained by conversion to a device specified in
Word [signed] data
32768 16384
9999
0
0
8000 4000 2000 1000 800
9999H
1
0
Thousands place Hundreds place
Cautions
Use the function having "_E" in its name to connect a bus.
Error
An operation error occurs when the value stored in a device specified in
"9,999".
72
FX
3U(C)
Expression in each language
Structured ladder
INT_TO_BCD
D0
_INT
X000
INT_TO_BCD_E
EN
D0
_INT
Execution condition
Conversion source word [signed] data
)
s
Execution status
BCD data after conversion
(
)
d
9999
bit string [16-bit] data
512
256
8192 4096 2048 1024
1
0
0
1
1
1
Make sure to set them to "0".
400
200 100
0
1
1
0
0
1
FX
FX
FX
3G
2N(C)
1N(C)
INT_TO_BCD(_INT);
Example:
D10:=
*1
D10
INT_TO_BCD(D0);
INT_TO_BCD_E(EN,_INT,
Output label);
ENO
Example:
*1
D10
INT_TO_BCD_E(X000,D0,D10);
Description
.
d
9999H
Word [unsigned]/
128
64
32
16
8
4
0
0
0
0
1
1
Conversion into BCD data
80
40
20
10
8
4
1
0
0
1
1
0
Tens place
Ones place
5 Applied Functions
5.1 Type Conversion Functions
FX
FX
/FX
1S
U
2C
ST
Bit
Word [signed]
Bit
Word [unsigned]/
Bit String [16-bit]
into BCD data, and outputs the
s
2
1
1
1
2
1
0
1
is outside the range from "0" to
s
FX
FX
0N
0(S)
Data type

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx-kp-ok-e09r927

Table of Contents