5-2
5.1 Type Conversion Functions
5.1.1 Bit type
→
word (signed), double word (signed) type conversion
BOOL_TO_INT(_E), BOOL_TO_DINT(_E)
5.1 Type Conversion Functions
5.1.1 Bit type → word (signed), double word (signed) type
conversion
BOOL_TO_INT(_E), BOOL_TO_DINT(_E)
Function
Operation processing
(1) BOOL_TO_INT, BOOL_TO_INT_E
Converts bit type data input to into word (signed) type data, and outputs the operation
result from .
When the input value is FALSE, 0 is output in word (signed) type data.
When the input value is TRUE, 1 is output in word (signed) type data.
BOOL_TO_INT(_E)
BOOL_TO_DINT(_E)
_E: With EN/ENO
indicates any of the following
functions.
BOOL_TO_INT BOOL_TO_INT_E
BOOL_TO_DINT BOOL_TO_DINT_E
Input argument, EN:
Executing condition (TRUE: Execution, FALSE: Stop) :Bit
s:
Input :Bit
Output argument, ENO:
Output status (TRUE: Normal execution, FALSE: Error or stop) :Bit
d:
Output :Word (signed), double word (signed)
Universal
UD
High
Performance
EN ENO
ds
BOOL_TO_INT_E
(EN, s, d);ENO:=
Structured ladder
ST
BOOL_TO_INT_E
s
d
Bit type
TRUE
FALSE
Word (signed) type
1
0