Delta DVP-ES2 User Manual Page 496

  • Download
  • Add to my manuals
  • Print
  • Page
    / 702
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 495
DVP-ES2/EX2/SS2/SA2/SX2/SE Operation Manual - Programming
3-380
API Mnemonic Operands Function
163
TSUB P
Time subtraction
Controllers
ES2/EX2 SS2 SA2
SE
SX2
Bit Devices Word devices Program Steps Type
OP
X Y M S K H KnX KnY KnM KnS T C D E F
S
1
* * *
S
2
* * *
D * * *
TSUB, TSUBP: 7 steps
PULSE 16-bit 32-bit
ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2
Operands:
S
1
: Time minuend (occupies 3 consecutive devices) S
2
: Time subtrahend (occupies 3
consecutive devices) D: Subtraction result (occupies 3 consecutive devices)
Explanations:
1. TSUB instruction subtracts the time value (Hour, Minute Second) S
1
with the time value (Hour,
Minute Second) S
2
and stores the result in D.
2. If operand S
1
, S
2
exceed the available range, operation error occurs and M1067 = ON, M1068
= ON. D1067 stores the error code 0E1A (HEX).
3. If the subtraction result is a negative value (less than 0), Borrow flag M1020 = ON and the
value in D will be the result of “the negative value pluses 24 hours”.
4. If the subtraction result (remainder) equals 0 (00:00:00), Zero flag M1020 will be ON.
5. Besides using TRD instruction, MOV instruction can also be used to move the RTC value to
D1315 (Hour), D1314 (Minute), D1313 (Second) for reading the current time of RTC..
Program Example:
When X0 = ON, TSUB instruction executes and the time value in D0~D2 is subtracted by the time
value in D10~D12. The subtraction result is stored in D20~D22.
20:20:05 14:30:08 05:49:57
X0
TSUB D0 D10 D20
D0 20(Hour)
D1 20(Min)
D2 05(Sec)
D20 05(Hour)
D21 49(Min)
D22 57(Sec)
D10 14(Hour)
D11 30(Min)
D12 08(Sec)
If the subtraction result is a negative value (less than 0), Borrow flag M1021 = ON.
Page view 495
1 2 ... 491 492 493 494 495 496 497 498 499 500 501 ... 701 702

Comments to this Manuals

No comments