THE FX SERIES OF PROGR AMM ABLE CONTROLLER
(FX0, F X0S, F X0N, F X , F X
2C, FX2N, FX2NC
)
FX Series Programmable Controllers
g
g
g
y
g
y
j
FX Series Programmable Controllers
Programming Manual
Manual number : JY992D48301
Manual revision : J
Date: November 1999
Foreword
•This manual contains text, dia
the correct pro
•Before attemptin
understood.
•If in doubt at an
electrical en
which appl
•If in doubt about the operation or use of the PLC please consult the nearest
Mitsubishi Electric distributor.
•This manual is sub
ramming and operation of the PLC.
to install or use the PLC this manual should be read and
stage of the installation of the PLC always consult a professional
ineer who is qualified and trained to the local and national standards
to the installation site.
ect to change without notice.
rams and explanations which will guide the reader in
i
FX Series Programmable Controllers
ii
y
y
y
g
g
y
y
y
g
y
y
y
y
y
y
g y
y
y y
y
y
FX Series Programmable Controllers
FAX BACK - Combined Programming Manual (J)
Mitsubishi has a worl d wide rep utation fo r its eff orts i n continual l
the frontiers of industrial automation. What is sometimes overlooked b
and attention to detail that is taken with the documentation. However,to continue this process
of improvement, the comments of the Mitsubishi users are alwa
been desi
ward to hearin
Please tick the box of
Fax numbers: Your name....................................................
ou have any comments in general about the Mitsubishi manuals?.....................................
Good
Tid
Not too bad
Yes
Not too bad
Un-friendl
Unusable
No
Un-helpful
Thank
and this manual easy to use.
ou for taking the time to fill out this questionnaire. W e hope you found both the
product
iii
FX Series Programmable Controllers
iv
FX Series Programmable Controllers
y
y
g
g
y
j
g
y
y
y
g
y
y
y
g
g
g
y
g
Guidelines for the Safety of the User and Protection of the Programmable
Controller (PLC)
This manual provides information for the use of the FX family of PLC’s. The manual has been
written to be used b
persons is as follows;
trained and competent personnel. The definition of such a person or
a) An
engineer who is responsible for the planning, design and construction of automatic
equipment usin
the product associated with this manual should b e of a competent
nature, trained and qua lified to the local an d national standa rds required to fulfill tha t
role. These en
ineers should be fully aware of all aspects of safety with regards to
automated equipment.
b) An
commissioning or service engineer must be of a competent nature, trained and
qualified to the local and national stand ards required to fulfill that
ob. These engineers
should also be trained in the use and maintenance of the completed product. This
includes bein
completely familiar with all associat ed documentation for the said
product. All maintenance should be carried out in acc ordance with established safet
practices.
c) All operators of the completed equipment should be trained to use that product in a safe
and coordinated manner in compliance to established safet
practices. The operators
should also be familiar with documentation which is connected with the actual operation
of the completed equipment.
Note :
the term ‘completed equipment’ refers to a third part
constructed device which
contains or uses the product associated with this manual.
Note’s on the Symbols used in this Manual
At various times throu
information which are intended to ensure the users personal safet
equipment. Whenever an
be read and understood. Each of the s
its meanin
.
h out this manual certain symbols will be used to highlight points of
and protect the integrity of
of the following symbols are encountered its associated note must
mbols used will now be listed with a brief descript ion of
Hardware Warnings
1) Indicates t hat the identified dan
2) Indicates that the identified dan
damage.
3) Indicates a point of further interest or further explanation.
Software Warning s
4) Indicates special care must be taken when usin
5) Indicates a special point which the user of the associate software element should
be aware of.
6) Indicates a point of interest or further explanation.
ram a PC? ................................................................1-2
2C
CPU versions.......................................................................................1-3
CPU all versions .............................................................................................1-5
1.Introduction
g
g
g
y
y
y
y
ying
g
g
FX
0(S)
FX
0N
FXFX
(2C)
FX
2N(C)
1.1Overview
1) Scope of this manual
This manual
0S
, FX
0, FX2N
FX
the PLC hardware and installation, refer to the appropriate manual supplied with the unit.
2) How to use this manual
This manual covers all the functions of the hi
Controller (PLC). For this reason, the followin
to show which PLCs that section applies to;
Introduction 1
ives details on all aspects of operation and programming for FX, FX2C, FX0N,
and FX
2NC
programmable controllers (PLCs). For all information relating to
hest specification Programmable (Logic)
indicator is included in relevant section titles
FX
0(S)
- “FX
- “FX
0(S)
0N
FXFX
” - All FX0 and FX0S PLCs
” - All FX0N PLCs
(2C)
FX
0N
- “FX” - All FX and FX
- “FX
- - All FX
- “FX
(2C)
” - All FX and FX2 PLCs (CPU versions 3.07 or later)
2C
PLCs (see page 1-4)
2N(C)
” - All FX2N and FX
FX
2N(C)
2
PLCs (CPU ver 2.30 or earlier)
2NC
Shaded boxes indicate
the applicable PLC t
PLCs
pe
If an indicator box is half shaded, as shown to the
FX
0(S)FX0N
FXFX
(2C)
FX
2N(C)
left, this means that not all the functions described in
the current section appl
to that PLC. The text
explains in further detail or makes an independent
reference.
If there are no indicator boxes then assume the section applies to all PLC t
pes unless
otherwise stated.
3) FX famil
This is a generic term which is often used to describe all Programmable Controllers without
identif
4) CPU version numbers and pro
As Mitsubishi up
individual types or model names.
ramming support
rades each model different versions have different capabilities.
-Please refer to section 1.4 for details about version numbers and capabil it ies.
-Please refer to section 1.5 for details about peripheral support for each model.
1-1
1.2What is a Programmable Controller?
g
y
gg
g
y
g
gy
g
y
g
y
g
g
g
g
y
g
FX
0(S)
FX0NFXFX(2C)
FX2N(C)
FX
0(S)
FX0NFXFX(2C)
FX2N(C)
A Programmable Logic Controller (PLC or programmable controller) is a device that a user can
pro
ram to perform a series or sequence of events. These events are triggered by stimuli
(usuall
counted occur-rences. Once an ev ent tri
or OFF electronic control
will continuall
outputs at the programmed specific times.
called inputs) received at the PLC or through delayed actions such as time delays or
ear or the physical actuation of devices. A programmable controller
‘loop’ through its internal ‘user defined’ program waiting for inputs and givin
Introduction 1
ers, it actuates in the outside world by switching ON
Note on termin o lo
The term pro
control s
‘Pro
rammable Logic Controller ’, ‘PLC’ or ‘programmable controller ’ to de scribe the same
control s
stem under one descriptive na me. Sometimes engineers use the term
stem.
The construction of a pro
element where the pro
Processin
Unit or MPU. Other terms commonly heard to describe this device are ‘base unit’,
:
rammable controller is a generic word used to bring all the elements making the
rammable controller can be broken down into component parts. The
ram is loaded, s tored and pr ocessed is often known as th e Main
‘controller’ and ‘CPU’. The term CPU is a little misleadin
ma
contain local CPU devices. A Main CPU (or more correctly a Main Processing Unit)
controls these local CPUs throu
h a communication network or bus.
1.3What do You Need to Program a PLC?
A variety of tools are available to program the Mitsubishi FX family of PLCs. Each of these
tools can use and access the instructions and devices listed in this manual for the identified
PLC.
FX
A6GPP
FX-A6GPP-EE-
KIT
FX,
2C
as todays more advanced products
Personalcomputer
MelsecMEDOC
MelsecMedocPlus
SW1PC-FXGPEE
FX-PCS-WIN-E
GP80
GP-80FX-E-KIT
HPP
FX-10P-EFX-20P-E
FX
2N(C)
Opto-isolated
RS232/
RS422
interface
FX0,FX0S,
FX
0N
1-2
1.4CPU version numbers
g
g
y
g
g
g
g
y
g
g
FX0(S)FX0NFXFX(2C)FX2N(C)
Over time Mitsubishi adds newer and better features to develop and enhance the products.
Because of the nature of PLCs, that can be likened to ‘industrial computers’, chan
sometimes occur within the units main CPU (Central Processin
similar to those experienced b
processor. The followin
functions and features added.
Introduction 1
es
Unit). These changes are
office and home computer users, that is, going to a version up
lists identify the CPU versions that had significant upgrades or new
1.4.1FX
0N
CPU versions
CPU Ver 1.20
CPU Ver 1.40
1.4.2FX and FX
CPU Ver 3.07
The followin
features were added:
Software control for protocol 1 and 4 communications with the FX
1:N network.
The followin
Software control for communications usin
1.5Special considerations for programming equipment
y
y
ying
y
g
g
g
FX
0(S)
FX0NFXFX(2C)
FX
2N(C)
g
g
y
Introduction 1
1.5.1FX CPU version 3.07 or later and FX
Programming tools operating old system software can not access the new featur es added to
the FX CPU from version 3.07 (and available on all FX
certain ‘standard’ applied instructions in conjunction with special auxiliary coils (M coils) can
achieve the same ’effective instruction’ as the new instructions. The followin
which version of peripheral software will work directly with all of the ’new’ features and which
peripheral software versions require use of modified instructions.
DescriptionModel Number
Hand held
pro
rammer (HHP)
HHP cassetteFX-20P-MFXA-EV 1.20from V 2.00
rammin
Pro
software
Data access units
FX-10P-EV 1.10from V 2.00
FX-PCS/AT-E-KITV 1.01from V 2.00
FX-A6GPP-E-KITV 1.00from V 2.00
FX-10DU-EV 1.10from V 2.00
FX-20DU-EV 1.10from V 2.00
Other DU unitsfrom V 1.00
2C
Peripherals Table
System software version which will.......
....require the use of
auxiliary M coils
2C
units). However, programmin
tables identif
....program all instructions
directly
Existing Instruction And Special M Coil Combination To Mimic The Operation Of The
Identified Instruction
Existing FX instruction used to mimic the operation of......
Mnemonic FNC number Modifying M coilMimicked instructionMnemonic FNC Number
MOV12M8190Square rootSQR48
MOV12M8191FloatFLT49
RAMP67M8193Data searchSER61
RAMP67M8194RS232 instructionRS80
FMOV16M8196Hex to ASCII conversionASCI82
FMOV16M8197ASCII to Hex conversionHEX83
FMOV16M8195Sum checkCCD84
Example usage
Using existing FX functions......
SET
M8190
D10
K36
MOV
to mimic......
This format is ver
correctl
.The user must program the ’mimic’ instruction
with the modif
before the instruction to be modified.
important for the instruction to operate
M coil in a SET instruction immediatel
SQR
K36
D10
1-4
Introduction 1
y
y
g
g
g
g
g
g
g
g
g
g
g
FX
0(S)
FX0NFXFX(2C)
FX
2N(C)
g
y
g
Using the new Interrupt Pointers:
To pro
throu
instruction with older pro
ram new Interrupt Pointer s I010
h I060 in to the HSCS (FNC 53)
rammin
equipment, substitute the followin
special M codes for the appropriate
Interrupt Pointer; see the table ri
BMOV (FNC 15) instruction. To BMOV data into file re
isters can not be used as a destination device in the
isters with old equipment set special M
coil M8198 on. This switches the source and destination parameters; i.e., the source is then
treated as the destination and the destination becomes the source.
General note:
I
pro
sections, will apply.
1.5.2FX
The introduction of this CPU provides the FX user with many new devices and instructions. To
use the full features of the FX
pro
However, because of the downward compatibilit
existin
CPU ver 3.30 units.
nore the special programming techniques identified in this section if using updated
ramming software or peripherals; then normal operation, as identifiedin the followin
2N(C)
CPU all versions
2N(C)
units the user must upgrade older software and hardware
ramming tools.
of the FX
programming tools for use with FX
DescriptionModel Number
Hand held programmer (HHP)FX-10P-Efrom V 3.00
HHP cassetteFX-20P-MFXA-Efrom V 3.00
FX-10DU-Efrom V 4.00
FX-20DU-ESupports up to FX devices onl
FX-25DU-Efrom V 2.00
FX-30DU-Efrom V 3.00
Data access units
FX-40DU-E(S)Supports up to FX devices onl
FX-40DU-TK-ESfrom V 3.00
FX-50DU-TK(S)-Efrom V 2.10
F940GOT-SWD(LWD)-EAll versions
2N(C)
units up to the equivalent functionality of FX
Peripherals Table
2N(C)
, it is not necessary to upgrade
System software version with
full support for FX
2N(c)
1-5
MEMO
Introduction 1
1-6
FX Series Programmable ControllersBasic Program Instructions 2
1Introduction
2Basic Program Instructions
3STL Programming
4Devices in Detail
5Applied Instructions
6Diagnostic Devices
7Instruction Execution Times
8PLC Device Tables
9Assigning System Devices
10Points of Technique
11Index
FX Series Programmable ControllersBasic Program Instructions 2
A program is a connected series of instructions written in a language that the PLC can
understand. There are three forms of pro
pro
ramming tools can work in all programming forms. Generally hand held programmin
panels only work with instruction format while most graphic programming tools will work with
both instruction and ladder format. Specialist pro
pro
ramming.
Basic Program Instructions 2
ram format; instruction, ladder and SFC/STL. Not all
ramming software will also allow SFC style
LD
OUT
AND
SET
LD
OUT
X10
Y7
M38
S5
X21
T01
K40
Instruction formatLadder FormatSFC Format
2.2Outline of Basic Devices Used in Programming
There are six basic programming devices. Each device has its own unique use. To enable
quick and eas
-X: This is used to identif
-Y: This is used to identif
-T: This is used to identif
-C: This is used to identif
-M and S: These are used as internal operation fla
identification each device is assigned a single reference letter;
all direct, physical inputs to the PLC.
all direct, physical outputs from the PLC.
a timing device which is contained within the PLC.
a counting device which is contained within the PLC.
s within the PLC.
All of the devices mentioned above are known as ‘bit devices’. This is a descriptive title tellin
the user that these devices only have two states; ON or OFF, 1 or 0.
Detailed device information:
•Chapter 4 contains this information in detail. However, the above is all that is
required for the rest of this chapter.
2-1
FX Series Programmable ControllersBasic Program Instructions 2
g
g
y
y
g
g
g
y
y
y
g
g
g
2.3How to Read Ladder Logic
Ladder logic is very closely associated to basic relay logic. There are both contacts and coils
that can be loaded and driven in different confi
the same.
A coil drives direct outputs of the PLC (ex. a Y device) or drives internal timers, counters or
s (ex. T, C, M and S devices). Each coil has associated contacts. These contacts are
fla
available in both “normall
open” (NO) and “normally closed” (NC) configurations.
urations. However, the basic principle remains
The term “normal(l
)” refers to the status of the contacts when the coil is not energized. Usin
a relay analogy, when the coil is OFF, a NO contact would have no current flow, that is, a load
bein
supplied through a NO contact w ould not o perate. Ho wever, a NC contact w ould allo w
current to flow, hence the connected load would be active.
Activatin
the coil reverses the contact status , that is, the current would flow in a NO contac t
and a NC contact would inhibit the flow.
Ph
sical inputs to the PLC (X devi ces) have n o programmable coil. These devices may only be
used in a contact format (NO and NC t
pes are available).
Example:
Because of the close rela
association, ladder logic programs can be read as current flowin
from the left ve rtical line to the right vertical line. This current must pass through a series of
contact representations such as X0 and X1 in order to switch the output coil Y0 ON. Therefore,
in the example shown, switchin
X0 ON causes the output Y0 to also switch ON. If however,
the limit switch X1 is activa tes, the output Y0 turns OFF. This is because the con nection
between the left and the ri
Toggle switch
X0
X1
Limit switch
ht vertical lines breaks so there is no current flow.
Programmable Controller
Y0
I
N
P
U
T
PC Program
X0X1
Y0
DC Power Supply
O
U
T
P
U
COM
T
(Y0)
Motor
AC
Power
Supply
2-2
FX Series Programmable ControllersBasic Program Instructions 2
y
g
g
y
y
g
y
y
g
2.4Load, Load Inverse
MnemonicFunctionFormatDevicesProgram steps
Initial lo
LD
(LoaD)
LDI
(LoaD Inverse)
Program example:
X0
X1
T0
operation contact
t
pe NO
(normall
Initial lo
operation contact
t
pe NC
(normall
LDI
ical
open)
ical
closed)
K
Y0
M100
T0
Y1
K19
FX
X, Y, M, S, T, C1
X, Y, M, S, T, C1
0
1
2
3
4
7
8
FX0NFXFX(2C)
0(S)
LD
OUT
LDI
OUT
OUT
SP
LD
OUT
X
Y
X
M
T
K
T
Y
100
0
0
1
0
19
0
1
When using hand held
programmers, the space key
needs to be pressed to enable
the constant to be entered.
FX2N(C)
Basic points to remember:
-Connect the LD and LDI instructions directl
-Or use LD and LDI instructions to define a new block of pro
to the left hand bus bar.
ram when using the ORB
and ANB instructions (see later sections).
The OUT instruction:
•For details of the OUT instruction (including basic timer and counter variations)
please see over the followin
page.
2-3
FX Series Programmable ControllersBasic Program Instructions 2
y
y
g
g
y
g
y
gg
g
g
y
2.5Out
MnemonicFunctionFormatDevicesProgram steps
OUT
(OUT)
Final lo
operation t
drive
Basic points to remember:
-Connect the OUT instruction directl
-It is not possible to use the OUT instruction to drive ‘X’ t
-It is possible to connect multiple OUT instructions in parallel (for example see the
previous pa
2.5.1Timer and Counter Variations
When confi
uring the OUT instruction for u se as either a timer (T) or counte r (C) a consta nt
must also be entered. The constant is identified b
pa
e; T0 K19).
In the case of a timer, the constant “K” holds the duration data for the timer to operate, i.e. if a
100 msec timer has a constant o f “K100” it will be (100 5 100 msec) 10 s econds before the
timer coil activates.
With counters, the constant identifi es how ma n
before the counter coil activates. For example, a counter with a constant of “8” must be
tri
ered 8 times before the counter coil finally energizes.
The followin
table identifies some basic parameter data for various timers and counters;
ical
pe coil
e; M100/T0 configuration)
FX
Y, M, S, T, C
FX0NFXFX(2C)
0(S)
Y, M:1
S, special M
coils: 2
T:3
C (16 bit): 3
C (32 bit): 5