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