Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
8 Applied Instructions (Move and Compare)
8.1 CMP / Compare
133
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
1
Outline
2
Instruction List
3
Configuration of
Instruction
4
How to Read
Explanation of
Instructions
5
Basic Instruction
6
Step Ladder
Instructions
7
Applied Instructions
(Program Flow)
8
Applied Instructions
(Move and
Compare)
9
Applied Instructions
(Arithmetic and
Logical Operation)
10
Applied Instructions
(Rotation and
Shift Operation)
8.1 CMP / Compare
Outline
This instruction compares two values, and outputs the result (smaller, equal or larger) to bit devices (3
points).
For the contact comparison instruction, refer to Chapter 28.
For floating point comparison, refer to Section 18.1.
1. Format and operation, execution form
2. Set data
3. Applicable devices
S: Refer to "Cautions".
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Instruction
name
Operation
Execution
form
Expression in each language
Structured ladder/FBD ST
CMP 16 bits Continuous CMP(EN,s1,s2,d);
CMPP 16 bits Pulse CMPP(EN,s1,s2,d);
DCMP 32 bits Continuous DCMP(EN,s1,s2,d);
DCMPP 32 bits Pulse DCMPP(EN,s1,s2,d);
Variable Description
Data type
16-bit
operation
32-bit
operation
Input
variable
EN Execution condition Bit
Data or device number handled as comparison value ANY16 ANY32
Data or device number handled as comparison source ANY16 ANY32
Output
variable
ENO Execution state Bit
Head bit device to which comparison result is output. ARRAY [0..2] OF Bit
Operand
type
Bit Devices Word Devices Others
System User Digit Specification
System
User
Special
Unit
Index
Constant
Real
Number
Character
String
Pointer
XYMTCS
D.b
KnX KnY KnM KnS
TCD R
U\G
VZModifier K H E
""
P
zzzzzzz
S2 S3
zz z z z
zzzzzzz
S2 S3
zz z z z
zz z
S1
z
CMP
EN
s1
s2
ENO
d
CMPP
EN
s1
s2
ENO
d
DCMP
EN
s1
s2
ENO
d
DCMPP
EN
s1
s2
ENO
d