7 APPLICATION INSTRUCTION
7.19 Clock instruction
591
7
Comparing date data
LDDT, ANDDT, ORDT
These instructions compare the date data in the devices specified by (s1) and (s2). Or, these instructions compare the date
data in the device specified by (s1) with the current date.
Set the comparison target by (s3).
■Descriptions, ranges, and data types
■Applicable devices
• These instructions compare the date data in the devices specified by (s1) and (s2), or compare the date data in the device
specified by (s1) with the current date. Set the comparison target by (s3).
Ladder diagram Structured text
( indicates T=, DT<>, DT>, DT<=, DT<, or DT>=.)
Not supported
Operand Description Range Data type Data type (label)
(s1) Head device number where the comparison data is stored 16-bit signed binary ANY16
(s2) Head device number where the comparison data is stored 16-bit signed binary ANY16
(s3) Comparison target setting value or the number of comparison
target data
0001H to 0007H,
8001H to 8007H
16-bit signed binary ANY16
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(s1)
(s2)
(s3)
• Comparing two specified date data
These instructions compare the date data in the device specified by (s1) with the date data in the device specified by (s2) in accordance with the
conditions set by (s3). (Devices are used as a normally open contact.)
• Comparing the specified date data with the current date
These instructions compare the date data in the device specified by (s1) with the current date data in accordance with the conditions set by (s3).
(Devices are used as a normally open contact.) The date data in the device specified by (s2) is regarded as dummy data and ignored.
LD
AND
OR
(s1) (s2) (s3)
(s1) (s2) (s3)
(s1) (s2) (s3)
(s1)
(s1)+1
(s1)+2
(s2)
(s2)+1
(s2)+2
Year
Month
Day
Year
Month
Day
(1980 to 2079)
Data range
(1 to 12)
(1 to 31)
(1980 to 2079)
Data range
(1 to 12)
(1 to 31)
Relational
operator
Comparison
operation
result
(s1)
(s1)+1
(s1)+2
Relational
operator
Year
Month
Day
(1980 to 2079)
Data range
(1 to 12)
(1 to 31)
Comparison
operation
result
Current date
(Year/month/day)