Signed 32-Bit Integer Value Conversion: Long - Mitsubishi Electric R16MTCPU Programming Manual

Hide thumbs Also See for R16MTCPU:
Table of Contents

Advertisement

Signed 32-bit integer value conversion: LONG

Format
LONG(S)
Setting data
■Usable data
: Usable
Setting
Usable Data
data
Bit
device
(S)
■Description, data type of result
Setting data
Description
(S)
Data which will be converted into signed 32-bit integer value
Processing details
• The data specified with (S) is converted into a signed 32-bit integer value.
• The data range of (S) is -2147483648 to 2147483647.
• When (S) is a 64-bit floating-point type, its fractional portion is rounded down before conversion is made.
• If (S) is a 32-bit integer type, its value is returned unchanged, with no conversion processing performed.
Operation error
An operation error will occur if:
• The (S) data is outside the range -2147483648 to 2147483647.
• (S) is an indirectly specified device and its device No. is outside the range.
Program example
■Program which converts the data of D0 into a signed 32-bit integer value and substitutes the
result to #0L
#0L = LONG(D0)
#1
#0
#0L
K-1L
(HFFFFFFFF)
4 OPERATION CONTROL PROGRAMS
170
4.9 Type Conversions
Number of basic steps
4
Word device
16-bit
32-bit
64-bit
integer
integer
floating
type
type (L)
point
type (F)
Usable steps
F/FS
Constant
16-bit
32-bit
64-bit
integer
integer
floating
type
type
point
(K/H)
(K/H, L)
type (K)
D0
K-1
(HFFFF)
G
Calculation
Bit
expression
conditional
expression
Data type of result
32-bit integer type
Comparison
conditional
expression

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R64mtcpuMelsec iq-r seriesR32mtcpu

Table of Contents