578
DATE-, DATE-P
(2) If the subtraction 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
See Page 573, Section 7.15.2 for further information regarding the data that can be set for hours, minutes, and seconds.
Operat
i
on
E
rror
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Program
E
xamp
l
e
(1) The following program subtracts the time data stored in devices starting from D10 from the clock data read from the clock
element when X1C is turned ON, and stores the result at devices starting from R10.
[Ladder Mode]
[List Mode]
[Operation]
• Time data read operation triggered by DATERDP instruction.
• Subtraction as triggered by DATE-P instruction (when 10 hours, 40 minutes, and 10 seconds have been designated
by D10 to D12).
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The value set for and is not within the setting range.
––
––
––
––
4101
The range of the device specified by , or exceeds the range of
the corresponding device.
––
––
––
––
H
our
:
10
M
i
nute
: 4
2
Second
:
12
+
1
+
2
H
our
:
18
M
i
nute
:
8
Second
:
20
+
1
+
2
H
our
: 4
M
i
nute
:
50
Second
:
32
+
1
+
2
S1
S2
D
S1
S1
S2
S2
D
D
S1
S2
S1
S2
D
Step
Instruction
De
v
ice
C
l
ock
de
vi
ce
95
4
20
D101
D102
Y
ear
Day
Month
3
21
20
1
D100
D103
D10
4
D105
D106
H
our
M
i
nute
Second
Day
of
w
eek
Ti
me
data
H
our
:
10
M
i
nute
: 4
0
Second
:
10
D11
D12
H
our
:
16
M
i
nute
: 4
1
Second
:
10
R11
R12
H
our
:
3
M
i
nute
:
21
Second
:
20
D10
4
D105
R10
D10
D103
3
:
21
:
20
-
10
:4
0
:
10
-
8
:4
1
:
10
2
4 i
s
added
to
th
i
s
v
a
l
ue
16
:4
1
:
10