13 subtract time instruction (tmsub), Program example, Outline – Yaskawa MP900 Series Machine Controller New Ladder Editor User Manual

Page 49

Advertising
background image

1.2 Numeric Operation Instructions

1-39

1

„

Program Example

The time data in DW0000 to DW00101 is added to the time data in MW00100 to
MW00101.

8 hrs 40 min 32 sec + 1 hrs 22 min 16 sec

= 10 hrs 2 min 48 sec

(MW00100) (MW00101) (DW00000) (DW00001) (MW00100) (MW00101)

1.2.13 SUBTRACT TIME Instruction (TMSUB)

„

Outline

The TMSUB instruction subtracts one time (hours/minutes/seconds) from another time. The
Source is subtracted from the Dest and the result is stored in the Dest. The formats of

Source and Dest are as follows.

If the contents of the Dest and Source are with the appropriate ranges, the operation will be
performed normally. After the operation is completed, the [Status] is turned OFF. If the con-
tents of the Dest and Source are outside the data ranges, the operation is not performed. In
this case, 9999H is stored in the column "second" of the Dest, and the [Status] is turned ON.

Time Data

Before Execution

After Execution

MW00100

0840H

1002H

MW00101

0032H

0048H

DW00000

0122H

0122H

DW00001

0016H

0016H

Table 1.4 Data Format

Register Offset

Data Contents

Data Range (BCD)

0

Hours/minutes

Upper byte (hours) : 0 to 23
Lower byte (minutes) : 0 to 59

1

Seconds

0000 to 0059

Advertising
This manual is related to the following products: