Download Print this page

Converting Int To Bcd - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

18.21

Converting INT to BCD

INT_TO_BCD(_E)
These functions convert INT type data to BCD type data.
Ladder diagram, FBD/LD
[Without EN/ENO]
s
d
Setting data
■Descriptions, types, and data types
Argument
EN
s(IN)
ENO
d(INT_TO_BCD(_E))
Processing details
■Operation processing
• These functions convert the INT type data input to (s) to BCD type data and output from (d).
(s)
9999
INT
3276816384
8192
9999
0
0
1
(1)
8000 4000
2000
9999H
1
0
0
×10
3
(1): Make sure to set them to "0".
• A value input to (s) is the INT type data value and within the range from 0 to 9999.
■Operation result
1.
Function without EN/ENO
The following table lists the operation results.
Operation result
No operation error occurred
An operation error occurred
2.
Function with EN/ENO
The following table lists the execution conditions and operation results.
Execution condition
EN
TRUE (Executes operation)
FALSE (Stops operation)
*1 When FALSE is output from ENO, data output from (d) is undefined. In that case, modify a program so that the data output from (d) is
not used.
18 TYPE CONVERSION FUNCTIONS
922
18.21 Converting INT to BCD
[With EN/ENO]
EN
ENO
s
Description
Execution condition (TRUE: Execution, FALSE: Stop)
Input
Output status (TRUE: Normal, FALSE: Abnormal)
Output
4096
2048
1024
512
256
128
64
0
0
1
1
1
0
0
BCD
1000
800
400
200
100
80
40
1
1
0
0
1
1
0
×10
2
×10
Operation result
ENO
TRUE (Operation error did not occur)
FALSE (Operation error occurred)
FALSE
Structured text
[Without EN/ENO]
d:=INT_TO_BCD(s);
[With EN/ENO]
d:=INT_TO_BCD_E(EN,ENO,s);
d
(d)
9999H
BCD
32
16
8
4
2
1
0
0
1
1
1
1
20
10
8
4
2
1
0
1
1
0
0
1
1
×10
0
(d)
Operation output value
Indefinite value
*1
*1
Type
Data type
Input variable
BOOL
Input variable
INT
Output variable
BOOL
Output variable
WORD
(d)
Operation output value
Indefinite value
Indefinite value

Hide quick links:

Advertisement

loading