Mitsubishi Electronics FXCPU Welding System User Manual


 
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".
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S
FX
U
/FX
2C
FX0N FX0(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
D10D0
INT_TO_BCD_E
EN ENO
*1
D10
X000
D0
_INT
s
d
s
d
0010011100001111
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
3276816384 128256512 64 32 16 8 4 2 1
0101100110011001
84 21
8000 4000 2000 1000 800 400 200 100
80
40 20 10
8192 4096 2048 1024
s