Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 251

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Comparison Instructions
218
Example:
When C = 39 hex, the rightmost 6 bits are 111001 (year=1, month=1, day=1,
hours=0, minutes=0, and seconds=1) so only the hours and minutes are com-
pared. This mask setting can be used to perform a particular operation at a
given time (hour and minute) each day.
Present time data
15
08
07
Minute (00 to
Second (00 to
S
1
59, BCD)
59, BCD)
Day of month
Hour (00 to
S
+1
1
23, BCD)
(01 to 31, BCD)
Year (00 to
Month (01 to
S
+2
1
99, BCD)
12, BCD)
Compares only hours and
minutes data.
Previous data comparison instructions compared data in 16-bit units. The
time comparison instructions are limited to comparing 8-bit time values.
The following table shows the structure of the CPU Unit's internal Calendar/
Clock Area.
Addresses
A351.00 to A351.07
Second (00 to 59, BCD)
A351.08 to A351.15
Minute (00 to 59, BCD)
A352.00 to A352.07
Hour (00 to 23, BCD)
A352.08 to A352.15
Day of month (01 to 31, BCD)
A353.00 to A353.07
Month (01 to 12, BCD)
A353.08 to A353.15
Year (00 to 99, BCD)
The Calendar/Clock Area can be set with the CX-Programmer, DATE(735)
instruction, or "CLOCK WRITE" FINS command (0702 hex).
Summary of Time Comparison Instructions
The following table shows the function codes, mnemonics, names, and func-
tions of the 18 time comparison instructions.
Code Mnemonic
341
LD= DT
LOAD EQUAL
AND=DT
AND EQUAL
OR=DT
OR EQUAL
342
LD<>DT
LOAD NOT EQUAL
AND<>DT
AND NOT EQUAL
OR<>DT
OR NOT EQUAL
343
LD<DT
LOAD LESS THAN
AND<DT
AND LESS THAN
OR<DT
OR LESS THAN
344
LD<=DT
LOAD LESS THAN OR EQUAL
AND<=DT
AND LESS THAN OR EQUAL
OR<=DT
OR LESS THAN OR EQUAL
345
LD>DT
LOAD GREATER THAN
AND>DT
AND GREATER THAN
OR>DT
OR GREATER THAN
Comparison time data
00
15
08
07
Minute (00 to
Second (00 to
S
2
59, BCD)
59, BCD)
Day of month
Hour (00 to
S
+1
2
(01 to 31, BCD)
23, BCD)
Year (00 to
Month (01 to
S
+2
2
99, BCD)
12, BCD)
Year, month, day, and seconds
data is masked.
Contents
Name
Section 3-6
00
Function
True if
S1 = S2
True if
S1
S2
True if
S1 < S2
True if
S1
S2
True if
S1 > S2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents