Nj-Series Instructions Reference Manual (W502 - Omron NJ501-1500 Reference Manual

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

2 Instruction Descriptions
LREAL data
In
LREAL#6.5536e+4
Conversion is performed using the following procedure.
1
The fractional part of the value of In is rounded off to the closest integer as described below.
2
The resulting integer is taken as an unsigned integer and output as a bit string.
The following table shows how values are rounded.
Value of
fractional
part
Less than
0.5
0.5
Greater
than 0.5
The following table gives some conversion examples.
Value of
In
1.6
2
3.5
4
−1.6
−2
The following table shows the valid ranges for In and Out according to their data types.
Data
Data type
type of In
BYTE
WORD
REAL
DWORD
LWORD
BYTE
WORD
LREAL
DWORD
LWORD
Additional Information
To convert a bit string to a real number, use a **_TO_*** (Bit String-to-Real Number Conversion Group)
instruction (page 2-244).
Precautions for Correct Use
• Always use the correct instruction name for the data types of In and Out.
• If the conversion result exceeds the valid range of Out, Out will contain an illegal value.
2-250
Out=abc
16#0001_0000
Treatment
The fractional part is truncated.
If the ones digit is an even number, the fractional part
is truncated. If it is an odd number, the value is
rounded up.
The fractional part is rounded up.
Value of
Integer
Out
16#0002
16#0004
16#FFFE
Valid range for In
of Out
−1.285999e+2 to 1.274999e+2
−3.276859e+4 to 3.276749e+4
−2.147483e+9 to 2.147483e+9
−9.223372e+18 to 9.223372e+18
−1.28599999999999e+2 to
1.27499999999999e+2
−3.27685999999999e+4 to
3.27674999999999e+4
−2.14748364859999e+9 to
2.14748364749999e+9
−9.22337203685477e+18 to
9.22337203685477e+18
DWORD data
Examples
1.49 → 1
−1.49 → −1
1.50 → 2
2.50 → 2
−1.50 → −2
−2.50 → −2
1.51 → 2
−1.51 → −2
16#00 to 16#FF
16#0000 to 16#FFFF
16#0000_0000 to 16#FFFF_FFFF
16#0000_0000_0000_0000 to
16#FFFF_FFEE_FFFF_FFFF
16#00 to 16#FF
16#0000 to 16#FFFF
16#0000_0000 to 16#FFFF_FFFF
16#0000_0000_0000_0000 to
16#FFFF_FFFF_FFFF_FFFF

NJ-series Instructions Reference Manual (W502)

Valid range for Out

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents