Chapter 7 Second Development PlatformVP3000
367
API Instruction code Operand Function
162 TADD P S
1
, S
2
, D
Time addition
Type
Operand
Bit devices Word devices
16-bit instruction (7 steps)
TADD
Continuous
execution
type
TADDP
Pulse
execution
type
32-bit instruction
- - - -
Associated flag:
M1020: Zero flag
M1022: Carry flag
M1068 RTC error
X Y M K H KnX KnY KnM T C D
S
1
S
2
D
Caution for using operand
See the specification of each model for the scope of device’s usage.
Description
S
1
: time augend
S
2
: time addend
D: time sum
Add the hour, minute, second that S
1
designates and the hour, minute, second that S
2
designates, the result is stored in the hour, minuet, second of the register that D designates.
If S
1
, S
2
exceed the range, it’s operation error, so the instruction is not executed. M1067,
M1068 = ON, and record fault code 0E1A (HEX) in D1067.
If the sum ≥ 24 hours, carry flag M1022 = ON, and the result in D is the value of the sum
minus 24 hours.
If the sum equals to 0 (00:00:00), zero flag M1020 = ON.
Example
When X10 = ON, TADD instruction is executed. The hour, minute, second that D0–D2
designate plus the hour, minute, second that D10–D12 designates, the result is stored in the
hour, minuet, second of the register that D20–D22 designates.
X10
TADD D0 D10 D20