Chapter 7 Second Development PlatformVP3000
359
API Instruction code Operand Function
172 D ADDR P S
1
, S
2
, D
Floating-point number addition
Type
Operand
Bit devices Word devices
16-bit instruction
- - - -
32-bit instruction (13 steps)
DADDR
Continuous
execution
type
DADDRP
Pulse
execution
type
Associated flag: none
X Y M K H KnX KnY KnM T C D
S
1
S
2
D
Caution for using operand
The floating-point values (e.g. F1.2) can be entered directly into S
1
and S
2
The floating-point value after the operation will be stored in operand
D
Description
S
1
: floating-point number summand
S
2
: floating-point number addend
D: sum (floating-point)
When the floating-point values of S
1
and S
2
are stored in the register D, its function is the
same as API 120 DEADD.
S
1
and S
2
can designate the same register. In this case, if the instruction is specified as
“continuous execution type” instruction (pulse execution type DADDRP is generally used) and
the drive contact is ON, the register will be added once in every scan.
If the absolute value of the operation result is larger than the maximum floating-point
displayable, the carry flag M1022 = ON. If the absolute value of the operation result is smaller
than the maximum floating-point displayable, the carry flag M1021 = ON. If the operation
result = 0, zero flag M1020 = ON.
Example
Example 1
When X0 = ON, add the floating-point value F1.200E+0 (input the floating-point number F1.2,
the ladder diagram shows a scientific notation F1.200E+0. You can set the floating-point digit
by using WPLSoft) to the floating-point value F2.200E+0, the operation result is F3.400E+0
and is stored in the register (D10, D11).
X0
DADDR F1.200E+0
D10
F2.200E+0
Example 2
When X0 = ON, the floating-point numbers (D1, D0) add the floating-point numbers (D3, D2),
and stores the result in (D11, D10).
X0
DADDR D0 D2 D10