Double-Precision Real Type → Word (Signed), Double Word (Signed) Type Conversion - Mitsubishi Melsec-Q Series Structured Programming Manual

Application functions, qcpu
Hide thumbs Also See for Melsec-Q Series:
Table of Contents

Advertisement

LREAL_TO_INT(_E), LREAL_TO_DINT(_E)
Operation Error
An operation error occurs in the following cases.
• The input value is -0 or outside the following range.
0, 2
• LREAL_TO_INT(_E): The input value is outside the range of -32768 to 32767.
• LREAL_TO_DINT(_E): The input value is outside the range of -2147483648 to
2147483647.
Program Example
(1) The program which converts double-precision real type data input to
type data, and outputs the operation result from
(a) Function without EN/ENO (LREAL_TO_INT)
[Structured ladder]
[ST]
(b) Function with EN/ENO (LREAL_TO_INT_E)
[Structured ladder]
[ST]
(2) The program which converts double-precision real type data input to
(signed) type data, and outputs the operation result from
(a) Function without EN/ENO (LREAL_TO_DINT)
[Structured ladder]
[ST]
5.1 Type Conversion Functions
5-50
5.1.16 Double-precision real type
-1022
1024
|
,
|
2
s
d
g_int1:= LREAL_TO_INT(g_lreal1);
g_bool3 := LREAL_TO_INT_E(g_bool1, g_lreal1, g_int1);
g_dint1:= LREAL_TO_DINT(g_lreal1);
word (signed), double word (signed) type conversion
(Error code: 4140)
(Error code: 4140)
(Error code: 4140)
into word (signed)
s
.
d
into double word
s
.
d

Advertisement

Table of Contents
loading

This manual is also suitable for:

Q-kp-ok-e13jw08

Table of Contents