Download Print this page

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

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

Advertisement

18.33

Converting BCD to INT

BCD_TO_INT(_E)
These functions convert BCD type data to INT type data.
Ladder diagram, FBD/LD
[Without EN/ENO]
s
d
Setting data
■Descriptions, types, and data types
Argument
Description
EN
Execution condition (TRUE: Execution, FALSE: Stop)
s(IN)
Input
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
d(BCD_TO_INT(_E))
Output
Processing details
■Operation processing
• These functions convert the BCD type data input to (s) to INT type data and output from (d).
(s)
9999H
BCD
8000 4000
2000
1000
800
9999H
1
0
0
1
1
×10
3
3276816384
8192
4096
2048
9999
0
0
1
0
0
(1)
(1): Always becomes "0".
• A value input to (s) is the WORD type data value and within the range from 0H to 9999H (from 0 to 9 for each digit).
■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.
[With EN/ENO]
EN
ENO
s
d
400
200
100
80
40
20
10
0
0
1
1
0
0
1
×10
2
×10
1
INT
1024
512
256
128
64
32
16
1
1
1
0
0
0
0
Operation result
ENO
TRUE (Operation error did not occur)
FALSE (Operation error occurred)
*1
FALSE
Structured text
[Without EN/ENO]
d:=BCD_TO_INT(s);
[With EN/ENO]
d:=BCD_TO_INT_E(EN,ENO,s);
Type
Input variable
Input variable
Output variable
Output variable
(d)
9999
INT
8
4
2
1
1
0
0
1
×10
0
8
4
2
1
1
1
1
1
(d)
Operation output value
Indefinite value
(d)
Operation output value
*1
Indefinite value
Indefinite value
18 TYPE CONVERSION FUNCTIONS
Data type
BOOL
WORD
BOOL
INT
18.33 Converting BCD to INT
18
939

Hide quick links:

Advertisement

loading