7: D
ATA
C
OMPARISON
I
NSTRUCTIONS
7-2
FT1A S
MART
A
XIS
U
SER
’
S
M
ANUAL
FT9Y-B1382
Applicable CPU Modules
Valid Devices
For the valid device address range, see pages 6-1 and 6-2
(Basic Vol.).
When only S1 and/or S2 is repeated, the logical operation type can be selected from AND or OR.
Internal relays M0 through M1277 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value (TC or CC) is read out.
When F (float) data type is selected, only data register and constant can be designated as S1 and S2.
When F (float) data type is selected and S1 or S2 does not comply with the normal floating-point format, a user program execution error will result,
turning on special internal relay M8004 and ERR LED on the CPU module. For user program execution errors, see Chapter 4 “User Program
Execution Errors” on page 4-21.
Valid Data Types
Special Internal Relays M8150, M8151, and M8152 in CMP=
Three special internal relays are available to indicate the comparison result of the CMP= instruction. Depending on the result, one
of the three special internal relays turns on.
When more than one CMP = or ICMP>= instruction is used, M8150, M8151, or M8152 indicates the result of the instruction that
was executed last.
Examples: CMP>=
The following examples are described using the CMP
instruction. Data comparison operation for all other data comparison
instructions is the same for the CMP
instruction.
Data Type: Word
FT1A-12
FT1A-24
FT1A-40
FT1A-48
FT1A-Touch
X
X
X
X
X
Device
Function
I
Q
M
R
T
C
D
Constant
Repeat
Repeat Result
Logical AND or OR operation
—
—
—
—
—
—
—
—
—
S1 (Source 1)
Data to compare
X
X
X
X
X
X
X
X
1-99
S2 (Source 2)
Data to compare
X
X
X
X
X
X
X
X
1-99
D1 (Destination 1)
Comparison output
—
X
—
—
—
—
—
1-99
W (word)
X
When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is designated as the
source, 16 points (word or integer data type) or 32 points (double-word or long data type) are used. When repeat
is designated for a bit device, the quantity of device bits increases in 16- or 32-point increments.
When a word device such as T (timer), C (counter), or D (data register) is designated as the source, 1 point
(word or integer data type) or 2 points (double-word, long, or float data type) are used. When repeat is
designated for a word device, the quantity of device words increases in 1- or 2-point increments.
When an output or internal relay is designated as the destination, only 1 point is used regardless of the selected
data type. When repeat is designated for the destination, outputs or internal relays as many as the repeat cycles
are used.
I (integer)
X
D (double word)
X
L (long)
X
F (float)
X
When S1 > S2, M8150 (greater than) turns on.
When S1 = S2, M8151 (equal to) turns on.
When S1 < S2, M8152 (less than) turns on.
S2
S1
(2)
(1)
(3)
Small
Large
When repeat is designated, the comparison result of the last repeat cycle
turns on one of the three special internal relays.
S2 Value
M8150
(1) S1 > S2
(2) S1 = S2
(3) S1 < S2
ON
OFF
OFF
M8151
OFF
ON
OFF
M8152
OFF
OFF
ON
D1
Status
OFF
ON
OFF
I0
REP
S1 –
D10
D1
–
Q0
CMP>=(W)
S2 –
D20
56
D20
50
D20
Q0 turned off
Q0 turned on
S2
D1
42
D10
127
D10
S1
Summary of Contents for microsmart pentra
Page 1: ...FT1A SERIES FC9Y B1382 Ladder Programming Manual ...
Page 6: ...Preface 5 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 104: ...7 DATA COMPARISON INSTRUCTIONS 7 10 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 122: ...8 BINARY ARITHMETIC INSTRUCTIONS 8 18 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 138: ...10 SHIFT ROTATE INSTRUCTIONS 10 12 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 162: ...11 DATA CONVERSION INSTRUCTIONS 11 24 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 188: ...12 CALENDAR COMPARISON INSTRUCTIONS 12 26 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 198: ...15 REFRESH INSTRUCTIONS 15 4 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 202: ...16 INTERRUPT CONTROL INSTRUCTIONS 16 4 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 266: ...20 DUAL TEACHING TIMER INSTRUCTIONS 20 4 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 318: ...25 USER COMMUNICATION INSTRUCTIONS 25 22 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...