5.1 Type Conversion Functions
5.1.33
BCD type
→
word (signed), double word (signed) type conversion
5-101
5
APPLICATION
FUNCTIONS
BCD_TO_INT(_E),
BCD_TO_DINT(_E)
BCD_TO_INT(_E), BCD_TO_DINT(_E)
5.1.33
BCD type
→
word (signed), double word (signed) type conversion
BCD_TO_INT(_E), BCD_TO_DINT(_E)
Function
Operation processing
(1) BCD_TO_INT, BCD_TO_INT_E
(a) Converts BCD type data input to into word (signed) type data, and outputs the
operation result from .
(b) The value to be input to is word (unsigned)/16-bit string type data within the range
from 0
H to 9999H (0 to 9 for each digit).
BCD_TO_INT(_E)
BCD_TO_DINT(_E)
_E: With EN/ENO
indicates any of the following
functions.
BCD_TO_INT BCD_TO_INT_E
BCD_TO_DINT BCD_TO_DINT_E
Input argument, EN:
Executing condition (TRUE: Execution, FALSE: Stop) :Bit
s:
Input :Word (unsigned)/16-bit string, double word
(unsigned)/32-bit string
Output argument, ENO:
Output status (TRUE: Normal, FALSE: Error) :Bit
d:
Output :Word (signed), double word (signed)
Universal
UD
High
Performance
EN ENO
ds
BCD_TO_INT_E
(EN, s, d);ENO:=
Structured ladder
ST
BCD_TO_INT_E
s
d
Word (unsigned)/16-bit string type
Thousand's place Hundred's place Ten's place Unit's place
9999H
Word (signed) type
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
9999
H
INT conversion
Always filled with 0s.
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