![background image](http://html.mh-extra.com/html/omron/sysmac-cp-series/sysmac-cp-series_user-manual_742262470.webp)
Appendices
A-10
CP2E CPU Unit Software User’s Manual(W614)
A-1-5
Comparison Instructions
Instruction
Mnemonic
Variations
Symbol/Operand
Function
Symbol Com-
parison
(Unsigned)
LD, AND, OR +
=, <>, <, <=, >,
>=
---
Input comparison instructions compare two values (constants
and/or the contents of specified words) and create an ON execu-
tion condition when the comparison condition is true.
Input comparison instructions are available to compare signed or
unsigned data of one-word or double length data.
Symbol Com-
parison (Dou-
ble-word,
unsigned)
LD, AND, OR +
=, <>, <, <=, >,
>= + L
---
Symbol Com-
parison
(Signed)
LD, AND, OR +
=, <>, <, <=, >,
>= +S
---
Symbol Com-
parison (Dou-
ble-word,
signed)
LD, AND, OR +
=, <>, <, <=, >,
>= +SL
---
Time Compari-
son
LD, AND, OR +
= DT, <> DT,
< DT, <= DT,
> DT, >= DT
---
Time comparison instructions compare two BCD time values and
create an ON execution condition when the comparison condition
is true.
There are three types of time comparison instructions, LD (LOAD),
AND, and OR. Time values (year, month, day, hour, minute, and
second) can be masked/unmasked in the comparison so it is easy
to create calendar timer functions.
C: Control Word
Bits 00 to 05 of C specify whether or not the time data will be
masked for the comparison. Bits 00 to 05 mask the seconds,
minutes, hours, day, month, and year, respectively. If all 6 val-
ues are masked, the instruction will not be executed, the execu-
tion condition will be OFF, and the Error Flag will be turned ON.
UNSIGNED
COMPARE
CMP
!
Compares two unsigned binary values (constants and/or the con-
tents of specified words) and outputs the result to the Arithmetic
Flags in the Auxiliary Area.
S
1
S
2
Symbol and option
LD
S
1
S
2
Symbol and option
S
1
S
2
Symbol and option
AND
OR
One-word
S1
: Comparison data 1
S2
: Comparison data 2
Double len
g
th
S1
: 1st word of comparison data 1
S2
: 1st word of comparison data 2
<
<
<
LD
AND
OR
ON execution condition when
comparison result is true.
ON execution
condition when
comparison result
is true.
ON execution condition when
comparison result is true.
S1
C
S2
LD (LOAD):
AND:
OR:
S1
C
S2
S1
C
S2
C:
Control word
S1:
1st word of present time
S2:
1st word of comparison time
Symbol
Symbol
Symbol
Masks seconds data when ON.
Masks minutes data when ON.
Masks hours data when ON.
Masks day data when ON.
Masks month data when ON.
Masks year data when ON.
0 0 0 0 0 0 0 0 0 0
8
7 6 5 4 3 2 1 0
15
C
CMP(020)
S
1
S
2
S1
:
Comparison data 1
S2
:
Comparison data 2
(>, >=, =, <=, <, <>)
Unsigned binary
comparison
Arithmetic Flags
Содержание SYSMAC CP Series
Страница 1: ...USER S MANUAL Cat No W614 E1 01 SYSMAC CP Series CP2E E D CP2E S D CP2E N D CP2E CPU Unit Software ...
Страница 3: ......
Страница 32: ...1 Overview 1 4 CP2E CPU Unit Software User s Manual W614 ...
Страница 44: ...3 CPU Unit Operation 3 8 CP2E CPU Unit Software User s Manual W614 ...
Страница 116: ...6 I O Allocation 6 8 CP2E CPU Unit Software User s Manual W614 ...
Страница 144: ...7 PLC Setup 7 28 CP2E CPU Unit Software User s Manual W614 ...
Страница 170: ...10 Interrupts 10 14 CP2E CPU Unit Software User s Manual W614 ...
Страница 200: ...11 High speed Counters 11 30 CP2E CPU Unit Software User s Manual W614 ...
Страница 272: ...12 Pulse Outputs 12 72 CP2E CPU Unit Software User s Manual W614 ...
Страница 278: ...13 PWM Outputs 13 6 CP2E CPU Unit Software User s Manual W614 ...
Страница 460: ...18 Programming Device Operations 18 28 CP2E CPU Unit Software User s Manual W614 ...
Страница 576: ...Revision 2 CP2E CPU Unit Software User s Manual W614 ...
Страница 577: ......