15 TYPE CONVERSION FUNCTIONS
15.33 Converting BCD to INT
729
15
15.33 Converting BCD to INT
BCD_TO_INT(_E)
These functions convert BCD type data to INT type data.
â– Descriptions, types, and data types
â– Operation processing
• These functions convert the BCD type data input to (s) to INT type data and output from (d).
• 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).
Ladder diagram Structured text
[Without EN/ENO] [With EN/ENO] [Without EN/ENO]
d:=BCD_TO_INT(s);
[With EN/ENO]
d:=BCD_TO_INT_E(EN,ENO,s);
Argument Description Type Data type
EN Execution condition (TRUE: Execution, FALSE: Stop) Input variable BOOL
s Input Input variable WORD
ENO Output status (TRUE: Normal, FALSE: Abnormal) Output variable BOOL
d Output Output variable INT
BCD
Thousands place Hundreds place Tens place Ones place
9999H
INT
9999
9999 0
1
1
1
1
0
1
0
0
1
0
1
1
0
0
0
0
1
0
0
0
0
0
1
1
1
1
0
1
0
1
1
9999H
INT conversion
Always becomes "0".
8000 4000
3276816384
2000
8192
1000
4096
800
2048
400
1024
200
512
100
256
80
128
40
64
20
32
10
16
8
8
4
4
2
2
1
1
(s)
(d)