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.
Operation Error
(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 Example
(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.
–– –– –– ––
Hour: 10
Minute: 42
Second: 12
+1
+2
Hour: 18
Minute: 8
Second: 20
+1
+2
Hour: 4
Minute: 50
Second: 32
+1
+2
S1
S2
D
S1
S1
S2
S2
D
D
S1 S2
S1 S2
D
Step Instruction Device
Clock device
95
4
20
D101
D102
Year
Day
Month
3
21
20
1
D100
D103
D104
D105
D106
Hour
Minute
Second
Day of week
Time data
Hour: 10
Minute: 40
Second: 10
D11
D12
Hour: 16
Minute: 41
Second: 10
R11
R12
Hour: 3
Minute: 21
Second: 20
D104
D105
R10D10D103
3:21:20 - 10:40:10 -8:41:10
24 is added to this value
16:41:10