5-48
5.1 Type Conversion Functions
5.1.16 Double-precision real type
→
word (signed), double word (signed) type conversion
LREAL_TO_INT(_E), LREAL_TO_DINT(_E)
5.1.16 Double-precision real type → word (signed), double word
(signed) type conversion
LREAL_TO_INT(_E), LREAL_TO_DINT(_E)
Function
Operation processing
(1) LREAL_TO_INT, LREAL_TO_INT_E
(a) Converts double-precision real type data input to into word (signed) type data, and
outputs the operation result from .
(b) The value to be input to is double-precision real type data, within the range from
−32768 to 32767.
(c) The converted data is the value rounded double-precision real type data to the first digit
after the decimal point.
LREAL_TO_INT(_E)
LREAL_TO_DINT(_E)
_E: With EN/ENO
indicates any of the following
functions.
LREAL_TO_INT LREAL_TO_INT_E
LREAL_TO_DINT LREAL_TO_DINT_E
Input argument, EN:
Executing condition (TRUE: Execution, FALSE: Stop) :Bit
s:
Input :Double-precision real
Output argument, ENO:
Output status (TRUE: Normal, FALSE: Error) :Bit
d:
Output :Word (signed), double word (signed)
Universal
UD
EN ENO
ds
LREAL_TO_INT_E
(EN, s, d);ENO:=
Structured ladder
ST
LREAL_TO_INT_E
s
d
Double-precision real type
1234.0
Word (signed) type
1234
s