beautypg.com

Sample program, 2 instructions, Cadd – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 420: Csub

background image

2 Instructions

2-384

CP1E CPU Unit Instructions Reference Manual(W483)

Sample program

CADD

When CIO 0.00 turns ON in the following example, the calendar data in D100 through D102 (year,
month, day, hour, minutes, seconds) is added to the time data in D200 and D201 (hours, minutes, sec-
onds) and the result is output to D300 through D302.

CSUB

When CIO 0.00 turns ON in the following example, the time data in D200 and D201 (hours, minutes,
seconds) is subtracted from the calendar data in D100 through D102 (year, month, day, hour, minutes,
seconds) and the result is output to D300 through D302.

CADD

D100

D200

D300

0.00

C

T

R

C:D100

D101
D102

30
10
99

20
18
12

15

7

0

8

0

8

0

8

T:D200

D201

10
06

+

15
00

15

7

R:D300

D301
D302

40
04
00

35
18
01

15

7

18:30:20

18:40:35

10 December, 1999

10 minutes, 15 seconds

600 hours

4 January, 2000

CSUB

D100

D200

D300

0.00

C

T

R

C:D100

D101
D102

30
10
98

20
18
07

15

7

8

0

T:D200

D201

10
00

15
50

15

7

8

0

R:D300

D301
D302

20
08
98

05
16
07

15

7

8

0

18:30:20

16:20:05

10 July, 1998

50 hours, 10 minutes, 15 seconds

8 July, 1998

This manual is related to the following products: