Addition: +
Format
(S1)+(S2)
Setting data
■Usable data
: Usable
Setting
Usable Data
data
Bit
Word device
device
16-bit
integer
type
(S1)
(S2)
■Description, data type of result
Setting data
Description
(S1)
Augend data
(S2)
Addend data
Processing details
• The data specified with (S2) is added to the data specified with (S1).
• 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:
• (S1) or (S2) is an indirectly specified device and its device No. is outside the range.
Program example
■Program which substitutes the result of adding K123 and #0 to W0
W0 = K123 + #0
W0
579
■Program which substitutes the result of adding #0F and #10 to D0L
D0L = #0F + #10
D1
D0
D0L
12468
The 64-bit floating-point type data are used for addition, and the result is converted into the 32-bit integer type and then
substituted.
Number of basic steps
7
Constant
32-bit
64-bit
16-bit
integer
floating
integer
type (L)
point
type
type (F)
(K/H)
123
#0
456
#3
#0F
12468.789
Usable steps
F/FS
Calculation
expression
32-bit
64-bit
integer
floating
type
point
(K/H, L)
type (K)
+
#2
#1
#0
12345.789
+
#10
123
4 OPERATION CONTROL PROGRAMS
G
Bit
Comparison
conditional
conditional
expression
expression
Data type of result
Data type of (S1) or (S2) which is greater
4.5 Binary Operations
4
133