Manual number : JY992D88101
Manual revision : A
Date: April 2000
Foreword
•This manual contains text, diagrams and explanations which will guide the reader in
the correct programming and operation of the PLC.
•Before attempting to install or use the PLC this manual should be read and
understood.
•If in doubt at any stage of the installation of the PLC always consult a professional
electrical engineer who is qualified and trained to the local and national standards
which apply to the installation si te.
•If in doubt about the operation or use of the PLC please consult the nearest
Mitsubishi Electric distri butor.
•This manual is subject to change without notice.
i
Page 4
FX Series Programmable Controllers
ii
Page 5
FX Series Programmable Controllers
FAX BACK - Combined Programming Manual (J)
Mitsubishi has a world wide reput ation f or it s ef fort s in continu ally deve loping and pushing back
the frontiers of industrial automation. What is sometimes overlooked by the user is the care
and attention to detail that is taken with the documentation. However,to continue this process
of improvement, the comments of the Mitsubishi users are always welcomed. This page has
been designed for you,the reader,to fi ll in your comments and fax them back to us . We l ook forward to hearing from you.
Please tick the box of your choice;
Fax numbers: Your name....................................................
South Africa(0111) 444-8304.................... ...................... ...................... .. ...
United Kingdom(01707) 278-695
What condition did the manual arrive in?
Will you be using a folder to store the manual?
What do you think to the manual presentation?
Are the explanations understandable?
Which explanation was most difficult to understand:..................................................................
Thank you for ta king the time to fill out this questionnaire. We hope you found both the product
and this manual easy to use.
iii
Page 6
FX Series Programmable Controllers
iv
Page 7
FX Series Programmable Controllers
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 by trained and competent personnel. The definition of such a person or
persons is as follows;
a) Any engineer who is responsible for the planning, design and construction of automatic
equipment using the product associated with this m anual should be of a competen t
nature, trained and qualified to the local and na tional standards required to fulfill that
role. These engineers should be fully aware of all aspects of safety with regards to
automated equipment.
b) Any commissioning or service engineer must be of a competent nature, trained and
qualified to the local and national standards required to fulfill that job. These engineers
should also be trained in the use and maintenance of the completed product. This
includes being complete ly familiar with all associated do cumentation for the said
product. All maintenance should be carried out in accordance with established safety
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 safety 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 party constructed device which
contains or uses the product associated with this manual.
Note’s on the Symbols used in this Manual
At various times through out this manual certain symbols will be used to hig hlight points of
information which are intended to ensure the users personal safety and protect the integrity of
equipment. Whenever any of the following symbols are encountered its associated note must
be read and understood. Each of the symbols used will now be liste d with a brief descr ipti on of
its meaning.
Hardware Warnings
1) Indicates t hat the identified danger WILL cause physical and property damage.
2) Indicates that the identified danger could POSSIBLY cause physical and property
damage.
3) Indicates a point of further interest or further explanation.
Software Warning s
4) Indicates special care must be taken when using this element of software.
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.
1) Scope of this manual
This manual gives details on all aspects of operation and programming for FX
FX
2N and FX2NC programmable controllers (PLCs). For all information relating to 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 highest specification Programmable (Logic)
Controller (PLC). For this reason, the following indi cator is included in rel evant section titles
to show which PLCs that section applies to;
FX
1S
FX
1N
Introduction 1
FX
2N
FX
1S, FX1N,
2NC
FX
1S
- “FX
- “FX
- “FX
- “FX
1S)” - All FX1S PLCs
1N” - All FX1N PLCs
2N” - All FX2N PLCs
2NC” - All FX2NC PLCs
FX
1N
FX
2N
FX
2NC
Shaded boxes indicate
the applicable PLC type
If an indicator box is half shaded, as shown to the
FX
1S
FX
1N
FX
2N
FX
2NC
left, this means that not all the functions described in
the current section apply 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 types unless
otherwise stated.
3) FX family
This is a generic term which is often used to describe all Programmable Controllers without
identifying individual types or model names.
4) CPU version numbers and programming support
As Mitsubishi upgrades each model different versions have dif ferent capabilities.
-Please refer to section 1.4 for details about peripheral support for each model.
1-1
Page 20
1.2What is a Programmable Controller?
A Programmable Logic Controller (PLC or programmable controll er) is a device that a user can
program to perform a series or sequence of events. These events are triggered by stimuli
(usually called inputs) received at the PLC or through delayed actions such as time delays or
counted occur-rences. Once an event tri ggers, i t act uate s in the out si de world by swit ching ON
or OFF electronic control gear or the physical actuation of devices. A programmable controller
will continually ‘loop’ through its internal ‘user defined’ program waiting for inputs and giving
outputs at the programmed specific times.
Note on terminology:
The term programmable controller is a generic word used to bring all the elements making the
control system under one desc riptive name. Sometimes engineers use the term
‘Programmable Logic Controller’, ‘PLC’ or ‘programmable controller’ to describe the same
control system.
The construction of a programmable controller can be broken down into component parts. The
element where th e program is lo aded, stored an d processed is often know n as the M ain
Processing Unit or MPU. Other terms commonly heard to describe this device are ‘base unit’,
‘controller’ and ‘CPU’. The term CPU is a little misleading as todays more advanced products
may contain local CPU d evices. A Ma in CPU (or mo re correctly a Ma in Processing Un it)
controls these local CPUs through a communication network or bus.
FX
1S
FX
1N
Introduction 1
FX
2N
FX
2NC
1.3What do You Need to Program a PLC?
A variety of tools are available to program the Mitsubishi FX family of PLC s. Each of these
tools can use and access the instructions and devices listed in this manual for the identified
PLC.
HPP
FX-10P-EFX-20P-E
FXFXFXFX
1S1N2N2NC
FX
FX
1S
1N
Opto-isolated
Personalcomputer
MelsecMEDOC
MelsecMedocPlus
SW1PC-FXGPEE
FX-PCS-WIN-E
FX
RS232/RS422
interface
2N
FX
2NC
1-2
Page 21
1.4Special considerations for programming equipment
Introduction 1
1S
FX1NFX
1.4.1Current GenerationCPU all versions
FX
2N
FX
2NC
The introduction of this CPU provi des the FX user with many new devices and instructions. To
use the full features of the current range of FX units the user must upgrade older software and
hardware programming tools.
However, because of the downward compatibility of the current range, it is not necessary to
upgrade existing programming tools up to the equivalent functionality of last generation F X
CPU ver 3.30 units.
Peripherals Table
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 only
FX-25DU-Efrom V 2.00
FX-30DU-Efrom V 3.00
Data access units
FX-40DU-E(S)Supports up to FX devices only
FX-40DU-TK-ESfrom V 3.00
FX-50DU-TK(S)-Efrom V 2.10
F930GOT-BWDAll versions
F940GOT -SWD(LWD)-EAll versions
A program is a connected series o f instructions written in a language that the P LC can
understand. There are three forms of program format; instruction, ladder and SFC/STL. Not all
programming tools can work in all programming forms. Generally hand held programming
panels only work with instruction format while most graphic progra mming tools will work with
both instruction and ladder format. Specialist programming software will also allow SFC style
programming.
Basic Program Instructions 2
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 pr ogramming d evices. Each device has its own un ique use. To enable
quick and easy identification each device is assigned a single reference letter;
-X: This is used to identify all direct, physical inputs to the PLC.
-Y: This is used to identi fy al l direct, physical outputs fr om the PLC.
-T: This is used to identify a timing device which is contained within the PLC.
-C: This is used to identify a counting device which is contained within the PLC.
-M and S: These are used as internal operation flags within the PLC.
All of the devices mentioned above are known as ‘bit devices’. This is a descriptive title telling
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
Page 28
FX Series Programmable ControllersBasic Program Instructions 2
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 configurations. However, the basic principle remains
the same.
A coil drives direct outputs of the PLC (ex. a Y device) or drives internal timers, counters or
flags (ex. T, C, M and S d evices). Each coil has associated contacts. These contacts are
available in both “normally open” (NO) and “normally closed” (NC) configurations.
The term “normal(ly)” refers to the status of the contacts when the coil is not energized. Using
a relay analogy, when the coil is OFF, a NO contact would have no current flow, that is, a load
being supplied through a NO contact would not operate. However, a NC contact would allow
current to flow, hence the connected load would be active.
Activating the coil reverses the con tact status, that is, the current would flow in a NO c ontact
and a NC contact would inhibit the flow.
Physical inputs to the PLC (X de vices) have no pr ogrammable coil. Th ese devices may only be
used in a contact format (NO and NC types are available).
Example:
Because of the close relay association, ladder logic program s can be re ad as current flowing
from the left vertical line to the right vertical line. This current must pass through a series of
contact represent atio ns suc h as X0 and X1 in or der to swit ch t he output coil Y0 ON. Th erefore,
in the example shown, switching 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 connection
between the left and the right vertical lines breaks so there is no current flow.
Motor
Toggle switch
Limit switch
X0
X1
I
N
P
U
T
Programmable Controller
PC Program
X0X1
Y0
DC Power Supply
Y0
O
U
T
P
U
COM
T
(Y0)
AC
Power
Supply
2-2
Page 29
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.4Load, Load Inverse
MnemonicFunctionFormatDevicesProgram steps
Initial logi cal
LD
(LoaD)
LDI
(LoaD Inverse)
operation contact
type NO
(normally open)
Initial logi cal
operation contact
type NC
(normally closed)
FX
1S
X, Y, M, S, T, C1
X, Y, M, S, T, C1
2NC
Program example:
X0
X1
T0
LDI
Y0
M100
T0
K
K19
Y1
LD
0
OUT
1
LDI
2
OUT
3
OUT
4
SP
LD
7
OUT
8
X
Y
X
M
T
K
T
Y
0
0
1
100
0
19
0
1
When using hand held
programmers, the space key
needs to be pressed to enable
the constant to be entered.
Basic points to remember:
-Connect the LD and LDI instructions directly to the left hand bus bar.
-Or use LD and LDI instructions to define a new block of program 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 following page.
2-3
Page 30
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.5Out
MnemonicFunctionFormatDevicesProgram steps
OUT
(OUT)
Final logical
operation type coil
drive
FX
1S
Y, M, S, T, C
Y, M:1
S, special M
coils: 2
T:3
C (16 bit): 3
C (32 bit): 5
2NC
Basic points to remember:
-Connect the OUT instruction directly to the right hand bus bar.
-It is not possible to use the OUT instruction to drive ‘X’ type input devices.
-It is possible to connect multiple OUT instructions in parallel (for example see the
previous page; M100/T0 configuration)
2.5.1Timer and Counter Variations
When configuring the OUT instruction for use as either a timer (T) or counter (C) a constant
must also be entered. The constant is identified by the letter “K” (for example see previous
page; 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 of “K10 0” it will be (1005 100 msec) 10 seconds before the
timer coil activates.
With counters, the constant identifies how many times the counter must be pulsed or triggered
before the counter coil activates. For example, a counter with a constant of “8” must be
triggered 8 times before the counter coil finally energizes.
The following table identif ies some basic parameter data for various timers and counters;
1 msec Timer
10 msec Timer0.01 to 327.67 sec
100 msec Timer0.1 to 3276.7 sec
16 bit Counter1 to 32,7671 to 32,767
32 bit Counter
1 to 32,767
-2,147,483,648 to
2,147,483,647
0.001 to 32.767 sec
-2,147,483,648 to
2,147,483,647
3
5
2-4
Page 31
FX Series Programmable ControllersBasic Program Instructions 2
2.5.2Double Coil Designation
Double or dual coiling is not a recommended
1.
X1
Y3
practice. Using multiple output coils of the
same device can cause the program
operation to become unreliable. The example
program shown opposite identifies a double
coil situation; there are two Y3 outputs. The
Y3
Y4
following sequence of events will occur when
inputs X1 = ON and X2 = OFF;
2.
1.The first Y3 tuns ON because X1 is ON. The
X2
Y3
contacts associated with Y3 also energize
when the coil of output Y3 energizes. Hence,
output Y4 turns ON.
2.The last and most important line in this
program looks at the status of input X2.
If this is NOT ON then the seco nd Y3 c oil does N OT activate. T herefore the status of the Y3
coil updates to reflect this new situation, i.e. it turns OFF. The final outputs are then Y3 = OFF
and Y4 = ON.
Use of dual coils:
•Always check programs for incidents of dual coiling. If there are dual coils the
program will not operate as expected - possibly result ing in physical damage.
The last coil effect:
•In a dual coil designation, the coil operation designated last is the effective coil. That
is, it is the status of the previous coil that dictates the behavior at the current point in
the program.
Input durations:
1
4
5
6
t secs
4
7
2
3
The ON or OFF duration of the PLC inputs
must be longer than the operation cycle
time of the PLC.
Taking a 10 mse c (standard input filter)
response delay into acc ount, the ON/OFF
duration must be longer than 20 msec if
the operation cycle (scan time) is 10 msec.
Therefore, in this example, input pulses of
more than 25Hz (1sec/(20msec ON +
20msec OFF)) cannot be sensed.
There are applied instructions provided to
handle such high speed input requests.
: Input ON state NOT recognized
: Input ON state recognized
: Input OFF state NOT recognized
: 1 program processing
: Input processing
: Output processing
: A full program scan/operation cycle
2-5
Page 32
FX Series Programmable ControllersBasic Program Instructions 2
2.6And, And Inverse
MnemonicFunctionFormatDevicesProgram steps
AND
(AND)
ANI
(AND Inverse)
Program example:
X2
Y3
ANI
Serial connection
of NO (normally
open) contacts
Serial connection
of NC (normally
closed) contacts
X0
X3
AND
T1
Y3
M101
Y4
FX
1N
FX
FX
1S
X, Y, M, S, T, C1
X, Y, M, S, T, C1
LD
0
AND
1
OUT
2
LD
3
ANI
4
OUT
5
6
AND
OUT
7
2N
X
X
Y
Y
X
M
T
Y
FX
2
0
3
3
3
101
1
4
2NC
AND
Basic points to remember:
-Use the AND and ANI instructions for serial connection of contac t s. As man y cont act s as
required can be connected in series (s ee foll owing point headed “ Peripher al limitations”).
-The output processing to a coil, through a contact, after writing the initial OUT instruction
is called a “follow-on” output (for an example see the program above; OUT Y4). Followon outputs are permitted repeatedly as long as the output order is correct.
Peripheral limitations:
•The PLC has no limit to the number of contacts connected in ser ies or in parallel.
However, some pro gramming p anels , scree ns and print ers will not b e able to di splay
or print the program if it exceeds the limit of the hardware. It is preferable for each
line or rung of ladder pr ogram to contain up to a maximum of 10 contact s and 1 coil.
Also, keep the number of follow-on outputs to a maximum of 24.
2-6
Page 33
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.7Or, Or Inverse
MnemonicFunctionFormatDevicesProgram steps
FX
1S
2NC
Parallel
OR
(OR)
connection of NO
(normally open)
X, Y, M, S, T, C1
contacts
Parallel
ORI
(OR Inverse)
connection of NC
(normally closed)
X, Y, M, S, T, C1
contacts
Program example:
X4
X6
M102
Y5
X7
OR
ORI
X10
Y5
M103
LD
0
OR
1
ORI
2
OUT
3
LDI
4
AND
5
6
OR
ANI
7
8
9OROUT
X
X
M
Y
Y
X
M
X
M
M
4
6
102
5
5
7
103
10
110
103
M103
M110
Basic points to remember:
-Use the OR and ORI instructions for parallel connection of contacts. To connect a block
that contains more than one contact connected in series to another circuit block in
parallel, use an ORB instruction.
-Connect one side of the OR/ORI instruction to the left hand bus bar.
Peripheral limitations:
•The PLC has no limit to the number of contacts connected in ser ies or in parallel.
However, some programming panels, screens and printers will not be able to display
or print the program if it exceeds the limit of the hardware. It is preferable for each
line or rung of ladder program to contain up to a maximum of 10 contacts and 1 coil.
Also keep number of follow-on outputs to a maximum of 24.
2-7
Page 34
FX Series Programmable ControllersBasic Program Instructions 2
-Connect the LDP and LDF instructions directly to the left hand bus bar.
-Or use LDP and LDF instructions to define a new block of program when using the ORB
and ANB instructions (see later sections).
-LDP is active for one program scan after the associated device switches from OFF to ON.
-LDF is active for one program scan after the associated device switches from ON to
OFF.
Single Operation flags M2800 to M3071:
•The pulse operation instructions, when used with auxiliary relays M2800 to M3071,
only activate the first instruction encountered in the program scan, after the point in
the program where the device changes. Any other pulse operation instruct ions will
remain inactive.
•This is useful for use in STL programs (see chapter 3) to perform sin gle step
operation using a single device.
•Any other instructions (LD, AND, OR, etc.) will operate as expected.
For more details please see page 4-5.
2-8
Page 35
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.9And Pulse, And Trailing Pulse
MnemonicFunctionFormatDevicesProgram steps
FX
1S
2NC
ANP
(ANd Pulse)
ANF
(ANd Falling
pulse)
Serial connection
of Rising edge
pulse
Serial connection
of Falling /
trailing edge
pulse
Program example:
M40
X1
X0
T10
C0
ANP
ANF
M100
Y4
X, Y, M, S, T, C2
X, Y, M, S, T, C2
0LDM40
1OR X 1
2ANPT10
4OUTM 100
5LDF X 0
6ANF C 0
8OUTY4
Basic points to remember:
-Use the ANDP and ANDF instructions for the serial connection of pulse contacts.
-Usage is the same as for AND and ANI; see earlier.
-ANP is active for one program scan after the associated device switches from OFF to
ON.
-ANF is active for one program scan after the associated device switches from ON to
OFF.
Single operation flags M2800 to M3071:
•When used with flags M2800 to M3071 only the first instructi on wil l act ivate. For
details see page 2-8
2-9
Page 36
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.10Or Pulse, Or Trailing Pulse
MnemonicFunctionFormatDevicesProgram steps
FX
1S
2NC
Parallel
ORP
(OR Pulse)
connection of
Rising edge
X, Y, M, S, T, C2
pulse
ORF
(OR Falling
pulse)
Parallel
connection of
Falling / trailing
edge pulse
-Use the ORP and ORF instructions for the parallel connection of pulse contacts.
-Usage is the same as for OR and ORI; see earlier.
-ORP is active for one program scan after the associated device switches from OFF to
ON.
-ORF is active for one program scan after the associated device switches from ON to
OFF.
Single operation flags M2800 to M3071:
•When used with flags M2800 to M3071 only the first instruction will activate. For
details see page 2-8
2-10
Page 37
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.11Or Block
MnemonicFunctionFormatDevicesProgram steps
FX
1S
2NC
ORB
(OR Block)
Parallel connection
of multiple contact
circuits
N/A1
Program example:
Non-preferred batch
programming method
0
LD
1
AND
2
LD
3
AND
4
LDI
5
AND
6
ORB
ORB
7
8OUT
X
X
X
X
X4
X
Y6
X0X1
X2X3
X4X5
ORB
ORB
Y6
Recommended sequential
programming method
0
LD
1
AND
2
LD
3
AND
ORB
4
5
LDI
6
AND
ORB
7
8OUT
0
X
1
X
2
X
3
X
X
4
X
5
Y
6
Basic points to remember:
-An ORB instruction is an independent instruction and is not associated with any device
number.
0
1
2
3
5
-Use the ORB instruction to connect multi-contact circuits (usually serial circuit blocks) to
the preceding circuit in parallel. Serial circuit blocks are those in which more than one
contact connects in series or the ANB instruction is used.
-To declare the starting point of the circuit block use a LD or LDI instruction. After
completing the serial circuit block, connect it to the preceding block in parallel using the
ORB instruction.
Batch processing limitations:
•When using ORB instructions in a batch, use no more than 8 LD and LDI instr uctions
in the definition of the program blocks (to be connected in parallel). Ignoring this will
result in a program error (see the right most program listing).
Sequential processing limitations:
•There are no limitations to the number of parallel circuits when using an ORB
instruction in the sequential processing configuration (see the left most program
listing).
2-11
Page 38
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.12And Block
MnemonicFunctionFormatDevicesProgram steps
FX
1S
2NC
ANB
(ANd Block)
Serial connection
of multiple
parallel circuits
Program example:
ANB
X0
X1
X2X3
X4X5
X6
X3
Basic points to remember:
LD
Y7
ORB
N/A1
Recommended sequential
programming method
0
0
LD
1
OR
2
LD
3
AND
4
LDI
5
AND
6
ORB
7
OR
ANB
8
910OR
OUTXY
X
1
X
2
X
3
X
4
X
X
5
6
X
3
7
-An ANB instruction is an independent instruction and is not associated with any device
number
-Use the ANB instruction to connect multi-contact circuits (usually parallel circuit blocks)
to the preceding circuit in seri es. Parallel circuit blocks are those in which more than one
contact connects in parallel or the ORB instruction is used.
-To declare the starting point of the circuit block, use a LD or LDI instruction. After
completing the parallel ci rcuit block, connect it to the preceding block in series using the
ANB instruction.
Batch processing limitations:
•When using ANB instructions in a batch, use no more th an 8 LD and L DI instruc tions
in the definition of the program blocks (to be connected in parallel). Ignoring this will
result in a program error (see ORB explanation for example).
Sequential processing limitations:
•It is possible to use as many ANB instructions as necessary to connect a number of
parallel circuit blocks to the preceding block in series (see the program listing).
2-12
Page 39
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.13MPS, MRD and MPP
MnemonicFunctionFormatDevicesProgram steps
Stores the current
MPS
(Point Store)
MRD
(Read)
MPP
(PoP)
result of the
internal PLC
operations
Reads the current
result of the
internal PLC
operations
Pops (recalls and
removes) the
currently stored
result
MPS
MRD
MPP
FX
1S
N/A1
N/A1
N/A1
2NC
Basic points to remember:
-Use these instructions to connect output coils to the left hand side of a contact.
Without these instructions connections can only be made to the right hand side of the
last contact.
-MPS stores the connection point of the ladder circuit so that further coil branches can
recall the value later.
-MRD recalls or reads the previously stored connection point data and forces the next
contact to connect to it.
-MPP pops (recalls and removes) the stored connection point. First, it connects the next
contact, then it removes the point from the temporary storage area.
-For every MPS instruction there MUST be a corresponding MPP instruction.
-The last contact or coil circuit must connect to an MPP instruction.
-At any programming step, the number of active MPS-MPP pairs must be no greater than
11.
MPS, MRD and MPP usage:
•When writing a program in ladder format, programming tools aut omatically add all
MPS, MRD and MPP instructions at the program conversion stage. If the generated
instruction program is viewed, the MPS, MRD and MPP instructions are present.
•When writing a program in instructi on format, it is entirely down t o the user to ent er all
relevant MPS, MRD and MPP instructions as required.
2-13
Page 40
FX Series Programmable ControllersBasic Program Instructions 2
Multiple program examples:
X0X1
MPS
MRD
MPP
X2
X3
X5
X7
X4
X6
X10
Y0
Y1
Y2
Y3
10
11
0
LD
MPS
1
2
LD
3
OR
4
ANB
5
OUT
6
MRD
7
LD
8
AND
9
LD
AND
0
X
1
X
2
X
Y
0
X
3
4
X
5
X
6
X
ORB
12
13
14
15
16
17
18
19
20
ANB
OUT
MPP
AND
OUT
LD
OR
ANB
OUT
1
Y
7
X
2
Y
X
10
X
11
3
Y
X11
X0X1
MPS
MPP
MPS
X4X5
MPP
MPS
MPP
X0 X1 X2X3 X4
MPS
X2
X3
X6
Y0
Y1
Y2
Y3
Y0
Y1
Y2
Y3
Y4
0
LD
MPS
1
2
AND
MPS
3
4
AND
5
OUT
6
MPP
7
AND
8
OUT
LD
0
MPS
1
AND
2
MPS
3
AND
4
MPS
5
6
AND
MPS
7
AND
8
X
0
X
1
X
2
Y
0
X
3
Y
1
0
X
1
X
2
X
3
X
4
X
MPP
9
10
AND
MPS
11
12
AND
13
OUT
MPP
14
15
AND
16
OUT
OUT
9
MPP
10
OUT
11
MPP
12
OUT
13
MPP
14
OUT
15
MPP
16
17OUT
4
X
X
5
Y
2
X
6
Y
3
0
Y
1
Y
2
Y
3
Y
4
Y
MPP
2-14
Page 41
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.14Master Control and Reset
MnemonicFunctionFormatDevicesProgram steps
FX
1S
2NC
Y, M (no special
MC
(Master
Control)
Denotes the start
of a master control
block
MC N
M coils allowed)
N denotes the
nest level (N0 to
3
N7)
MCR
(Master
Control Reset)
Denotes th e end of
a master control
block
Program example:
X0
M100N0
X1
X2
Basic points to remember:
M100N0MC
Y0
Y1
N0MCR
MCR N
N denotes the
nest level (N0 to
2
N7) to be reset.
X
N
M
X
Y
X
Y
N
0
0
100
1
0
2
1
0
LD
0
MC
1
SP
LD
4
OUT
5
LD
6
7
OUT
MCR
8
Note: SP - space key
N - nest level of MC (N0 to N7)
-After the execution of an MC instructi on, the bus l ine (L D, LDI p oint) s hif t s to a point af ter
the MC instruction. An MCR instruction returns this to the ori ginal bus line.
-The MC instruction also includes a nest level pointer N. Nest levels are from the range
N0 to N7 (8 points). The top nest level is ‘0’ and the deepest is ‘7’.
-The MCR instruction resets each nest le vel. When a nest l evel i s r eset, it al so reset s ALL
deeper nest levels. For example, MCR N5 resets nest levels 5 to 7.
-When input X0=ON, all instructions between the MC and the MCR instruction execute.
-When input X0=OFF, none of the instruction between the MC and MCR instruction
execute; this resets all devices except for retentive timers, counters and d evices driven
by SET/RST instructions.
-The MC instruction can be used as many times as necessary, by changing the device
number Y and M. Using the same device number twice is processed as a double coil
(see section 2.5.2). Nest levels can be duplicated but when the nest level resets, ALL
occurrences of that level reset and not just the one specif ied in the local MC.
2-15
Page 42
FX Series Programmable ControllersBasic Program Instructions 2
Nested MC program example:
X0
A
M100N0MC
B
C
D
M100N0
M101N1
M102N2
X1
X2
X3
X4
X5
Level N0: Bus line (B) active when X0
is ON.
Y0
M101N1MC
Level N1: Bus line (C) active when
both X0 and X2 are ON.
Y1
M102N2MC
Level N2: Bus line (D) active when
X0,X2 and X4 are ON.
Y2
C
A
B
X6
X7
X10
MCR
MCR
MCR
N2
Y3
N1
Y4
N0
Y5
Level N1: MCRN2 executes and
restores bus line (C). If the MCR had
reset N0 then the original bus ba r (A)
would now be active as all master
controls below nest level 0 would reset.
Level N0: MCRN1 executes and
restores bus line (B).
Initial state: MCR N0 executes and
restores the in it ia l b u s li ne (A) .
Output Y5 turns ON/OFF according to
the ON/OFF state of X10, r egardles s of
the ON/OFF status of inpu ts X0, X2 or
X4.
2-16
Page 43
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.15Set and Reset
MnemonicFunctionFormatDevicesProgram steps
FX
1S
2NC
SET
(SET)
Sets a bit device
permanently ON
Resets a bit
RST
(ReSeT)
device
permanently
OFF
Program example:
X0
X1
X2
X3
X4
X5
X6
SETY0
RSTY0
SETM0
RSTM0
SETS0
RSTS0
RSTD0
SET
RST
Y, M, S
Y, M, S, D, V, Z
(see section
2.16 for timers
and counters
T,C)
0
1
2
3
4
5
6
7
8
9
10
11
12
13
Y,M:1
S, special M
coils:2
D, special D
registers, V and
Z:3
X
Y
X
Y
X
M
X
M
X
S
X
S
X
D
0
0
1
0
2
0
3
0
4
0
5
0
6
0
LD
SET
LD
RST
LD
SET
LD
RST
LD
SET
LD
RST
LD
RST
Basic points to remember:
-Turning ON X0 causes Y0 to turn ON.
Y0 remains ON even after X0 turns OFF.
-Turning ON X1 causes Y0 to turn OFF.
X0
Y0 remains OFF even after X1 turns
OFF.
X1
-SET and RST instructions can be used
for the same device as many times a s
Y0
necessary.
However, the last instruction activated
determines the current status.
-It is also possible to use the RST instruction to reset the contents of data devices such
as data registers, index registers etc. The effect is similar to moving ‘K0’ into the data
device.
Resetting timers and counters:
•Please see next page.
2-17
Page 44
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.16Timer, Counter (Out & Reset)
MnemonicFunctionFormatDevicesProgram steps
FX
1S
2NC
OUT
(OUT)
Driving timer or
counter coils
Resets timer and
RST
(ReSeT)
counter, coils
contacts and
current values
Program example:
X0
X1
T246
X2
X3
X4
RSTT246
T246
K1234
Y0
M8200
RST
C200
C200
D0
32 bit
T, C
counters:5
Others: 3
T, C
(see section
RST
2.15 for other
T, C:2
resetable
devices)
2.16.1Basic Timers, Retentive Timers And
Counters
These devices can all be reset at any time by
driving the RST instruction (with the num ber
of the device to be reset).
On resetting, all active contacts, coils and
current value reg isters are reset for the
selected device. In the example, T246, a
1msec retentive timer, is activate while X1 is
ON. When the current value of T246 reaches
the preset ‘K’ value, i.e. 1234 , the timer co il for
T246 will be activated. This drives the NO
contact ON. Hence, Y0 is switched ON.
Turning ON X0 will reset timer T246 in the
manner described previously.
Because the T246 contacts are reset, the
output Y0 will be turned OFF.
C200
Y1
Retentive timers:
•For more information on retentive timers please see page 4-17.
2-18
Page 45
FX Series Programmable ControllersBasic Program Instructions 2
2.16.2Normal 32 bit Counters
The 32 bit counter C200 counts (up-count, down-count) according to the ON/OFF state of
M8200. In the example program shown on the previous page C200 is being used to count the
number of OFF ~ ON cycles of input X4.
The output contact is set or reset depending on the direction of the count, upon rea ching a
value equal (in this exam ple) to the c ontents of data registers D1,D0 (32 bit s etting data is
required for a 32 bit counter).
The output contact is reset and the current value of the counter is reset to ‘0’ when input X3 is
turned ON.
32 bit counters:
•For more information on 32 bit counters please see page 4-21.
2.16.3High Speed Counters
High speed counters have selectable count
directions. The directions are selected by
driving the appropriate special auxiliary M
coil. The example shown to the right works
in the following manner; whe n X10 is ON,
counting down takes place. When X10 is
OFF counting up takes place.
In the example the output contacts of
counter C∆∆∆ and its associated current
count values are reset to “0” when X11 is
turned ON. When X12 is turned ON the
driven counter is enabled. This means it will
be able to start counting its assigned inpu t
signal (this will not be X12 - high speed
counters are assigned special input signals,
please see page 4-22)
X10
X11
X12
C
RST
M8
C
C
K/D
Y2
.
Availability of devices :
•Not all devices identified he re a re a vailabl e o n all prog rammable control lers . Ran ges
of active devices may vary from PLC to PLC. Please check the speci fic ava ilabi lit y of
these devices on the selected PLC before use. For more information on high speed
counters please see page 4-22. For PLC device ranges please see chapter 8.
2-19
Page 46
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.17Leading and Trailing Pulse
MnemonicFunctionFormatDevicesProgram steps
FX
1S
2NC
PLS
(PuLSe)
PLF
(PuLse Falling)
Rising edge
pulse
Falling / trailing
edge pulse
Program example:
X0
M0
X1
M1
Basic points to remember:
PLSM0
SETY0
PLFM1
RSTY0
PLS
PLF
Y, M
(no special M
coils allowed)
Y, M
(no special M
coils allowed)
0
1
3
4
5
6
8
9
LD
PLS
LD
SET
LD
PLF
LD
RST
X
M
M
Y
X
M
M
Y
2
2
0
0
0
0
1
1
1
0
-When a PLS instruction is
executed, object devices Y
and M operate for one
operation cycle after the drive
X0
X1
input signal has turned ON.
-When a PLF instruction is
M0
executed, object devices Y
M1
and M operate for one
operation cycle after the drive
input signal has turned OFF.
Y0
t msec
-When the PLC status is
changed from RUN to STOP and back to RUN with the input signals still ON, PLS M0 is
operated again. However, if an M coil which is battery backed (latched) was used instead
of M0 it would not re-activate. For the battery backed de vice to be re-pulsed, its driving
input (ex. X0) must be switched OFF during the RUN/STOP/RUN sequ ence before it will
be pulsed once more.
2-20
Page 47
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.18Inverse
MnemonicFunctionFormatDevicesProgram steps
FX
1S
2NC
Invert the current
INV
(Inverse)
result of the
internal PLC
N/A1
operations
Program example:
X0
X
M0
X1
M1
PLSM0
SETY0
PLFM1
RSTY0
LD
0
PLS
1
LD
3
SET
4
LD
5
PLF
6
8
LD
RST
9
M
M
Y
X
M
M
Y
0
0
0
0
1
1
1
0
Basic points to remember:
-The INV instruction is used to change (invert) the logical state of the current ladder
network at the inserted position.
-Usage is the same as for AND and ANI; see earlier.
Usages for INV
•Use the invert instruction to quickly change the logic of a complex circuit.
It is also useful as an inverse operation for the pulse contact instructions LDP, LDF,
ANP, etc.
2-21
Page 48
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.19No Operat ion
FX
1S
2NC
MnemonicFunctionFormatDevicesProgram steps
NOP
(No Operation)
No operation or
null step
N/AN/A1
Basic points to remember:
-Writing NOP instructions in the middle of a program minimizes step number changes
when changing or editing a program.
-It is possible to change the operation of a circuit by replacing programmed instructions
with NOP instructions.
-Changing a LD, LDI, ANB or an ORB instruction with a NOP instruction will change the
circuit considerably; quite possibly resulting in an error being generated.
-After the program ‘all clear operation’ is executed, all of the instructions currently in the
program are over written with NOP’s.
2-22
Page 49
FX Series Programmable ControllersBasic Program Instructions 2
FX
1N
FX
2N
FX
2.20End
FX
1S
MnemonicFunctionFormatDevicesProgram steps
2NC
END
(END)
Forces the current
program scan to
end
END
N/A1
Basic points to remember:
-Placing an END instruction in a program forces that program to end the curr ent scan and
carry out the updating processes for both inputs and outputs.
-Inserting END instructions in the middle of the program helps program debugging as the
section after the END instruction is disabled and isolated from the area that is being
checked. Remember to delete the END instructions from the blocks which have already
been checked.
-When the END instruction is processed the PLCs watchdog timer is automatically
refreshed.
A program scan:
•A program scan is a single processing of the loaded progra m from start t o finish, This
includes updating all inputs , outputs and watchdog timers. The time period for one
such process to occur is called the scan time. This will be dependent upon program
length and complexity. Immediately the current scan is completed the next scan
begins. The whole process is a continuous cycle. Updating of inputs takes place at
the beginning of each scan while all outputs are updated at the end of the scan.
2-23
Page 50
FX Series Programmable ControllersBasic Program Instructions 2
MEMO
2-24
Page 51
FX Series Programmable ControllersSTL Programming 3
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
Page 52
FX Series Programmable ControllersSTL Programming 3
This chapter differs from the rest of the contents in this manual as it has been written with a
training aspect in mind. STL/SFC programming, although having been available for many
years, is still misunderstood and misrepresented. We at Mitsubishi would like to take this
opportunity to try to correct this oversight as we see STL/SFC programming becoming as
important as ladder style programming.
3.1What is STL, SFC And IEC1131 Part 3?
The following explanation is very brief but is designed to quickly outline the differences and
similarities between STL, SFC and IEC1131 part 3.
In recent years Sequential Function Chart (or SFC) style programming (including other similar
styles such as Grafcet and Funktionplan) have become very popular through out Europe and
have prompted the creation of IEC1131 part 3.
The IEC1131 SFC standard has been designed to b ecome an interchangeable programm ing
language. The idea being that a program written to IEC1131 SFC standards on one
manufacturers PLC can be easily transferred (converted) for use on a secon d manufacturers
PLC.
STL programming is one of the basic programm ing instructions included in all FX PL C family
members. The abbreviation STL actually means STep Ladder programming.
STL programming is a very simple concept to understand yet can provide the user with one of
the most powerful programming techniques possible. The key to STL lies in its ability to allow
the programmer to create an operati onal program which ‘flows’ and wor ks in almo st exactly t he
same manner as SFC. This is not a coincidence as this programming technique has been
developed deliberately to achieve an easy to program and monitor system.
One of the key d ifferences to M itsubishi’s STL prog ramming system is that it can be entered
into a PLC in 3 formats. These are:
FX
1S
STL Programming 3
FX
1N
FX
2N
FX
2NC
Ι) Instruction - a word/mnemonic entry system
ΙΙ) Ladder - a graphical program construction method using a relay logic symbols
ΙΙΙ) SFC - a flow chart style of STL program entry (similar to SFC)
Examples of these programming methods can be seen on page 2-1.
General note:
•IEC1131-3: 03.1993 Programmable controllers; part 3: programming languages.
The above standard is technically identical to the ‘Euro-Norm’
EN61131-3: 07.1993
3-1
Page 54
FX Series Programmable ControllersSTL Programming 3
3.2How STL Operates
As previously mentioned, STL is a system which
allows the user to write a program which functions
in much the same way as a flow chart, this can be
seen in the diagram opposite.
STL derives its strength by organizing a larger
program into smaller more manageable parts.
Each of these parts can be referred to as either a
state or a step. To help identify the states, each is
given a unique identification number. These
numbers are taken from the state relay devices
(see page 4-6 for more details ).
M8002
X0
X1
S 0
S 22
X0
X1
S 26
3.2.1Each step is a program
Each state is completel y isol ated f rom all other states within the whole program. A good way to
envisage this, is that each state is a separate program and the user puts each of those
programs together in the order that they require to perform their task. Immediately this means
that states can be reused many times and in different orders. This saves on programming time
AND cuts down on the number of programming errors encountered.
A Look Inside an STL
On initial inspection the STL progra m looks as if it is a rather basi c flow diagram. But to fi nd out
what is really happening the STL state needs to be put ‘under a microscope’ so to speak.
When a single state is examined in more det ail, the sub-program can be viewed.
With the exception of the STL instructio n, it will be
immediately seen that the STL sub-program looks
just like ordinary programming.
The STL instruction is shown as a ‘fat’ normally
open contact.
All programming after an STL instruction is only
active when the associated state coil is active.
The transition condition is also written using
standard programming.
This idea re-enforces the concept that STL is really
a method of sequencing a series of events or as
mentioned earlier ‘of joining lots of smaller
programs together’.
T0
STL
S 22
X15
S 27
T7
2
S 22
T0
1
2
Y22
K20
T0
T0
SET S 27
1
3-2
Page 55
FX Series Programmable ControllersSTL Programming 3
Combined SFC Ladder representation
Sometimes STL programs will be written in hard copy as a combination of both flow diagram
and internal sub-program. (example shown below).
Identification of contac t states
•Please note the following convention
is used:
Normally Open contact
Normally Closed contact
Common alternatives are ‘a’ and ‘b’
identifiers for Normally Open,
Normally Closed states or often a line
drawn over the top of the Normally
Close
d contact name is used, e.g.
X000.
3.3How To Start And End An STL Program
Before any complex programming can be undertaken the basics of how to start and more
importantly how to finish an STL program need to be examined.
3.3.1Embedded STL programs
An STL style program does not have to
entirely replace a standard ladder logic
program. In fact it might be very difficult to do
so. Instead small or even large section of STL
program can be entered at any point in a
program. Once the STL task h as been
completed the program must go back to
processing standard program instructions until
the next STL program block. Therefore,
identifying the start and end of an STL
program is very important.
LD
OUT
LD
SET
STL
OUT
LDI
OUT
RET
LD
OUT
RST
M8002
X0
X1
T0
T7
S 0
S 22
S 27
X000
Y004
X002
S009
S009
Y010
X003
Y006
X005
Y007
M080
Y20
X0
X1
Y22
S 26
T0
K20
X15
Y27
T7
K20
Normal Ladder Program
Embedded STL Program
Y26
3.3.2Activating new states
Once an STL step has been selected, how is it used and how is the program ‘driven’?
This is not so difficult, if it is considered that for an STL step to be active its associated state
coil must be ON. Hence, to start an STL sequence all that has to be done is to drive the
relevant state ON.
There are many different methods to drive a
state, for example the initial state coils could
be pulsed, SET or just included in an OUT
instruction. However, within Mitsubishi’s STL
programming language an STL coil which is
SET has a different meaning than one that is
included in an OUT instruction.
Note: For normal STL operation it is recomm ended that the states are selected using the
SET instruction. To activate an STL step its state coil is SET ON.
STL
S 22
STL
S 27
T0
Y22
T0
SET S 27
3-3
K20
Page 56
FX Series Programmable ControllersSTL Programming 3
Initial Steps
For an STL program which is to be activated
on the initial power up of the P LC, a trigger
similar to that shown oppos ite could b e used,
i.e. using M8002 to drive the setting of the
initial state.
The STL step started in this manner is often
referred to as the initial step. Similarly, the
step activated first for any STL sequence is
also called the initial step.
3.3.3Terminating an STL Program
Once an STL program has been started the programmable controllers CPU will process all f ollowing instructions as being part of that STL program. This means that when a second program scan is started the normal instructions at the beginning of the program are considered to
be within the STL program. Th is is obviously inco rrect and the CPU will proce ed to identify a
programming error and disable the programmable controllers operation.
This scenario may seem a little strange but it does make sense when it is considered that the
STL program must return control to the ladder program after STL operation is complete. This
means the last step in an STL program needs to be identified in some way.
Returning to Standard Ladder
This is achieved by placing a RET or RETurn
instruction as the last instruction in the last
STL step of an STL program block.
This instruction then returns pro gramming control to the ladder sequence.
M8002
STL
S005
M8002
STL
S005
SET S005
X001
Y000
X000
Y011
X012
Y014
X013
SET S005
X001
Y000
X000
Y011
X012
Y014
X013
RET
Note: The RET instruction can be used to separate STL programs into sections, with stan-
dard ladder between each STL program . For display of STL in SFC style format the RE T
instruction is used to indicate the end of a complete STL program.
3-4
Page 57
FX Series Programmable ControllersSTL Programming 3
3.4Moving Between STL Steps
To activate an STL step the user must first drive the state coil. Setting the coil has already
been identified as a way to start an STL program, i.e. drive an initial state. It was also noted
that using an OUT statement to driving a state coil has a different meaning to the SET
instruction. These difference will now be explained:
3.4.1Using SET to drive an STL coil
•SET is used to drive an STL state coil to make the step active. Once the current STL step
activates a second fo llowing step, the sou rce STL coil is reset. He nce, although SET is
used to activate a state the resetting is automatic.
However, if an STL state is driven by a
series of standard ladder logic instructions,
i.e. not a preceding STL state, then
standard programming rules apply.
In the example shown o pposite S20 is not
reset even after S30 or S21 have been
driven. In addition, if S20 is turn ed OFF,
S30 will also stop operating. This is
because S20 has not been used as an STL
state. The first instruction involving the
status of S20 is a standard LoaD instruction and NOT an STL instruction.
X000
S020
S040
S020
S030
SET S021
RST S022
Note: If a user wishes to forcibly reset an
STL step, using the RST or ZRST (FNC
40) instructions would perform this task.
X000
ZRST S21 S28
•SET is used to drive an immediately following STL step which typicall y will have a larger
STL state number than the current step.
•SET is used to drive STL states which occur within the encl osed STL program flow, i. e.
SET is not used to activate a state which appears in an unconn ected, second STL flow
diagram.
3-5
Page 58
FX Series Programmable ControllersSTL Programming 3
3.4.2Using OUT to drive an STL coil
This has the same operational features as using SET. However, there is one major function
which SET is not used. This is to make what is termed ‘dist ant jumps’.
OUT is used for loops and jumps
If a user wishes to ‘jump’ back up a program,
i.e. go back to a state which has already been
processed, the OUT instruction would be used
with the appropriate STL state number.
Alternatively the user may wish to make a
Partial
repeat
S 0
S 20
OUT
S 21
S 0
S 20
Program
jump
large ‘jump’ forwards skipping a whole section
of STL programmed states.
OUT
S 22
S 21
S 22
S 23
Out is used for distant jumps
If a step in one STL program flow was required
to trigger a step in a second, separate STL
program flow the OUT instruction would be
STL
flow 1
S 0
S 20
STL
flow 2
S 40
used.
S 21
OUT
S 22
S 23
S 41
S 42
S 43
S 44
Note: Although it is possible to use SET for jumps and loops use of OUT is needed for
display of STL in SFC like structured format.
S 23
S 1
3-6
Page 59
FX Series Programmable ControllersSTL Programming 3
3.5Rules and Techniques For STL programs
It can be seen that there are a lot of advantages to using STL style programming but there are
a few points a user must be aware of when writing the STL sub-programs.
These are highlighted in this section.
3.5.1Basic Notes On The Behavior Of STL programs
•When an STL state becomes ac tive it s progr am is pr oces sed unti l the next st ep is tr ig gered.
The contents of the program can contain all of the progra mming items and features of a
standard ladder program, i.e. LoaD, AND OR, OUT, ReSeT etc., as well as applied
instructions .
•When writing the sub-program of an STL state, the first vertical ‘bus bar’ after the STL
instruction can be considered in a similar manne r as the left hand bus b ar of a standard
ladder program.
Each STL step makes its own bus bar. This
means that a user, cannot use an MPS
instruction directly after the STL instruction
(see ), i.e. There needs to be at least a
single contact before the MPS instruction.
Note: Using out coils and even app lied
instructions immediately after an STL
instruction is permitted.
STL
S005
1
X001
Y000
X000
Y011
X012
Y014
X013
RET
•In normal programming using dual coils is not an acceptable technique. However repetition
of a coil in separate STL program blocks is allowed.
This is because the us er can take advantage of the STL’s
unique feature of isolating al l STL steps except the active
STL steps.
This means in practice that there will be no conflict between
S 30
M111
dual coils. The example opposi te shows M111 used twice in a
single STL flow.
Caution: The same coil should NOT be programmed in st eps
S 31
M112
that will be active at the same time as this will res ult in the
same problem as other dual coils.
S 32
M111
3-7
Page 60
FX Series Programmable ControllersSTL Programming 3
•When an STL step transfers control to the next STL
step there is a period (one scan) while both steps
are active. This can cause problems with dual coils;
particularly timers.
S 30
K20
T001
If timers are dual coiled care must be taken to
ensure that the timer operation is completed during
the active STL step.
If the same timer is used in consecut ive steps then it
T001
S 31
T001
is possible that the timer coil is never deactivated
and the contacts of the timer will not be reset
leading to incorrect timer operation.
S 32
K50
T001
The example opposite identifies an unacceptable
use of timer T001. When contro l pass es from S30 to
S31 T001 is not reset because its coil is sti ll ON in
the new step.
Note: As a step towards ensuring the correct operation of the dual timers they
should not be used in consecutive STL steps.
Following this simple rule will ensure each timer will be reset correctly bef ore its next
operation.
•As already mentioned, during the transfer between
steps, the current and the selected steps will be
simultaneously active for one program scan. This
could be thought of as a hand over or handshaking
period.
This means that if a user has two outputs contained
in consecutive steps which must NOT be active
simultaneously they must be interlocked. A good
example of this would be the drive signals to select
a motors rotation direction. In the exampl e Y11 and
Y10 are shown interlocked with each other.
S 30
S 31
Y10
Y11
Y11
Y10
3-8
Page 61
FX Series Programmable ControllersSTL Programming 3
3.5.2Single Signal Step Control
Transferring between active STL steps can be controlled by a single signal. There are two
methods the user can program to achieve this result.
FX
1N
FX
2N
FX
Method 1 - Using locking devices
FX
1S
2NC
In this example it is necessary to program separate locking devices, and the controlling signal
must only pulse ON. This is to prevent the STL programs from running through.
The example shown below identifies the general program required for this method.
-S30 is activated when M0 is first pulsed ON.
-The operation of M1 prevents the sequence
M0
from continuing becaus e although M0 is ON,
the transfer requirements, need M0 to be ON
S 30
M1PLS
and M1 to be OFF.
-After one scan the pulsed M0 and the ‘lock’
device M1 are reset.
M0
M1
-On the next pulse of M0 the STL step will
transfer program control from S31 to the next
step in a similar manner. This time using M2 as
S 31
M2PLS
the ‘lock’ device because dual coils in
successive steps is not allowed.
-The reason for the use of the ‘lock’ devices M1
M0
M2
and M2 is because of th e hands haking pe riod
when both states involved in the transfer of
program control are ON for 1 prog ram scan. Without the ‘lo cks’ it would be po ssible to
immediately skip through all of the STL states in one go!
FX
1N
FX
2N
FX
Method 2 - Special Single Pulse Flags
FX
1S
2NC
Using the pulse contacts (LDP, LDF, ANP, etc.) and a special range of M devices (M2800 to
M3071) the same result as method 1 can be achieved. The special feature of these devices
prevents run through of the states, as only the first occurrence of the LDP instruction will
activate.
The example program below shows the necessary instructions.
-Assume S50 is already active.
-When X01 activates M2800, this in turn
activates the LDP M2800 instruction in
S50 and the flow moves on to step
LAD0
X001
M2800
M2800
S51.
-The LDP M2800 instruction in the
transition part of S51 does not execute
because this is the second occurrence
of M2800 in a pulse contact.
-When X01 next activates M2800, the
LDP instruction in S51 is the first
S 50
M2800
S 51
M2800
occurrence because S50 is now
inactive. Thus, control passes to the
next step in the same manner.
M2800
M2800
M2800
Do not use the
step control
device in a
pulse contact
w ithin th e main
program body.
SETS51
SETSnn
3-9
Page 62
FX Series Programmable ControllersSTL Programming 3
3.6Restrictions Of Some Instructions When Used With STL
Although STL can operate with most basic and app lied i nst ructi ons ther e are a f ew exc eptions.
As a general rule STL and MC-MCR programming formats should not be combined. Other
instruction restrictions are l isted in the table below.
Basic Instructions
LD, LDI, AND,
Operational State
ANI, OR,ORI,
NOP, OUT,
SET, RST,
PLS,PLF
ANB, ORB,
MPS,MRD,
MPP
MC, MCR
Initial and general
states
Branch-
ing and
Output
processing
STL
STL
✔✔✗
S**SET
S**SET
✔✔✗
merging
states
Transfer
processing
STL
STL
STL
S**SET
✔✗ ✗
Restrictions on using applied instructions
•Most applied instructions can be used within STL programs. Attention must be paid to
the way STL isolates each non-active step. It is recommended that when appli ed
instructions are used thei r operation i s completed befor e the active STL step transf ers to
the next step.
Other restrictions are as follows:
-FOR - NEXT structures can not contain STL program blocks.
-Subroutines and interrupts can not contain STL program blocks.
-STL program blocks can not be written after an FEND instruction.
-FOR - NEXT instructions are allo wed within an STL program with a nesting of up to 4
levels.
For more details please see the operational compatibility listed in the two tables on
pages 7-12,7-13.
Using ‘jump’ operations with STL
•Although it is possible to use the program jump operations (CJ instruction) within STL
program flows, this causes additional and often unnecessary program flow
complications. To ensure easy maintenance and quick error finding it is recommended
that users do not write jump instructions into their STL programs.
3-10
Page 63
FX Series Programmable ControllersSTL Programming 3
3.7Using STL To Select The Most
Appropriate Program
So far STL has been con sidered as a simple flow ch arting programm ing language. On e of
STL’s exceptional features is the ability to create programs which can have several operating
modes. For example certain machines require a selection of ‘manual’ and ‘automatic’ modes,
other machines may need the abilit y to select the operation or manufacturing processes
required to produce product s ‘A’, ‘B’, ‘C’, or ‘D’. STL achieve s this by al lowing multipl e prog ram
branches to originate from on e STL state. Each branc h is then programm ed as an individual
operating mode, and because e ach operating mode s hould act indivi dually, i.e. there should be
no other modes active; the selection o f the program b ranch must be mutually exclusive . This
type of program construction is called “Selective Branch Programming”. An example
instruction program can be seen be low, (this is the sub-program for STL state S20 only) notice
how each branch is SET by a different contact.
S 20
X0
S 21S 31S 41
Y0
X1X2
FX
1S
FX
STL
OUT
LD
SET
LD
SET
LD
SET
1N
S
Y
X
S
X
S
X
S
FX
2N
20
21
31
41
FX
2NC
0
0
1
2
A programming construct ion t o s plit the progr am fl ow between different branches is very useful
but it would be more useful if it could be used with a method to rejoin a set of individual
branches.
STL
S 29
Y10
S 39S 49
Y11
Y12
OUTSY2910
LD
X10
X11X12
SETXS1050
STL
OUTSY3911
LD
S 50
SETXS1150
STL
OUTSY4912
LD
SETXS1250
This type of STL program construction is called a “First State Merge” simply because the first
state (in the example S29, S39 or S49) to complete its operation will cause the merging state
(S50) to be activated. It should be noticed how each of the final STL states on the different
program branches call the same “joining” STL state.
3-11
Page 64
FX Series Programmable ControllersSTL Programming 3
Limits on the number of branches
•Please see page 3-14 for general notes on programming STL branches.
Notes on using the FX-PCS/AT-EE software
•Please see page 3-15 for precautions when using the FX-PCS-AT/EE software.
3.8Using STL To Activate Multiple Flows
Simultaneously
In the previous branching technique, it was seen how a single flow could be selected from a
group. The following methods describe how a group of individual flows can be activated
simultaneously. Applications could include vending machines which have to perform several
tasks at once, e.g. boiling water, adding different taste ingredient s (c offee , tea, milk, sugar ) etc.
In the example below when state S20 is active and X0 is then sw itched ON, states S21, S31
and S41 are ALL SET ON as the next states. Hence, three separate, individual, branch flows
are ‘set in motion’ from a single branch point. This programming technique is often called a
‘Parallel Branch’. To aid a quick visual distinction, parallel br anches are mar ked with horiz ontal,
parallel lines.
S 20
X0
S 21S 31S 41
Y0
FX
1S
FX
STL
OUT
LD
SET
SET
SET
1N
FX
2N
FX
2NC
S
20
Y
0
0
X
S
21
31
S
41
S
3-12
Page 65
FX Series Programmable ControllersSTL Programming 3
When a group of branch flows are activated, the user will often either;
a) ‘Race’ each flow against its counter parts. The flow which completes fastest would then
activate a joining function (“First State Merge” described in the previous section) OR
b) The STL flow will not continue until ALL branch flows have completed there tasks.
This is called a ‘Multiple State Merge”.
An explanation of Multiple State Merge now follows below.
In the example below, states S29, S39 and S49 must all be active. If the instruction list is
viewed it can be seen that each of the states has its own operating/processing instructions but
that also additional STL instructions have been linked to gether (in a similar con cept as the
basic AND instruction). Before state S50 can be activated the trigger conditions must also be
active, in this example these are X10, X11 and X12. Once all states and input conditions are
made the merging or joining state can be SET O N. As is the general case, all of the s tates
used in the setting procedure are reset automatically.
S 29
X10
X11
Y10
S 39S 49Y11Y12
OUTSY2910
STL
OUTSY3911
X12
STL
S 50
STL
OUTSY4912
29
S
STL
39
S
STL
49
S
STL
10
X
LD
11
X
AND
X
AND
SET
Because more than one state is being simultaneously joined with further states (some times
described as a parallel merge), a set of horizontal parallel lines are used to aid a quick visual
recognition.
12
S
50
Limits on the number of branches
•Please see page 3-14 for general notes on programming STL branches.
Notes on using the FX-PCS/AT-EE software
•Please see page 3-15 for precautions when using the FX-PCS-AT/EE software.
3-13
Page 66
FX Series Programmable ControllersSTL Programming 3
3.9General Rules For Successful STL Branching
For each branch point 8 further branches may be progr ammed. Ther e are no li mit s t o th e number of states contai ned in a singl e STL flow. Hence, the possibility exists for a single init ial st ate
to branch to 8 branch flows which in turn could each branch to a further 8 branch flows etc. If
the programmable controller s progra m is read/writ ten using in struction o r ladder f ormats the
above rules are acceptable. However, users of the FX-PCS/AT-EE programming package who
are utilizing the ST L programmin g feature are cons trained by fu rther rest rictions to en able
automatic STL program conversions (please see page 3-15 for more details).
When using branches, different types of branching /merging cannot be mixed at the same
branch point. The item marked with a ‘S’ are transfer condit ion which are not permitted.
The following branch configurations/modifications are recommended:
S 30S 40S 20
X0X1X2
X3X4
S 60S 50
S 30S 40S 20
X0X1X2
S 100
Dummy state
(S100)(S100)
X3X4
S 60S 50
S
STL
X
LD
SET
STL
LD
SET
STL
LD
SET
STL
LD
AND
SET
LD
AND
SET
100
S
S
X
100
S
S
X
100
S
100
S
100
S
X
S
100
S
X
S
Rewrite as
In Instruction
format...
20
0
30
1
40
2
3
50
4
60
X0
X0
S 101
(S101)
STL
STL
STL
LD
SET
STL
LD
SET
SET
S 60S 50
Dummy
state
S 60S 50
S
S
S
X
S
S
S
S
S
S 40S 30S 20
Rewrite as
S 40S 30S 20
In Instruction
format...
20
30
40
0
101
101
101
50
60
X0X1
X0X1
STL
LD
SET
STL
LD
SET
STL
LD
SET
SET
S 30S 20S 30S 20
S 50S 40
S 30S 20
Dummy
state
(S102)
S 50S 40
S
20
X
0
S
102
S
30
X
1
S
102
S
102
S
102
S
40
S
50
(S103)
X0
X0
X1
S 103S 102
STL
STL
LD
SET
STL
LD
AND
SET
LD
AND
SET
X2X1
(S103)
X2
S
S
X
S
S
S
X
S
S
X
S
S 50S 40
S 30S 20
Dummy
state
S 50S 40
20
30
0
103
103
103
1
40
103
2
50
3-14
Page 67
FX Series Programmable ControllersSTL Programming 3
Further recommended program changes:
S 20
X0
S 21
S 22
S 29
X4
S 23
X5
S 24
X6
X1
X2
X3
X7
Program violation!
X10
X11
X12
X13
X17
S 25
S 26
X14
X15
X16
Rewrite as...
S 27
S 28
Rewrite as...
S 20
X0X0X10X10
X1
X2
X3
X7X7X17X17
X0
X2
X6
X4
S 21
X5
S 22
X6
S 29
S 20
S 21
X3
S 22
S 29
S 23
S 24
S 23
S 24
X11
S 25
X12
S 26
X13
X1
S 25
X4
S 26
X7
X14
S 27
X15
S 28
X16
S 27
X5
S 28
3.10General Precautions When Using
The FX-PCS/AT-EE Software
This software has the ability to program in SFC flow diagrams. As part of this ability it can read
and convert existing STL programs back into SFC flows even if they were never originally
programmed using the FX-PCS/AT-EE software. As an aid to allowing t his automatic SFC flow
generation the following rules and points should be noted:
1) When an STL flow is started it should be initialized with one of the state devices from the
range S0 to S9.
2) Branch selection or merging should always be written sequentially moving from left to right.
This was demonstrated on page 3-11, i.e. on the selective branch S21 was specified before
S31 which was specified before S 41. The merge states were program med in a similar
manner , S29 proceeded S39 which proceeded S49.
3) The total number of branches which can be programmed with the STL programming mode
are limited to a maximum of 16 circuits for an STL flow. Each branch point is limited to a
maximum of 8 branching flows. This means two branch points both of 8 branch f lows woul d
equal the restriction. These rest rict ions ar e to ensure th at t he user can alway s view the STL
flow diagram on the computer running the FX-PCS-AT/ EE software and that when it is
needed, the STL program flow can be printed out clearly.
STL
LD
SET
SET
LD
SET
SET
20
S
X
0
S
21
S
23
X
1
S
25
S
27
FX
1S
STL
LD
SET
STL
STL
LD
SET
FX
1N
22SSTL
24
S
6
X
29
S
26
S
28
S
7
X
29
S
FX
2N
FX
2NC
3-15
Page 68
FX Series Programmable ControllersSTL Programming 3
FX
1N
FX
2N
FX
3.11Programming Examples
FX
1S
2NC
3.11.1A Simple STL Flow
Loading hopper
Y12
Y10
Start button
X0
Y11
Ore truck
Y13
X2X1
Ore dischange point
This simple example is an excerpt from a semi-aut omatic loadi ng-unload ing ore truck pr ogram.
This example program has a b uilt in, initialization routine which occurs o nly when the PLC is
powered from OFF to ON. This is achieved by using the special auxiliary r elay M8002.
This activates a Zone ReSeT (ZRST is applied
instruction 40) instruction which ensures all of
the operational STL states within the program
M8002
ZRST S21 S25
are reset. The program example opposite
shows an M8002/ZRST example.
The push button X0 acts as a start button and a mod e selection bu tton. The STL state S0 is
initialized with the ZRST instruction. The system waits until inputs X0 and X2 are given and Y
13 is not active. In the scenario this means the ore truck is positioned at the o re discharge
point, i.e. above the position sensor X2. The ore truck is not currently discharging its load, i.e.
the signal to open the trucks unloading doors (Y13) is not active and the start button (X0) has
been given. Once all of the points have been met the program steps on to state S21.
On this state the ore cart is moved (Y10) and positioned (X1) at the loading hopper. If the start
button (X0) is pressed during this stage the ore cart will be set into a repeat mode (M2 is reset)
where the ore truck is immediately returned to the loading hopper after discharging its current
load. This repeat mode must be selected on every return to the loading station.
Once at the loading point the pro gram steps onto state S22. This state open s the hoppers
doors (Y11) and fills the truck with ore. After a timed dura tion, state S23 is activated and the
truck returns (Y12) to the discharge point (X2) .
3-16
Page 69
FX Series Programmable ControllersSTL Programming 3
Once at the discharge point the truck opens its bottom doors (Y13). After a timed duration in
which the truck empties its contents, the program checks to see if the repeat mode was
selected on the last cycle, i.e. M2 is reset. If M2 was reset (in sta te S21) the program ‘jump s’ to
step S21 and the ore truck is returned for immediate refilling. If M2 is not reset, i.e. it is active,
the program cycles back to STL state S0 where the ore truck will wait until the start push
button is given.
This is a simple program and is by no means c omplete but it identif ies the way a series of t asks
have been mapped to an STL flow.
S 0
X0
X2
Y13
S 21
X1
S 22
T1
S 23
X2
S 24
T2
M2M2
S 25
M2
8002
M
LD
SET
ZRST
STL
LD
AND
ANI
SET
STL
OUT
LD
RST
0
S
40
21
S
25
S
0
S
0
X
2
X
13
Y
21
S
21
S
10
Y
0
X
2
M
X0
LD
SET
STL
OUT
OUT
K
LD
SET
STL
OUT
LD
SET
STL
OUT
Y10
RST
Y11
Y12
Y13
SET
1
X
22
S
22
S
11
Y
1
T
70
1
T
23
S
23
S
12
Y
2
X
24
S
24
S
13
Y
M2
T1
T2
M2
K50
OUT
K
LD
ANI
SET
LD
AND
OUT
STL
SET
LD
OUT
RET
END
K70
M8002
ZRST
STL
S 0
STL
S 21
STL
S 22
STL
S 23
STL
S 24
STL
2
T
50
T
M
25
S
T
M
S
25
S
M
M
21
S
S 25
2
2
2
2
0
2
2
X2X0Y13
X0
X1
T1
X2
T2
T2
M2
M2
M2
SET S 0
S 25
S 21
SET S 21
Y10
RST M 2
SET S 22
Y11
T1
SET S 23
Y12
SET S 24
Y13
T2
SET S 25
S 0
SET M 2
S 21
RET
END
K70
K50
Identification of normally closed contacts
This example has used the line convention to identify normally closed contacts, for further
variations and different methods used to perform this task please see the information note
page 3-3.
3-17
Page 70
FX Series Programmable ControllersSTL Programming 3
3.11.2A Selective Branch/ First State Merge Example Program
The following example depicts an automatic so rting robot. The robot sorts two s izes of ball
bearings from a mixed ‘source pool ’ into individual storage buckets containing only one type of
ball bearing.
X12Y7
Y3
Y4
Y2
Y0
X1
X3
X2
Y1
X0
X4X5
The sequence of physical events (from initial power On) are:
1) The pickup arm is moved to its zero-point when the start button (X12) is pressed. When the
pickup arm reaches the zero-point the zero-point lamp (Y7) is lit.
2) The pickup arm is lowered (Y0) until a ball is collected (Y1). If the lower limit switch (X2) is
made a small ball bearing ha s been collecte d; consequently no lower limit switch signal
means a large ball bearing has been collected. Note, a proximity switch (X0) within the
‘source pool’ identifies the availabi lity of ball bearings.
3) Depending on the collected ball, the pickup arm retracts (output Y2 is operated until X3 is
received) and moves to the right (Y3) where it will stop at the limit switch (X4 or X5)
indicating the container required for storage.
4) The program continues by lowering the pickup arm (Y0) until the lower limit switch (X2) is
reached.
5) The collected ball being is released (Y1 is reset).
6) The pickup arm is retracted (Y2) once more.
7) The pickup arm is traversed back (Y4) to the zero-point (X1).
Points to note
•The Selective Branch is used to choose the delivery program for either small ball
bearings or large ball bearings. Once the dest ination has been reached (i .e. step S24
or S27 has been executed) the two independent program flows are rejoined at step
S30.
•The example program shown works on a single cycle, i.e. every time a ball is to be
retrieved the start button (X12) must be pressed to initiate the cycle.
3-18
Page 71
FX Series Programmable ControllersSTL Programming 3
Full STL flow diagram/program.
X12
Y7
T0
X2
T1
X3
X4
S 0
Start
Zero-point arrival
S 21
Lower limit = small ball
S 22
S 23
Upper limit reached
X4X5
S 24
Move to small ball bucket
Y0
K20
T0
SET Y1
K10
T1
Y2
Y3
This example uses the dot notation to identify
normally open and normally closed contacts.
Normally open contacts
Normally closed contacts
Lower pickup arm
T0
X2
Collect ball
T1
Raise
pickup arm
X3
X5
Lower limit = large ball
S 25
S 26
Upper limit reached
S 27
Move to large ball bucket
SET Y1
T1
Y2
Y3
K10
Collect
ball
Raise
pickup arm
S 30
X2
T2
X3
X1
Lower limit reached
S 31
S 32Y2
Upper limit reached
X1
S 33Y4
Zero-point reached
Y0
RST Y1
K10
T2
Lower pickup arm
Release ball
Raise pickup arm
Return to zero-point
3-19
Page 72
FX Series Programmable ControllersSTL Programming 3
3.12Advanced STL Use
STL programming can be enhanced by using the Initial State Applied Instruction. This
instruction has a mnemonic abbrevi ation of IST and a sp ecial f uncti on number of 6 0. When t he
IST instruction is used an a utomatic assignment o f state relays, spec ial auxiliary relays (M
coils) is made. The IST instruction provides the user with a pre-formatted way of creating a
multi-mode program. The modes available are:
a) Automatic:
-Single step
-Single cycle
-Continuous
b) Manual:
-Operator controlled
-Zero return
More details on this instruction can be found on page 5-67.
3-20
Page 73
FX Series Programmable ControllersDevices in Detail 4
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
Page 74
FX Series Programmable ControllersDevices in Detail 4
Chapter Contents
4. Devices in Detail....................................................................................4-1
4.15.2 Floating Point Format ..............................................................................................4-45
4.15.3 Summary Of The Scientific Notation and Floating Point Numbers..........................4-46
Page 75
FX Series Programmable Controllers
4.Devices in Detail
4.1Inputs
Device Mnemonic: X
Purpose: Representation of physical inputs to the programmable controller (PLC)
Alias: I/P
Inp
(X) Input
Input contact
Available forms: NO () and NC () contacts only
(see example device usage for references)
Devices numbered in: Octal, i.e. X0 to X7, X10 to X 1 7
Further uses: None
Example device usage:
FX
1S
FX
Devices in Detail 4
1N
FX
2N
FX
2NC
X0
X1
21
Available devices:
•Please see the information point on page 4-2, Outputs. Alternatively refer to the
relevant tables for the selected PLC in chapter 8.
Configuration details:
•Please see chapter 9
Y10
4-1
Page 76
FX Series Programmable ControllersDevices in Detail 4
FX
1N
FX
2N
FX
4.2Outputs
FX
1S
2NC
Device Mnemonic: Y
Purpose: Representation of physical outputs from the programmable controller
Alias: O/P
Otp
Out (Y)
Output (Y)
Output (coil/ relay/ contact)
Available forms: NO () and NC contacts and output coils ()
(see example device usage for references)
Devices numbered in: Octal, i.e. Y0 to Y7, Y10 to Y 1 7
Further uses: None
Example device usage:
X0
X1
Y10
Y10
2
1
Available devices:
PLC
FX1S161430
FX1N128128128
FX2N
FX2NC
Maximum number of
inputs
256 (addressable in
software)
•Please note, these are all the absolute maximums which are available. The values are
subject to variations caused by unit selection. For configuration details please see
chapter 9.
Maximum number of
outputs
256 (addressable in
software)
Absolute total
available I/O
256 (T otal addressed in
software/hardware)
•For more information about the device availability for individual PLC’s, please see
chapter 8.
4-2
Page 77
FX Series Programmable ControllersDevices in Detail 4
FX
1N
FX
2N
FX
4.3Auxiliary Relays
FX
1S
2NC
Device Mnemonic: M
Purpose: Internal programmable controller status flag
Alias: Auxiliary (coil/ relay/ contact/ flag)
M (coil/ relay/ contact /flag)
M (bit) device
Available forms: NO () and NC contacts and output coils ()
(see example device usage for references)
Devices numbered in: Decimal, i.e. M0 to M9, M10 to M19
Further uses: General stable state auxiliary relays - see page 4-3
Battery backed/ latched auxiliary relays - see page 4-4
Special diagnostic auxiliary relays - see page 4-5
Example device usage:
4.3.1General Stable State Auxiliary Relays
•A number of auxiliary relays are used in the PLC. The coils of these relays are driven by
device contacts in the PLC in the same manner that the output relays are driven in the
program.
All auxiliary relays have a number of electronic NO and NC contacts which can be used by
the PLC as required. Note that thes e contacts cannot directly drive a n external load. Only
output relays can be used to do this.
Available devices:
PLC FX1SFX1NFX2NFX2NC
General auxiliary
relays
Battery backed/
latched relays
Total available512
384
(M0 - 383)
128
(M384 - 511)
X0
X1
M507
1
384
(M0 - 383)
1152
(M384 -
1535)
500
(M0 - 499)
2572
(M500 -
3071)
(M0 - 499)
153630723072
M507
2
500
2572
(M500 -
3071)
•For more information about device availability for individual PLC’s, please see chapter 8.
4-3
Page 78
FX Series Programmable ControllersDevices in Detail 4
4.3.2Battery Backed/ Latched Auxiliary Relays
There are a number of battery b acked or latched re lays whose status is retained in battery
backed or EEPROM memory. If a power failure should occur all output and general purpose
relays are switched off. When operation is resumed the previous status of these relays is
restored.
The circuit shown on page 4-3 is an example of a sel f ret a ining ci rcuit . Relay M507 is activat ed
when X0 is turned ON. If X0 is turned OFF after the activation of M507, the ON status of M507
is self retained, i.e. the NO contact M507 drives the coil M507.
However, M507 is reset (turned OFF) when the input X1 is turned ON, i.e . the NC contact is
broken.
A SET and RST (reset) instruction ca n be used to retain the status of a relay being activated
momentarily.
X0
SET M507
X1
RST M507
External loads:
•Auxiliary relays are provided with countless number of NO contact points and NC
contact points. These are freely available for use through out a PLC program. These
contacts cannot be used to directly drive external loads. All external loads should be
driven through the use of direct (Y) outputs.
4-4
Page 79
FX Series Programmable ControllersDevices in Detail 4
4.3.3Special Diagnostic Auxiliary Relays
A PLC has a number of special auxiliary relays. These rela ys all have specific functions a nd
are classified into the foll owing two types.
a) Using contacts of special auxiliary relays
-Coils are driven automatically by the PLC. Only the contacts of these coils may be
used by a user defined program.
Examples: M8000: RUN monitor (ON during run)
M8002: Initial pulse (Turned ON momentarily when PLC starts)
M8012: 100 msec clock pulse
b) Driving coils of special auxiliary relays
-A PLC executes a predetermined specific operation when these coils are driven by the
user.
Examples: M8033: All output statuses are retained when PLC operation is stopped
M8034: All outputs are disabled
M8039: The PLC operates under constant scan mode
Available devices:
•Not all PLC’s share the same range, quantity or operational meaning of diagnostic
auxiliary relays. Please check the availability and function before using any device.
PLC specific diagnostic ranges and meanings are available in chapter 6.
4.3.4Special Single Operation Pulse Relays
When used with the pulse contacts LDP, LDF, etc., M devices in the range M2800 to M3072
have a special meaning. With these devices, only the ne xt pulse contact instruction after the
device coil is activated.
1
LDP
2
LDP
3
LDP
4
LD
M0
X0
M0
M0
M0
SETM50
M0
SETM51
SETM52
SETM53
5
LDP
6
LDP
7
LDP
8
LD
M2800toM3072M0toM2799
M2800
X0
M2800
M2800
M2800
FX
1S
SETM50
M2800
SETM51
SETM52
SETM53
FX
1N
FX
2N
FX
2NC
Turning ON X0 causes M0 to turn ON.
•Contacts , and are pulse contacts and activate for 1 scan.
•Contact is a normal LD contact and
activates while M0 is ON.
Turning ON X0 causes M2800 to turn ON.
•Contact is a pulse contact and activates for 1 scan.
•Contacts and are pulse contacts
of the same M device as contact .
Contact has already operated, so
contact and do not operate.
•Contact is a normal LD contact and
activates while M2800 is ON.
4-5
Page 80
FX Series Programmable ControllersDevices in Detail 4
FX
1N
FX
2N
FX
4.4State Relays
FX
1S
2NC
Device Mnemonic: S
Purpose: Internal programmable controller status flag
Alias: State (coil/ relay/ contact/ flag)
S (coil/ relay/ contact /flag)
STL step (coil/ relay/ contact /fl ag)
Annunciator flag
Available forms: NO (➀ ) and NC contacts and output coils (➁ )
(see example device usage for references)
Devices numbered in: Decimal, i.e. S0 to S9, S10 to S19
Further uses: General stable state - state relays - see page 4-6
Battery backed/ latched state relays - see page 4-7
STL step relays - see page 4-8
Annunciator flags - see page 4-9
Example device usage:
4.4.1General Stable State - State Relays
A number of state relays are used in the PLC. The coils of these rela ys are driven by device
contacts in the PLC in the same manner that the output relays are driven in the program.
All state relays have a number of electronic NO and NC contacts which can be used by the
PLC as required. Note that these contacts cannot directly drive an external load. Only output
relays can be used to do this.
Available devices:
•Please see the information point on page 4-7 ‘Battery backed/ latched state relays’,
or see the relevant tables for the selected PLC in chapter 8.
X0
S20
1
X1
S20
2
4-6
Page 81
FX Series Programmable ControllersDevices in Detail 4
4.4.2Battery Backed/ Latched State Relays
There are a number of battery b acked or latched re lays whose status is retained in battery
backed or EEPROM memory. If a power failure should occur all output and general purpose
relays are switched off. When operation is resumed the previous status of these relays is
restored.
Available devices:
PLCFX1SFX1NFX2NFX2NC
General state
relays
Battery backed/
latched relays
Total available12810001000
N/AN/A
128
(S0 - 127)
1000
(S0 - 999)
500
(S0 - 499)
500
(S500 - 999)
•For more information about device availability for individual PLC’s, see chapter 8.
External loads:
•State relays are provided with countless number of NO contact points and NC contact
points, and are freely available for use through out a PLC program. These contacts
cannot be used to directly drive external loads. All external loads should be driven
through the use of direct (ex. Y) outputs.
4-7
Page 82
FX Series Programmable ControllersDevices in Detail 4
4.4.3STL Step Relays
States (S) are very important devices when
programming step by step process control. They are
used in combination with the basic instruction STL.
1
S2
X0
When all STL style programming is used certain stat es
have a pre-defined operation. The step identified as ➀
S20
in the figure opposite is called an ‘i nitial state ’. All oth er
state steps are then used to build up the full STL
function plan. It should be remembered that even
though remaining state steps are used in an STL
format, they still retain their general or latched
X1
S21
X2
operation status. The range of available devices is as
specified in the information point of the previous
S22
section.
X3
Assigned states:
•When the applied instruction IST (Initial STate function 60) is used, the following state
devices are automatically assigned operations which cannot be changed directly by a
users program:
S0: Manual operation initial stat e
S1: Zero return initial state
S2: Automatic operation initial state
S10 to S19: Allocated for the creation of the zero return program sequence
Y0
Y1
Y2
Monitoring STL programs:
•To monitor the dynamic-active states within an STL program, special auxiliary relay
M8047 must be driven ON.
STL/SFC programming:
•For more information on STL/SFC style programming, please see chapt er 3.
IST instruction:
•For more information on the IST instruction please see page 5-67.
4-8
Page 83
FX Series Programmable ControllersDevices in Detail 4
FX
1N
FX
2N
FX
4.4.4Annunciator Flags
FX
1S
2NC
Some state flags can be used as outputs for external diagnosis (called annunciation) when
certain applied instructions are used. These instructions are;
ANS function 46: ANnunciator Set - see page 5-47
ANR function 47: ANnunciator Reset - see pag e 5-47
When the annunciator function is used the controlled stat e flags ar e in the range S900 to S999
(100 points). By programming an external diagnosis circuit as shown below, and monitoring
special data register D8049, the lowest activated state from the annunciator range will be
displayed.
Each of the states can be assigned to signify an error or fault condition. As a fault occurs the
associated state is driven ON. If more than one fault occurs simultaneously, the lowest fault
number will be displayed. When the active fault is cleared the next lowest fault will then be
processed.
This means that for a correctly prioritized diagnostic system the most dangerous or damaging
faults should acti vate t he l owest st ate fl ags, fr om the an nunci ator r ange. All st ate fl ags used fo r
the annunciator function fall in the range of battery backed/ latched state registers.
Monitoring is enabled by driving special auxiliary
relay M8049 ON.
State S900 is activated if input X0 is not driven
M8000
M8049
within one second after the output Y0 has been
turned ON.
State S901 is activated when both inputs X1 and
Y0X0
FNC46
S900K10T0ANS
X2 are OFF for more than two seconds.
If the cycle time of the controlled machine is less
than ten seconds, and input X3 stays ON, state
X1X2
FNC46
S901K20T1ANS
S902 will be set ON if X4 is not activated within
this machine cycle time.
If any state from S900 to S999 is activated, i.e.
X3X4
FNC46
S902K100T2ANS
ON, special auxiliary relay M8048 is activated to
turn on failure indicator output Y10.
The states activated by th e users error / failure
diagnosis detection program, are turned OFF by
activating input X5. Each time X5 is activated, the
M8048
Y10
active annunciator states are reset in ascending
order of state numbers.
X5
FNC47
ANR (P)
4-9
Page 84
FX Series Programmable ControllersDevices in Detail 4
FX
1N
FX
2N
FX
4.5Pointers
FX
1S
2NC
Device Mnemonic: P
Purpose: Program flow control
Alias: Pointer
Program pointer
P
Available forms: Label: appears on the left of the left hand bus bar when the program is
viewed in ladder mode.
Devices numbered in: Decimal, i.e. P0 to P9, P10 to P19
Further uses: Can be used with conditional jump statements (CJ function 00)
- see page 5-5 and item ➀ on the example device usage diagram.
Can be used with call statements
- see page 5-7 and item ➁ on the example device usage diagram
Example device usage:
X20
X20
CALL P1
CJ P0
2
1
FEND
P0
P1
SRET
Available devices:
•FX1S PLC’s have 64 pointers; available from the range of P0 to P63.
1N, FX2N and FX2NC PLC’s have 128 pointers; available from the range of P0 to P127.
•FX
Jumping to the end of the program:
•When using conditional jump instructions (CJ, function 00) the program end can be
jumped to automatically by using the pointer P63 within the CJ instruction. Labelling the
END instruction with P63 is not required.
Device availability:
•For more information about device availability for individual PLC’s, please see chapter 8.
4-10
Page 85
FX Series Programmable ControllersDevices in Detail 4
FX
1N
FX
2N
FX
4.6Interrupt Pointers
FX
1S
2NC
Device Mnemonic: I
Purpose: Interrupt program marker
Alias: Interrupt
High speed interrupt
I
Available forms: Label: appears on the left of the left hand bus bar when the program is
viewed in ladder mode
(see ➀ in the example device usage diagram).
Devices numbered in: Special numbering system based on interrupt device used and input
triggering method
Further uses: Input interrupts - see page 4-12
Timer interrupts - see page 4-12
Disabling interrupts - see page 4-13
Counter interrupts - see page 4-13
Example device usage:
FEND
I101
1
IRET
END
Additional applied instructions:
•Interrupts are made up of an interrupt device, an interrupt pointer and various usage of
three, dedicated interrupt applied instructions;
- IRET function 03: interrupt return - see page 5-9
- EI function 04: enable interrupt - see page 5-9
- DI function 05: disable interrupt - see page 5-9
Nested levels:
•While an interrupt is processing all other int e rrupts are disabled. To achieve nested
interrupts the EI-DI instr uction must be programmed within an interrupt routine.
Interrupts can be nested for two levels.
Pointer position:
•Interrupt pointers may only be used after an FEND instruct ion (first end instruction,
function 06).
4-11
Page 86
FX Series Programmable ControllersDevices in Detail 4
4.6.1Input Interrupts
Identification of interrupt pointer number:
I 0
0: interrupt triggered on traili ng/ falling edge of input signal
1: interrupt triggered on leading/ ri sing edge of input signal
Input number; each input number can only be used once.
1S has 4 points (0 to 3 which map to X0 to X3)
FX
Other units have 6 points (0 to 5 which map to X0 to X5)
Example: I001
The sequence programmed after the label (indicated by the I001 pointer) is executed on the
leading or rising edge of the input signal X0. The program sequence returns from the
interruption program when an IRET instructi on is encount ered.
Rules of use:
•The following points must be followed for an inter rupt to operate;
-Interrupt pointers cannot have the same number in the ‘100’s ’ position, i.e. I100 and
I101 are not allowed.
-The input used for the interrupt device must not coincide with inputs already allocated
for use by other high speed instructions with in the user program.
4.6.2Timer Interrupts
Identification of interrupt pointer number:
I
Example: I610
FX
1N
FX
2N
FX
1S
FX
10 to 99 msec: the interrupt is repeatedly triggered at intervals of the
specified time.
Timer interrupt number 3 points (6 to 8)
2NC
The sequence programmed after the label (indicated by the I610 pointer) is executed at
intervals of 10msec. The program sequence returns from the interruption program when an
IRET instruction is encountered.
Rules of use:
•The following points must be followed for an inter rupt to operate;
-Interrupt pointers cannot have the same number in the ‘100’s ’ position, i.e. I610 and
I650 are not allowed.
4-12
Page 87
FX Series Programmable ControllersDevices in Detail 4
4.6.3Disabling Individual In terrupts
Individual interrupt devices can be temporarily or perma nently disabled by driving an
associated specia l auxiliary relay. The relevant coils are iden tified in the tables of de vices in
chapter 6. However for all PLC types the head address is M8050, this will disable interrup t
I0❏❏.
Driving special auxiliary relays:
•Never drive a special auxili ary coi l witho ut fir st checki ng its use. Not all PLC’s assign the
same use to the same auxiliary coils.
Disabling high speed counter interrupts
•These interrupts can only be disabled as a single group by driving M8059 ON.
Further details about counter int e rrupts can be found in the following section.
FX
4.6.4Counter Interrupts
FX
1S
FX1NFX
2N
2NC
Identification of interrupt pointer number:
I 0 0
Counter interrupt numbe r 6 points (1 to 6). Counter interrupts can be
entered as the output devices for High Speed Counter Set (HSCS, FNC
53). To disable the Cou nter Interrupts Special Auxiliary Relay M80 59
must be set ON.
Example:
The sequence programmed after the label
M8000
DHSCS
K100
C255
I030
(indicated by the I030 po inter) is execut ed once
the value of High Speed Counter C255
reaches/equals the preset limit of K100
identified in the example HSCS.
Additional notes:
•Please see the following pages for more details on the HSSC applied instruc ti on.
FX Series Programmable ControllersDevices in Detail 4
FX
1N
FX
2N
FX
4.7Constant K
FX
1S
2NC
Device Mnemonic: K
Purpose: Identification of const ant decimal values
Alias: Constant
K (value/ constant)
K
Available forms: Numeric data value, when used for 16bit data, values can be sel ected from
the range -32,768 to +32,767
For 32bit data, values from the range -2,147,483,648 to + 2,147,483,647
can be used.
Devices numbered in: N/A. This device is a method of local instruction data entry.
There is no limit to the number of times it can be used.
Further uses: K values can be used with timers, count ers and applied instructions
Example device usage: N/A
4.8Constant H
Device Mnemonic: H
Purpose: Identification of const ant hexadecimal values
Alias: Constant
H (value/ constant)
Hex (value/ constant)
H
Available forms: Alpha-numeric data value, i.e. 0 to 9 and A to F (base 16).
Devices numbered in: N/A. This device is a method of local instruction data entry.
Further uses: Hex values can be used with applied instructions
Example device usage: N/A
FX
1N
FX
2N
FX
FX
1S
2NC
When used for 16bit data, values can be selected from the range 0 to
FFFF.
For 32bit data, values from the range 0 to FFFFFFFF can be used.
There is no limit to the number of times it can be used.
4-14
Page 89
FX Series Programmable ControllersDevices in Detail 4
FX
1N
FX
2N
FX
4.9Timers
FX
1S
2NC
Device Mnemonic: T
Purpose: Timed durations
Alias: Timer(s)
T
Available forms: A driven coil sets internal PLC contacts (NO and NC contacts available).
Various timer resolutions are possible, from 1 to 100 msec, but availability
and quantity vary from PLC to PLC. The following variations are also
available:Selectable timer resolutions - see page 4-16
Retentive timers - see page 4-17
Timers used in interrupt and ‘CALL’ subroutines - see page 4-18
Devices numbered in: Decimal, i.e T0 to T9, T10 to T19.
Further uses: None
Example device usage:
X0
T20
K123
Available devices:
Timer Resolution FX 1SFX1NFX2NFX2NC
100 msec
10 msec
1 msec
Retentive 1 msecN/A
Retentive 100 msecN/A
\ Selectable timers taken from the main range of 100 msec timers, see page 4-16.
63
(T0 - 62)
\ 31
(T32 - 62)
1
(T63)
200
(T0 - 199)
46
(T200 - 245)
N/A
4
(T246 - 249)
6
(T250 - 255)
Timer accuracy:
•See page 4-18.
4-15
Page 90
FX Series Programmable ControllersDevices in Detail 4
4.9.1General timer operation
Timers operate by counting clock pulses (1, 10 and 100 msec). The timer output contact is
activated when the count dat a reaches the value set by the constant K. The overall duration or
elapsed time, for a timers operation cycle, is calculated by multiplying the present value by the
timer resolution, i.e.
A 10 msec timer with a present value of 567 has actually been operating for:
567× 10 msec
567
×
0.01 sec = 5.67 seconds
Timers can either be set directly by using the constant K to specify the maximum d uration or
indirectly by using the data stored in a data register (ex. D). For the indirect setting, data
registers which are battery backed/ latched are usually used; this ensures no loss of data
during power down situations. If however, the voltage of the battery used to perform the batter y
backed service, reduces excessiv ely, timer malfunctions may occur.
FX
1S
FX
1N
FX
2N
FX
4.9.2Selectable Timers
2NC
On certain programmable contro llers, driving a sp ecial auxiliary coil re defines approx imately
half of the 100 msec timers as 10 msec resolution timers. The following PLC’s and timers are
subject to this type of select ion.
-For FX
1S, driving M8028 ON, timers T32 to 62 (31 points) are changed to 10 msec
resolution.
Driving special auxiliary coils:
•Please check the definition of special auxiliary coils before using them.
Not all PLC’s associate the same action to the same device.
4-16
Page 91
FX Series Programmable ControllersDevices in Detail 4
FX
1S
4.9.3Retentive Timers
FX1NFX2NFX2NC
A retentive timer has the ability to retain the currently reached present value even after the
drive contact has been remove d. This means th at when the drive co ntact is re-established a
retentive timer will continue from where it last reached.
Because the retentive timer is not reset when the drive cont act is removed, a forced reset must
be used. The following diagram shows this in a graphical format.
Non-retentive timer operation
X0
T20
1.23 s
X0
Present value
Y0
Retentive timer operation
X1
T20
T250
K123
T250
Y0Y1
X2
T250RST
t1t2
t1 + t2 = 34.5s
X1
Present value
Y1
K345
X2
Using timers in interrupt or ‘CALL’ subroutines:
•Please see page 4-18.
Available devices:
•Please see the information table on page 4-15.
4-17
Page 92
FX Series Programmable ControllersDevices in Detail 4
FX
1N
FX
2N
FX
4.9.4Timers Used in Interrupt and ‘CALL’ Subroutines
FX
1S
2NC
If timers T192 to T199 and T246 to T249 are used in a CALL subroutine or an inte rruption
routine, the timing action is updated at the point when an END instruction is executed. The
output contact is activated when a coil instruction or an END instruction is processed once the
timers current value has reached the preset (maximum du ration) value.
Timers other than those specified above cannot function correctly within the specified
circumstances.
When an interrupt timer (1 msec re solution) is used in an interrupt routine or within a ‘CALL’
subroutine, the output contact is activated when the first coil instruction of that timer is
executed after the timer has reached its pr eset (maximum duration) value.
4.9.5Timer Accuracy
Timer accuracy can be affected by the program configuration. That is to say, if a timer contact
is used before its associated coil, then the timer accuracy is reduced.
The following formulas give maximum and minimum errors for certain situations.
However , an average expected error would be approximately;
1.5 × The program scan time
Condition 1:
The timer contact appears after the timer coil.
Maximum timing error:
2 × Scan time + The input filter time
Minimum timing error:
Input filter time - The timer resolut ion
Condition 2:
The timer contact appears before the timer coil.
Maximum timing error:
3 × Scan time + The input filter time
Minimum timing error:
Input filter time- The timer resolution
X10
T0
T0
Y10
T0
Y10
X10
T0
Internal timer accuracy:
•The actual accuracy of the timing elements within the PLC hardware is;
± 10 pulses per million pulses. This means that if a 100 msec timer is used to time a single day, at the end of that day the timer will be within 0.8 seconds of the true 24 hours or
86,400 seconds. The timer would have processed approximat ely 864,000; 100 msec
pulses.
4-18
Page 93
FX Series Programmable ControllersDevices in Detail 4
FX
4.10Counters
FX
1S
FX
1N
FX
2N
2NC
Device Mnemonic: C
Purpose: Event driven delays
Alias: Counter(s)
C
Available forms: A driven coil sets internal PLC contacts (NO and NC contacts available).
Various counter resolutions are possible including;
General/latched 16bit up counters - see page 4-20
General/latched 32bit bi-directional counters - see page 4-21
(The availability and use of all these counters is PLC specific - please
check availability before use)
Devices numbered in: Decimal, i.e C0 to C9, C10 to C19
Further uses: None
Example device usage:
X1
C12
K345
X2
RST
C12
Available devices:
Counter Resolution FX1SFX1NFX2NFX2NC
General 16bit up
counter
Latched 16bit up
counter
General 32bit
bi-directional counter
Latched 32bit
bi-directional counter
16
(C0 - 15)
16
(C16 - 31)
N/A
N/A
16
(C0 - 15)
184
(C16 - 199)
100
(C0 - 99)
100
(C100 - 199)
20
(C200 - 219)
15
(C220 - 234)
High speed counters:
•For high speed counters please see page 4-22.
Setting ranges for counters:
•16bit and 32bit up counters:1 to +32,767
•32bit bi-directionalcounters: -2,147,483,648 to +2,147,483,647
4-19
Page 94
FX Series Programmable ControllersDevices in Detail 4
4.10.1General/ Latched 16bit UP Counters
The current value of the counter increases
each time coil C0 is turned ON by X11. The
output contact is activa ted when the coil is
turned ON for the te nth time (see diag ram).
After this, the counter dat a remains unc hanged
when X11 is turned ON. The counter current
value is reset to ‘0’ (zero) when the RST
instruction is executed by turning ON X10 in
the example. The output contact Y0 is also
reset at the same time.
Counters can be set directly using constant K
or indirectly by using data stored in a data
register (ex. D ). In an indirect sett ing, the
designation of D10 for example, which
contains the value “123” has the same effect
as a setting of “K123”.
If a value greater than the counter setting is
written to a cu rrent value re gister, the counter
counts up when the next input is turned ON.
This is true for all types of counters.
Generally, the count input frequency should be
around several cycles per second.
X10
X11
X10
X11
Y0
C0
C0RST
C0
K10
Y0
10
9
8
7
6
5
4
3
2
1
0
Battery backed/latched counters:
•Counters which are battery backed/ latched are able to retain their status information,
even after the PLC has been powered down. This means on re-powering up, the latched
counters can immediately resume from where they were at the time of the original PLC
power down.
Available devices:
•Please see the information table on page 4-19.
4-20
Page 95
FX Series Programmable ControllersDevices in Detail 4
The counter shown in the example below, activates when its coil is driven, i.e. the C200 coil is
driven. On every occasion the input X14 is turned from OFF to ON the current value or current
count of C200 is incremented.
X12
Up counting
Up counting
Dow n counting
X13
X14
Counters
present
value
If output is already
Y1
turned ON
1
0
5
4
4
3
2
3
2
1
0
-1
-2
-3
-4
-5
-6
-6
-7
-7
-8
0
-3
-4
-5
X12
X13
X14
C200
M8200
C200RST
C200
K-5
Y1
The output coil of C200 is set ON when the current value increases from “-6” to “-5”. However,
if the counters value decreases from “-5” to “-6” the counter coil will re set. The counters cur rent
value increases or decreases indep endently of the output c ontact state (ON/OFF). Yet, if a
counter counts beyond +2,147,483,647 the current value will automatically change to
-2,147,483,648. Similarly, counting below -2,147,483,648 will result in the current value
changing to +2,147,483,647. This type of counting technique is typical for “ring counters”. The
current value of the active counter can be rest to "0" (zero) by forcibly resetting the counter
coil; in the example program by switching the input X13 ON which drives the RST instruct ion.
The counting direction is designated with special auxiliary relays M8200 to M8234.
Battery backed/ latched counters:
•Counters which are battery backed/ latched are able to retain their status information,
even after the PLC has been powered down. This means on re-powering up, the latched
counters can immediately resume from where they were at the time of the original PLC
power down.
Available devices:
•Please see the information table on page 4-19.
Selecting the counting direction:
•If M8✰✰✰ for C✰✰✰ is turned ON, the counter will be a down counter. Conversely,
the counter is an up counter when M8✰✰✰ is OFF.
4-21
Page 96
FX Series Programmable ControllersDevices in Detail 4
FX
1N
FX
2N
FX
4.11High Speed Counters
FX
1S
2NC
Device Mnemonic: C
Purpose: High speed event driven delays
Alias: Counter (s)
C
High speed counter (s)
Phase counters
Available forms: A driven coil sets internal PLC contacts (NO and NC contacts available).
There are various types of high speed counter available but the q uantity
and function vary from PLC to PLC. Please check the following sect ions fo r
device availability;
1S and FX1N - see page 4-24
FX
FX
2N and FX2NC - see page 4-25
The following sections refer to counter types;
1 phase counters (user start and reset) - see page 4-29
1 phase counters (assigned start and reset ) - see page 4-30
2 phase bi-directional counters - see page 4-31
A/B phase counters - see page 4-32
Devices numbered in: Decimal, i.e C235 to C255
Further uses: None
Example device usage:For examples on each of the available forms please see the relevant
sections.
Basic high speed counter operation:
•For information on basic high speed counters ple ase see page 4-23.
4-22
Page 97
FX Series Programmable ControllersDevices in Detail 4
4.11.1Basic High Speed Counter Operation
Although counters C235 to C255 (21 points) are all high speed counters, they share the same
range of high speed inputs. Therefore, if an input is already being used by a high speed
counter , it cannot be used for a ny other high s peed counters or fo r a ny other purpose, i. e as an
interrupt input.
The selection of high speed counters are n ot free, they are directly depe ndent on the type of
counter required and which inputs are available.
Available counter types;
a) 1 phase with user start/reset: C235 to C240
b) 1 phase with assigned start/reset: C241 to C245
c) 2 phase bi-directional: C246 to C250
d) A/B phase type: C251 to C255
Please note ALL of these counters are 32bit devices.
High speed counters operate by the principle of interrupts. This means they are event
triggered and independe nt of cycle time. The coil of the se lected counter sh ould be driven
continuously to indicate that this counter and its associated inputs are reserved and that other
high speed processes must not coincide with them.
Example:
When X20 is ON, high speed counter C235 is
selected. The counter C235 corresponds to
count input X0. X20 is NOT the coun ted
signal. This is the continuous drive mentioned
earlier . X0 does not have to be included in the
program. The input a ssignment is h ardware
X20
X20
C235
K4789
C236
D4
related and cannot be changed by the user.
When X20 is OFF, coil C235 is turned OFF and coil C236 is turned ON. Counter C236 has an
assigned input of X1, again the input X20 is NOT the counted input.
The assignment of counters and input devices is dependent upon the PLC selected. This is
explained in the relevant, later sect ions.
Driving high speed counter coils:
•The counted inputs are NOT used to
drive the high speed counter coils.
This is because the counter coils
need to be continuously driven ON
to reserve the associated high speed
inputs.
Therefore, a normal non-high speed
drive contact s hould be used to driv e
the high speed counter coil.
Ideally the special auxiliary contact M8000 should be used. However, this is not
compulsory.
X0
X1
C235
K4789
C236
D4
4-23
Page 98
FX Series Programmable ControllersDevices in Detail 4
C235
4.11 .2Availability of High Speed Counters
The following device table outlines the
range of available high speed counters.
I
N
P
U
T
X0
X1
X2
X3
X4
X5
X6SSS
X7SSS
1 Phase counter
user start/reset
C235
C236
C237
C238
C239
U/DU/DU/DUUUAAA
U/DRRDDDBBB
U/DU/DU/DRRRR
U/DRSRUUAA
U/DU/DDDBB
U/DRRRRR
1 Phase counter
assigned
C240
start/reset
C241
C242
Key: U - up counter input D - down counter input
R - reset counter (input) S - start counter (input)
A - A phase counter input B - B phase counter input
- Counter is backed up/latched
C243
C244
2 Phase counter
bi-directional
C245
C246
C247
C248
FX
1S
C249
FX
1N
FX
2N
A/B Phase counter
C250
C251
C252
C253
FX
C254
2NC
C255
Input assignment:
•X6 and X7 are also high speed inputs, but function only as start signals. They cannot be
used as the counted inputs for high speed counters.
•Different types of counters can be used at the same time but thei r inputs must not
coincide. For example, if counter C247 is used, then the following counters and
instructions cannot be used;
C235, C236, C237, C241, C242, C244, C245, C246, C249, C251, C252, C254, I0❏❏,
I1❏❏, I2❏❏.
Counter Speeds:
•General counting frequencies:
-Single phase and bi-directional counters; up to 10 kHz.
-A/B phase counters; up to 5 kHz.
-Maximum total counting frequency (A/B phase counter count twice)
FX
1S & FX1N 60kHz, FX2N & FX2NC 20kHZ.
•For FX
higher speed counting as follows:
-Single phase or bi-directional counting (depending on unit) with C235, C236 or C246;
-Two phase counting with C251; up to 30 kHz.
2N & FX2NC Inputs X0 and X1 are equipped with special hardware that allows
up to 60 kHz.
4-24
Page 99
FX Series Programmable ControllersDevices in Detail 4
If any high speed comparison instructions (FNC’s 53, 54, 55) are used, X0 and X1 must resort
to software counting. In this case, please see the table below:
Unit
FX
2N & FX2NC
FX
1S & FX1N53 or 5430 kHz
Function
Number
53 or 5411 kHz
555.5 kHz
Max. Combined
Signal Frequency
Calculating the maximum combined counting speed on FX1S:
This is calculated as follows:
(2 phase counter speed x number of counted edges)
(the sum of the speeds of the active 1 phase counters).
✚
4-25
Page 100
FX Series Programmable ControllersDevices in Detail 4
4.11.31 Phase Counters - User Start and Reset (C235 - C240)
These counters only use one input each.
When direction flag M8235 is O N, counter
C235 counts down. When it is OFF, C235
counts up.
When X11 is ON, C235 resets to 0 (zero). All
contacts of the counter C235 are also reset.
When X12 is ON, C235 is selected. From the
previous counter tables, the corresponding
counted input for C235 is X0. C235 therefore
counts the number of times X0 switches from
OFF to ON.
X10
M8235
X11
C235RST
X12
C235
K1234
Device specification:
•All of these counters are 32bit up/down ring counters. Their counting and contact
operations are the same as normal 32bit up/down counters described on page 4-21.
When the counters current value reaches its ma ximum or setting value, the counters
associated contacts are set and held when the counter is counting upwards.
However , when the counter is counting downwards the contacts are reset.
Setting range:
•-2,147,483,648 to +2,147,483,647
Direction setting:
•The counting direction for 1 phase counters is dependent on their corresponding flag
M8✰✰✰; where ✰✰✰ is the number of the corresponding counter, (C235 to C240).
When M8✰✰✰ is ON the counter counts down,
When M8✰✰✰ is OFF the counter counts up.
Using the SPD instruction:
•Care should be taken when using the SPD applied instruction (FNC 56). This instruction
has both high speed counter and interrupt characteristics, therefore input devices X0
through X5 may be used as the source device for the SPD instruction. In common with
all high speed processes the selected source device of the SPD instru ction must not
coincide with any other high speed function which is operati ng, i.e. high speed counters
or interrupts using the same input.
When the SPD instruction is used it is considered by the system to be a 1 phase high
speed counter. This should be taken into account when summing the maximum combined input signal frequencies - see the previous section.
4-26
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.