Division - Mitsubishi Electric R16MTCPU Programming Manual

Hide thumbs Also See for R16MTCPU:
Table of Contents

Advertisement

Division: /

Format
(S1)/(S2)
Setting data
■Usable data
: Usable
Setting
Usable Data
data
Bit
device
(S1)
(S2)
■Description, data type of result
Setting data
(S1)
(S2)
Processing details
• The data specified with (S1) is divided by the data specified with (S2) to find a quotient.
• When (S1) and (S2) differ in data type, the data of the smaller data type is converted into that of the greater type before
operation is performed.
Operation error
An operation error will occur if:
• (S2) is 0.
• (S1) or (S2) is an indirectly specified device and its device No. is outside the range.
Program example
■Program which divides K456 by #0 and substitutes a quotient to W0
W0 = K456 / #0
W0
3
■Program which divides #0F by #10 and substitutes a quotient to D0L
D0L = #0F / #10
D1
D0
D0L
100
The 64-bit floating-point type data are used for division, and the quotient is converted into the 32-bit integer type and then
substituted.
4 OPERATION CONTROL PROGRAMS
136
4.5 Binary Operations
Number of basic steps
7
Word device
16-bit
32-bit
64-bit
integer
integer
floating
type
type (L)
point
type (F)
Description
Dividend data
Divisor data
100.3722683
Usable steps
F/FS
Constant
16-bit
32-bit
64-bit
integer
integer
floating
type
type
point
(K/H)
(K/H, L)
type (K)
456
/
#0
123
#3
#2
#1
#0F
12345.789
/
#10
123
G
Calculation
Bit
expression
conditional
expression
Data type of result
Data type of (S1) or (S2) which is greater
#0
Comparison
conditional
expression

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R64mtcpuMelsec iq-r seriesR32mtcpu

Table of Contents