Mitsubishi Electric MELSEC-Q/L Programming Manual page 59

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

■Operation result
• Function without EN/ENO
The following table shows the operation results.
Operation result
No operation error
Operation error
• Function with EN/ENO
The following table shows the executing conditions and operation results.
EN
TRUE (Operation execution)
FALSE (Operation stop)
*1 When FALSE is output from ENO, the data output from (d) is undefined. In this case, create a program so that the data output from (d) is
not used.
Operation error
• An operation error occurs in the following cases.
Error
Description
code
4140
The input value is -0 or outside the following range.
-1022
1024
|(s)|<2
0, 2
When the LREAL_TO_INT(_E) instruction is used, the input value is outside
the range of -32768.0 to 32767.0.
When the LREAL_TO_DINT(_E) instruction is used, the input value is
outside the range of -2147483648.0 to 2147483647.0.
Program example
■LREAL_TO_INT(_E)
The program which converts double-precision real type data input to (s) into word (signed) type data, and outputs the
operation result from (d).
• Function without EN/ENO (LREAL_TO_INT)
[Structured ladder/FBD]
[ST]
g_int1:= LREAL_TO_INT(g_lreal1);
• Function with EN/ENO (LREAL_TO_INT_E)
[Structured ladder/FBD]
[ST]
g_bool3 := LREAL_TO_INT_E(g_bool1, g_lreal1, g_int1);
■LREAL_TO_DINT(_E)
The program which converts double-precision real type data input to (s) into double word (signed) type data, and outputs the
operation result from (d).
• Function without EN/ENO (LREAL_TO_DINT)
[Structured ladder/FBD]
[ST]
g_dint1 := LREAL_TO_DINT(g_lreal1);
(d)
Operation output value
Undefined value
ENO
TRUE (No operation error)
*1
FALSE
(d)
Operation output value
Undefined value
Q00J/
QnH
QnPH
QnPRH
Q00/
Q01
5 APPLICATION FUNCTIONS
5.1 Type Conversion Functions
5
QnU
LCPU
57

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents