Справочник Пользователя для Mitsubishi Electronics FXCPU
1 Outline
1.1 Outline of Structured Programs and Programming languages
19
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
1
O
utlin
e
e
2
Instruc
tion Li
st
3
Configurati
on of
Instruction
4
Ho
w t
o R
ea
d
Explanati
on of
Ins
truction
truction
s
5
B
asic
Instruction
6
Step Ladder
Instruct
ions
7
Ap
pl
ied Inst
ruct
io
io
ns
(Program Flow)
8
Appl
ied
ied
In
stru
cti
cti
ons
(Mov
e and
C
omp
are)
are)
9
App
lie
lie
d Instr
uction
s
s
(Ari
thm
eti
thm
eti
c and
Lo
gic
al O
per
at
ion)
10
App
lied Inst
lied Inst
ructi
ons
ons
(Rot
ati
ati
on and
Shift O
perati
on)
1.1.2
Programming languages
The following programming languages can be used in each program block.
Graphic languages
1. Structured ladder language
This graphic language is created based on the relay circuit design technology.
A circuit always starts from the bus line located on the left side.
The structured ladder language consists of contacts, coils, functions and function blocks. These components
are connected with vertical lines and horizontal lines.
A circuit always starts from the bus line located on the left side.
The structured ladder language consists of contacts, coils, functions and function blocks. These components
are connected with vertical lines and horizontal lines.
2. FBD [Function Block Diagram language]
FBD is a graphic language easy to understand visually.
You can easily create programs by connecting parts (functions and function blocks) for special processing,
variables and constants along the flow of data and signals to improve the programming efficiency.
You can easily create programs by connecting parts (functions and function blocks) for special processing,
variables and constants along the flow of data and signals to improve the programming efficiency.
Text language
1. ST ("Structured text language")
The ST language can describe control achieved by syntax using selective branches with conditional
statements and repetition by repetitive statements in the same way as high-level languages such as C
language. By using the ST language, you can create simple programs easy to understand.
statements and repetition by repetitive statements in the same way as high-level languages such as C
language. By using the ST language, you can create simple programs easy to understand.
1
2
X000
X001
Y000
Y000
MOV
EN
ENO
s
d
D0
D2
When X001 is ON, the contents
of D0 are transferred to D2.
of D0 are transferred to D2.
Output Y000
X001
1
EQ
D0
D2
AND
INT_TO_WORD_E
EN
EN
ENO
_INT
XOR
D30
D20
X000
X001
X002
K4X010
When the contents
of D0 are equivalent
to the contents of
D2, EQ turns ON.
of D0 are equivalent
to the contents of
D2, EQ turns ON.
Y000:=(X000 OR Y000) AND NOT X001;
IF X001 THEN
D2:=D0; (* When X001 is ON, the contents of D0 are transferred to D2.*)
END_IF;
IF X002 THEN
D4:=D4+1; (* When X002 is ON, the contents of D4 are added by "1". *)
ELSE
D6:=D6+1; (* When X002 is OFF, the contents of D6 are added by "1". *)
END_IF;
IF X001 THEN
D2:=D0; (* When X001 is ON, the contents of D0 are transferred to D2.*)
END_IF;
IF X002 THEN
D4:=D4+1; (* When X002 is ON, the contents of D4 are added by "1". *)
ELSE
D6:=D6+1; (* When X002 is OFF, the contents of D6 are added by "1". *)
END_IF;