Справочник Пользователя для Mitsubishi Electronics Mitsubishi Digital Electronics Welding System FXCPU

Скачать
Страница из 236
5 Applied Functions
5.1 Type Conversion Functions
72
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
*1.
Output variable
2. Set data
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 
 into BCD data, and outputs the
data obtained by conversion to a device specified in 
.
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 
 is outside the range from "0" to
"9,999".
FX
3U(C)
FX
3G
FX
2N(C)
FX
1N(C)
FX
1S
FX
U
/FX
2C
FX
0N
FX
0(S)
Function name
Expression in each language
Structured ladder
ST
INT_TO_BCD
INT_TO_BCD(_INT);
Example:
D10:=
INT_TO_BCD(D0);
INT_TO_BCD_E
INT_TO_BCD_E(EN,_INT,
Output label);
Example:
INT_TO_BCD_E(X000,D0,D10);
Variable
Description
Data type
Input
variable
EN
Execution condition
Bit
_INT (
)
Conversion source word [signed] data
Word [signed]
Output
variable
ENO
Execution status
Bit
*1
(
)
BCD data after conversion
Word [unsigned]/
Bit String [16-bit]
INT_TO_BCD
_INT
*1
D10
D0
INT_TO_BCD_E
EN
ENO
*1
D10
X000
D0
_INT
s
d
s
d
0
0
1
0
0
1
1
1
0
0
0
0
1
1
1
1
9999
9999H
Word [signed] data
Word [unsigned]/
bit string [16-bit] data
Conversion into BCD data
Make sure to set them to "0".  
9999
9999H
Thousands place
Hundreds place
Tens place
Ones place
32768 16384
128
256
512
64
32
16
8
4
2
1
0
1
0
1
1
0
0
1
1
0
0
1
1
0
0
1
8
4
2
1
8000 4000 2000 1000 800
400
200
100
80
40
20
10
8192 4096 2048 1024
s