7-351
DATE-(P)
1
2
3
4
6
6
7
8
7.15 Clock instructions
7.15.4 Clock data subtraction operation (DATE-(P))
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.
• The data set by and is outside the setting range. (Error code: 4100)
• The device specified by or or exceeds the range of the corresponding device.
(For the Universal model QCPU only.) (Error code: 4101)
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).
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