This manual contains text, diagrams and explanations which will guide the reader through the safe and
correct installation, use, and operation of the FX Series function for structured programs. It should be read
and understood before attempting to install or use the unit.
Store this manual in a safe place so that you can take it out and read it whenever necessary. Always forward
it to the end user.
This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses.
Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a
result of using the contents noted in this manual.
• This manual provides information for the use of the FX Series Programmable Controllers. 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 manual should be of a competent nature, trained and qualified
to the local and national 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 completely familiar with all
associated documentation 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
• This product has been manufactured as a general-purpose part for general industries, and has not been
designed or manufactured to be incorporated in a device or system used in purposes related to human life.
• Before using the product for special purposes such as nuclear power, electric power, aerospace, medicine
or passenger movement vehicles, consult with Mitsubishi Electric.
• This product has been manufactured under strict quality control. However when installing the product
where major accidents or losses could occur if the product fails, install appropriate backup or failsafe
functions in the system.
• When combining this product with other products, please confirm the standard and the code, or regulations
with which the user should follow. Moreover, please confirm the compatibility of this product to the system,
machine, and apparatus with which a user is using.
• If in doubt at any stage during the installation of the product, always consult a professional electrical
engineer who is qualified and trained to the local and national standards. If in doubt about the operation or
use, please consult the nearest Mitsubishi Electric distributor.
• Since the examples indicated by this manual, technical bulletin, catalog, etc. are used as a reference,
please use it after confirming the function and safety of the equipment and system. Mitsubishi Electric will
accept no responsibility for actual use of the product based on these illustrative examples.
• This manual content, specification etc. may be changed without a notice for improvement.
• The information in this manual has been carefully checked and is believed to be accurate; however, you
have noticed a doubtful point, a doubtful error, etc., please contact the nearest Mitsubishi Electric
distributor.
Registration
•Microsoft® and Windows® are either registered trademarks or trademarks of Microsoft Corporation in the
United States and/or other countries.
• CompactFlash is a trademark of SanDisk Corporation in the United States and other countries.
• The company name and the product name to be described in this manual are the registered trademarks or
trademarks of each company.
This manual explains application functions for structured programs provided by GX Works2. Refer to other
manuals for devices, parameters and sequence instructions.
Refer to each corresponding manual for analog, communication, positioning control and special units and
blocks.
This manual explains application functions for structured programs provided
by GX Works2.
FX3G/FX3U/FX
This manual explains details of analog special function blocks and analog special
adapters for FX
Explanation of instructions and instructions used in program examples are expressed
for GX Developer.
3UC
User's Manual- Analog Control Edition
3U
/FX
3UC
/FX3G PLCs and PID instruction.
(Additional Manual)
FX
FX
3U
FX
3UC
FX
3G
Special
unit/block
FX Series User's Manual -Data Communication Edition
This manual explains details of simple N:N link, parallel link, computer link, no-protocol
communication (RS and RS2 instructions), programming communication and inverter
communication for FX PLCs.
Explanation of instructions and instructions used in program examples are expressed
for GX Developer.
FX3G/FX3U/FX
This manual explains details of wiring, instructions and operations of the positioning
function built in FX
Explanation of instructions and instructions used in program examples are expressed
for GX Developer.
Individual manuals
This manual explains details of each special unit/block.
Explanation of instructions and instructions used in program examples are expressed
for GX Developer.
*1. Detailed explanation may be provided by a separate manual in some products.
3UC
Series User's Manual -Positioning Edition
3U
/FX
3UC
/FX3G PLC main units.
(Manual supplied with product or additional Manual )
This manual explains application functions for structured programs provided
Structured
by GX Works2.
(Additional Manual)
(Additional Manual)
(Additional Manual)
FX
Special
unit/block
FX Series User's Manual -Data Communication Edition
This manual explains details of simple N:N link, parallel link, computer link, no-protocol
communication (RS instruction), programming communication and inverter communication
for FX PLCs.
Explanation of instructions and instructions used in program examples are expressed for
GX Developer and FX-PCS/WIN.
Individual manuals
This manual explains details of each special unit/block.
Explanation of instructions and instructions used in program examples are expressed
for GX Developer and FX-PCS/WIN.
*1. Detailed explanation may be provided by a separate manual in some products.
(Manual supplied with product or additional Manual )
This manual explains application functions for structured programs provided
Structured
by GX Works2.
(Additional Manual)
(Additional Manual)
(Additional Manual)
FX
Special
unit/block
FX Series User's Manual -Data Communication Edition
This manual explains details of parallel link, computer link, no-protocol communication
(RS instruction) and programming communication for FX PLCs.
Explanation of instructions and instructions used in program examples are expressed for
GX Developer and FX-PCS/WIN.
Individual manuals
This manual explains details of each special unit/block.
Explanation of instructions and instructions used in program examples are expressed
for GX Developer and FX-PCS/WIN.
*1. Detailed explanation may be provided by a separate manual in some products.
(Manual supplied with product or additional Manual )
This manual explains devices and parameters for structured programs provided by GX Works2.
Refer to other manuals for sequence instructions and applied functions.
This chapter introduces only reference manuals for this manual and manuals which describe the hardware
information of PLC main units.
Manuals not introduced here may be required in some applications.
Refer to the manual of the used PLC main unit and manuals supplied together with used products.
Contact the distributor for acquiring required manuals.
FX3U Series Hardware ManualJY997D18801Supplied with product
FX3U Series User's Manual- Hardware
Edition
FX3UC (D, DSS) Series Hardware
Manual
FX3UC-32MT-LT-2 Hardware ManualJY997D31601Supplied with product
FX3UC Series User's Manual Hardware Edition
FX3G Series Hardware ManualJY997D33401Supplied with product
FX3G Series User's Manual- Hardware
Edition
SH-080782Additional Manual
JY997D26001Additional Manual
JY997D34701Additional Manual
JY997D34801Additional Manual
JY997D16501Additional Manual
JY997D28601Supplied with product
JY997D28701Additional Manual
JY997D31301Additional Manual
Supplied with product
or Additional Manual
Supplied with product
or Additional Manual
Contents
Programming methods, specifications, functions,
etc. required to create structured programs
Devices, parameters, etc. provided in structured
projects of GX Works2
Sequence instructions provided in structured
projects of GX Works2
Application functions provided in structured
projects of GX Works2
Contents
I/O specifications, wiring and installation of the
PLC main unit FX3U extracted from the FX3U
Series User’s Manual - Hardware Edition. For
detailed explanation, refer to the FX3U Series
User’s Manual - Hardware Edition.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX3U PLC main unit.
I/O specifications, wiring and installation of the
PLC main unit FX3UC (D, DSS) extracted from the
FX3UC Series User’s Manual - Hardware Edition.
For detailed explanation, refer to the FX3UC
Series User’s Manual - Hardware Edition.
I/O specifications, wiring and installation of the
PLC main unit FX3UC-32MT-LT-2 extracted from
the FX3UC Series User’s Manual - Hardware
Edition. For detailed explanation, refer to the
FX3UC Series User’s Manual - Hardware Edition.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX3UC PLC main unit.
I/O specifications, wiring and installation of the
PLC main unit FX3G extracted from the FX3G
Series User’s Manual - Hardware Edition. For
detailed explanation, refer to the FX3G Series
User’s Manual - Hardware Edition.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX3G PLC main unit.
1.1 Outline of Structured Programs and Programming
1.Outline
This manual explains applied functions for structured programs provided by GX Works2.
Refer to a different manual for devices, parameters and sequence instructions.
Refer to the following manual for labels, data types and programming languages for structured programs:
1.1Outline of Structured Programs and Programming Languages
1.1.1Outline of structured programs
You can construct two or more programs (program blocks) into one program.
Because you can divide the entire machine processing into small sub processes and create a program for
each sub process, you can efficiently create a program for a large system.
1. Structured program
Program structuring is a technique to divide the contents of control executed by the PLC CPU into
hierarchical small units (blocks) of processing, and then construct a program. By using this technique, you
can design a program while recognizing structuring of a sequence program.
1 Outline
Advantages of hierarchical program
• You can examine the outline of a program at first, and then design its details gradually.
• Program blocks located at the lowest level in the hierarchy are extremely simple and highly independent.
Advantages of program consisting of program blocks
• Because the processing of each block is clear, the entire program is easy to understand.
• The entire program can be divided into several blocks that are created by several people.
• The program reusability is improved, and the development efficiency is improved accordingly.
2. Improved reusability of programs
You can save program blocks in a library. Program resources in the library can be shared, and often used
again.
The following programming languages can be used in each program block.
Graphic languages
1. Structured ladder language
This graphic language is created based on the relay circuit design technology.
Any circuit always starts from the bus line located on the leftmost.
The structured ladder language consists of contacts, coils, functions and function blocks. These components
are connected with vertical lines and horizontal lines.
1 Outline
1.2 PLC Series and Programming Software Version
1
2
Outline
Function List
1
2
X000X001Y000
Y000
X001
D0
When X001 is ON, the contents
of D0 are transferred to D2.
MOV
ENENO
sd
Output Y000
D2
Text language
1. ST (Structured text) language
The ST language can describe control achieved by syntax using selective branches with conditional
statements and repetition by repetitive statements in the same way as high-level languages such as C
language.
By using the ST language, you can create simple programs easy to understand.
Y000:=(X000 OR Y000) AND NOT X001;
IF X001 THEN
D2:=D0; (When X001 is ON, the contents of D0 are transferred to D2.)
END_IF;
IF X002 THEN
D4:=D4+1; (When X002 is ON, the contents of D4 are added by "1".)
ELSE
D6:=D6+1; (When X002 is OFF, the contents of D6 are added by "1".)
END_IF;
Refer to the following programming manual for detailed operations of and cautions on devices and
parameters:
→ FX Structured Programming Manual (Device & Common)
1.3.1I/O processing and response delay
1. Operation timing of I/O relays and
response delay
FX PLCs execute the I/O processing by
repeating the processing (1) to processing (3).
Accordingly, the control executed by PLCs
contains not only the drive time of input filters
and output devices but also the response
delay caused by the operation cycle.
Acquiring the latest I/O information
For acquiring the latest input information or
immediately outputting the operation result in
the middle of the operation cycle shown
above, the I/O refresh instruction (REF) is
available.
(1)
Scan
time
(operation
cycle)
[Input processing]
Input image
memory is read.
(2)
[Program processing]
Image memory of
each device is updated.
Batch I/O method
(Refresh method)
The ON/OFF status of input
terminals is received at one time.
Input image is read, and
operation is executed
according to program.
(3)
[Output processing]
Result is transferred to
output latch memory.
Output
devices
are driven.
1 Outline
2. Short pulses cannot be received.
The ON duration and OFF duration of inputs in PLCs require longer time than "PLC cycle time + Input filter
response delay".
When the response delay "10 ms" of the input filter is considered and the cycle time is supposed as "10 ms",
the ON duration and OFF duration should be at least 20 ms respectively.
Accordingly, PLCs cannot handle input pulses at 25 Hz (= 1000 /(20 + 20)) or more. However, the situation
can be improved by PLC special functions and applied instructions.
Convenient functions for
improvement
By using the following functions, PLCs
can receive pulses shorter than the
operation cycle:
1.3.2Double output (double coil) operation and countermeasures
This subsection explains the double output (double coil) operation and countermeasures.
1. Operation of double outputs
When a coil (output variable) is used twice (double coils) in another program block to be executed or in the
same program block, the PLC gives priority to the latter coil.
Suppose that the same coil Y003 is used in two positions as
shown in the right figure.
For example, suppose that X001 is ON and X002 is OFF.
Input processing
X001=ON X002=OFF
1 Outline
1
2
Outline
Function List
In the first coil Y003, the image memory is set to ON and the
output Y004 is also set to ON because the input X001 is ON.
In the second coil Y003, however, the image memory is set to
OFF because the input X002 is OFF.
As a result, the actual output to the outside is "Y003: OFF, Y004:
ON".
X001
Y003
X002
Output processing
Y003=OFF Y004=ON
First
Second
Y003
Y004
Y003
2. Countermeasures against double outputs
Double outputs (double coils) do not cause an illegal input error (program error), but the operation is
complicated as described above.
Change the program as shown in the example below.
AB
Y000
Ignored
AB
CE
D
Y000
3
Function
Construction
4
How to Read
Explanation of
Functions
5
Applied
Functions
6
Standard
Function Blocks
CE
D
The SET and RST instructions or jump instruction can be used instead, or a same output coil can be
programmed at each state using step ladder instructions STL and RET.
When you use the step ladder instructions STL and RET, note that the PLC regards it as double coils if you
program, inside the state, an output coil located outside the RET instruction from another program block or
the STL instruction.
1.3.3Circuits not available in structured ladder programs and countermeasures
1. Bridge circuit
A circuit in which the current flows in both directions should be changed as shown in the right figure (so that a
circuit without D and a circuit without B are connected in parallel).
AB
FF
CE
B
1 Outline
E
C
D
A
AE
C
D
2. Coil connection position
• You can program a contact on the right side of a coil. In this case, make sure to program a coil (including a
function or function block) at the end of the circuit.
ABDA
C
Or
BD
AB
E
E
CE
D
C
1.3.4Handling of general flags
The following flags are valid in general sequence instructions:
(Examples)
M8020:Zero flagM8021:Borrow flagM8022:Carry flag
M8029:Instruction execution complete flagM8090:Block comparison signal
M8328:Instruction non-execution flag
M8304:Zero flag
*1.Supported only in FX3U/FX3UC PLCs.
*2.Supported only in FX
Each of these flags turns ON or OFF every time the PLC executes a corresponding instruction. These flags
do not turn ON or OFF when the PLC does not execute a corresponding instruction or when an error occurs.
Because these flags are related to many sequence instructions, their ON/OFF status changes every time the
PLC executes each corresponding instruction.
Refer to examples in the next page, and program a flag contact just under the target sequence instruction.
*1
M8306:Carry flag
3U/FX3UC/FX3G PLCs.
*1
*1
*1
M8329:Instruction execution abnormal complete flag
1. Program containing many flags (Example of instruction execution complete flag M8029)
If you program the instruction execution complete flag M8029 twice or more together for two or more
sequence instructions which actuate the flag M8029, you cannot judge easily by which sequence instruction
the flag M8029 is controlled. In addition, the flag M8029 does not turn ON or OFF correctly for each
corresponding sequence instruction.
Refer to the next page when you would like to use the flag M8029 in any position other than the position just
under the corresponding sequence instruction.
Good example
1.3 Cautions on Creation of Fundamental Programs
1 Outline
1
2
Outline
Function List
Bad example
M8029 works as
a flag to indicate
that execution of
DSW is completed.
M8029 works as
a flag to indicate
that execution of
DPLSY is
completed.
M8029 works as
a flag to indicate
that execution of
DPLSY (on the
lower side) is
completed.
M8029 works as
a flag to indicate
that execution of
DSW is completed.
M8000
M8029
Execution is
completed.
X000
M0
M8029
Execution is
completed.
M8029
Execution is
completed.
M8000
X000
ENs1ENO
X010
1D0
s2d2
ENs1ENO
D0
s2
10
M0
S
DPLSY
ENs1ENO
1000Y000
Number of
output pulses
X010
1
s2
M0
R
M0
R
ENs1ENO
s2d2
M0
S
DSW
d1Y010
MUL
Number of output pulses
d
d
Program for DPLSY (on the upper side)
DSW
Y010
d1
D0
3
Function
Construction
4
How to Read
Explanation of
Functions
5
Applied
Functions
6
Standard
Function Blocks
A
Correspondence
between Devices
and Addresses
M8029 works as a
flag to indicate that
execution of DPLSY
(on the upper side)
is completed.
2. Introduction of a method to use flags in any positions other than positions just under
sequence instructions
If two or more sequence instructions are programmed, general flags turn ON or OFF when each
corresponding instruction is executed.
Accordingly, when using a general flag in any position other than a position just under a sequence instruction,
set to ON or OFF another device (variable) just under the sequence instruction, and then use the contact of
such device (variable) as the command contact.
1.3 Cautions on Creation of Fundamental Programs
1 Outline
DSW execution
complete flag
M8029 is changed
to M100.
DPLSY execution
complete flag
M8029 is changed
to M200.
When there is an error in the instruction construction, target device or target device number range and an
error occurs while operation is executed, the following flag turns ON and the error information is stored.
1 Outline
1.3 Cautions on Creation of Fundamental Programs
1
Outline
1. Operation error
Error flag
M8067D8067
Device which stores
error code
FX0/FX0S/FX0N/FXU/FX2C/FX1S
/FX1N/FX2N/FX1NC/FX2NC/FX3G
*1.When an error occurs in a step up to the step No. 32767 in the FX3U/FX3UC PLC, you can check the
error occurrence step also in D8069 (16 bits).
• When an operation error has occurred, M8067 turns ON, D8067 stores the operation error code, and the
specified device (shown in the table above) stores the error occurrence step.
• When another error occurs in another step, the stored data is updated in turn to the error code and step
number of the new error. (These devices are set to OFF when errors are cleared.)
• When the PLC mode changes from STOP to RUN, these devices are cleared instantaneously, and then
turn ON again if errors have not been cleared.
Device which stores error occurrence step
FX3U/FX3UC
D8069
*1
D8315, D8314
2. Operation error latch
Error flag
M8068-
Device which stores
error code
FX0/FX0S/FX0N/FXU/FX2C/FX1S
/FX1N/FX2N/FX1NC/FX2NC/FX3G
*2.When an error occurs in a step up to the step No. 32767 in the FX3U/FX3UC PLC, you can check the
error occurrence step also in D8068 (16 bits).
• When an operation error has occurred, M8068 turns ON, and the device shown in the table above stores
the error occurrence step.
• Even if another error occurs in another step, the stored data is not updated and remains held until these
devices are forcibly set to OFF or until the power is turned OFF.
3.1 Applied Function Expression and Execution Type
3.Function Construction
This chapter explains the construction of applied functions.
3.1Applied Function Expression and Execution Type
Applied function and argument
• The name expressing the contents is given to each function.
For example, the function name "SHL (bit shift left)" is given.
• Each function consists of arguments which indicate I/O data used in the function.
SHL_E
ENENO
D10D0_IN
*1
_NK1
3 Function Construction
_IN () : An argument whose contents do not change even if the function is executed is called
*1() : An argument whose contents change when the function is executed is called "destination",
K1 () : Arguments not regarded as source or destination are expressed in "m", "n", etc.
s
"source", and expressed in this symbol.
d
and expressed in this symbol.
n
Argument target devices
• The input variable (label or device) specifies the target.
• Bit device themselves such as X, Y, M and S may be handled.
• Bit devices may be combined in a way "KnX", "KnY", "KnM" and "KnS" to express numeric data.
→ FX Structured Programming Manual (Device & Common)
• Current value registers of data registers (D), timers (T) and counters (C) may be handled.
• When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from
simple projects.
Use labels when handling 32-bit data.
You can specify 32-bit counters directly, however, because they have 32-bit length. Use global labels
when specifying devices.
When 32-bit data is handled, two consecutive 16-bit data registers D are combined.
For example, when data register D0 is defined as an argument of a 32-bit instruction by a label, 32-bit data
stored in D1 and D0 is handled. (D1 offers high-order 16 bits, and D0 offers low-order 16-bits.)
When the current value register of a timer or counter is used as a general data register, it is handled in the
same way.
28
Loading...
+ 206 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.