7.15 Clock Instructions
7.15.4 Clock data subtraction
7-331
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
DA
T
E
-
DATE-
(2) If the operation results in a negative number, 24 will be added to the result to make a final
operation result.
For example, if the clock time 10:42:12 were subtracted from 4:50:32, the result would not
be 6:8:20, but rather would be 18:8:20.
Remark
For further information regarding the data that can be set for hours, minutes, and
seconds, refer to Section 7.15.2.
O
peration Error
In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and
the corresponding error code is stored to SD0.
• The value set for
and
is outside of the setting range.
(Error code: 4100)
• The device specified for
,
or
exceeds the corresponding device range. (For
Universal model QCPU only)
(Error code: 4101)
Program Example
In the following program, the time data stored in Var_D10 and the following devices are
subtracted from the clock data read from the clock element when X1C turns ON, and the result is
stored to Var_R10 and the following devices.
[Structured ladder]
H
our
: 10
Mi
nute
: 42
S
econ
d: 12
H
our
: 18
Mi
nute
: 8
S
econ
d: 20
H
our
: 4
Mi
nute
: 50
S
econ
d: 32
s
1
s
2
d
s
1
s
1
s
2
s
2
d
d
[1]
[0]
[2]
[1]
[0]
[2]
[1]
[0]
[2]
s
1
s
2
s
1
s
2
d
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......