Mitsubishi Electric SW1DND GXW2 E v5 Operating Manual
![Mitsubishi Electric SW1DND GXW2 E manual cover](/images/711c6a6abd2e778ad89fd074/thumbs/thumb175x175.webp)
![English English](/static/img/blank.webp)
GX Works2 Version 1 Operating Manual (Simple Project, Function Block)
-SW1DND-GXW2-E -SW1DNC-GXW2-E
A - 1
SAFETY PRECAUTIONS (Always read these instructions before using this product.)
Before using this product, thoroughly read this manual and the relevant manuals introduced in this manual and pay careful attention to safety and handle the products properly. The precautions given in this manual are concerned with this product. For the safety precautions of the programmable controller system, refer to the User's Manual for the CPU module.
In this manual, the safety precautions are ranked as " WARNING" and " CAUTION".
Note that the CAUTION level may lead to serious consequences according to the circumstances. Always follow the precautions of both levels because they are important for personal safety.
Please save this manual to make it accessible when required and always forward it to the end user.
[Design Instructions]
[Startup/Maintenance Instructions]
WARNING
When data change, program change, or status control is performed from a personal computer to a running programmable controller, create an interlock circuit outside the programmable controller to ensure that the whole system always operates safely. Furthermore, for the online operations performed from a personal computer to a programmable controller CPU, the corrective actions against a communication error due to such as a cable connection fault should be predetermined as a system.
CAUTION The online operations performed from a personal computer to a running programmable controller CPU (Program
change when a programmable controller CPU is RUN, operating status changes such as forced input/output operation and RUN-STOP switching, and remote control operation) must be executed after the manual has been carefully read and the safety has been ensured. When changing a program while a programmable controller CPU is RUN, it may cause a program corruption in some operating conditions. Fully understand the precautions described in Section 12.9 before use.
The positioning test functions of OPR, JOG, inching or positioning data for QD75/LD75 positioning module must be executed with the programmable controller set to STOP after the manual has been carefully read and the safety has been ensured. Specially when executing the function on the network system, ensure the safety thoroughly since the machinery whose operation cannot be checked by an operator may be activated. The operation failure may cause the injury or machine damage.
WARNING
CAUTION
Indicates that incorrect handling may cause hazardous conditions, resulting in death or severe injury.
Indicates that incorrect handling may cause hazardous conditions, resulting in minor or moderate injury or property damage.
To maintain the safety of the programmable controller system against unauthorized access from external devices via the network, take appropriate measures. To maintain the safety against unauthorized access via the Internet, take measures such as installing a firewall.
A - 2
CONDITIONS OF USE FOR THE PRODUCT
(1) Mitsubishi programmable controller ("the PRODUCT") shall be used in conditions;
i) where any problem, fault or failure occurring in the PRODUCT, if any, shall not lead to any major or
serious accident; and
ii) where the backup and fail-safe function are systematically or automatically provided outside of the
PRODUCT for the case of any problem, fault or failure occurring in the PRODUCT.
(2) The PRODUCT has been designed and manufactured for the purpose of being used in general
industries.
MITSUBISHI SHALL HAVE NO RESPONSIBILITY OR LIABILITY (INCLUDING, BUT NOT LIMITED
TO ANY AND ALL RESPONSIBILITY OR LIABILITY BASED ON CONTRACT, WARRANTY, TORT,
PRODUCT LIABILITY) FOR ANY INJURY OR DEATH TO PERSONS OR LOSS OR DAMAGE TO
PROPERTY CAUSED BY the PRODUCT THAT ARE OPERATED OR USED IN APPLICATION NOT
INTENDED OR EXCLUDED BY INSTRUCTIONS, PRECAUTIONS, OR WARNING CONTAINED IN
MITSUBISHI'S USER, INSTRUCTION AND/OR SAFETY MANUALS, TECHNICAL BULLETINS AND
GUIDELINES FOR the PRODUCT.
("Prohibited Application")
Prohibited Applications include, but not limited to, the use of the PRODUCT in;
Nuclear Power Plants and any other power plants operated by Power companies, and/or any other
cases in which the public could be affected if any problem or fault occurs in the PRODUCT.
Railway companies or Public service purposes, and/or any other cases in which establishment of a
special quality assurance system is required by the Purchaser or End User.
Aircraft or Aerospace, Medical applications, Train equipment, transport equipment such as Elevator
and Escalator, Incineration and Fuel devices, Vehicles, Manned transportation, Equipment for
Recreation and Amusement, and Safety devices, handling of Nuclear or Hazardous Materials or
Chemicals, Mining and Drilling, and/or other applications where there is a significant risk of injury to
the public or property.
Notwithstanding the above, restrictions Mitsubishi may in its sole discretion, authorize use of the
PRODUCT in one or more of the Prohibited Applications, provided that the usage of the PRODUCT is
limited only for the specific applications agreed to by Mitsubishi and provided further that no special
quality assurance or fail-safe, redundant or other safety features which exceed the general
specifications of the PRODUCTs are required. For details, please contact the Mitsubishi representative
in your region.
A - 3
REVISIONS
Print date Manual number*1 Revision
Nov. 2011 SH(NA)-080984ENG-A First edition
Jan. 2012 SH(NA)-080984ENG-B Model Addition FX3GC
Correction Section 4.1
May 2012 SH(NA)-080984ENG-C Model Addition Q02PH, Q06PH, Q12PH, Q12PRH, Q25PH, Q25PRH
Correction GENERIC TERMS AND ABBREVIATIONS IN THIS MANUAL, Section 1.5.1, Section 2.3.4, Section 3.1.1, Appendix 3
Sept. 2012 SH(NA)-080984ENG-D Correction GENERIC TERMS AND ABBREVIATIONS IN THIS MANUAL, Section 2.6, Section 3.1.4, Appendix 2
Feb. 2013 SH(NA)-080984ENG-E Model Addition Q03UDV, Q04UDV, Q06UDV, Q13UDV, Q26UDV, L02S, L06, L26
Addition Section 4.2.1
Correction GENERIC TERMS AND ABBREVIATIONS IN THIS MANUAL, TERMS, Section 1.5.1, Section 2.3.3, Section 2.6, Section 3.1.1, Section 3.1.2, Section 4.2.2, Section 5.2, Appendix 2
Modification
Section 4.2 Section 4.2.2
May 2013 SH(NA)-080984ENG-F Model Addition L02S-P, L06-P, L26-P, FX3S
Correction GENERIC TERMS AND ABBREVIATIONS IN THIS MANUAL, Section 2.3.3, Appendix 2
Sept. 2013 SH(NA)-080984ENG-G Addition Section 4.2.1, Section 4.2.2
Correction TERMS, Section 4.2.3
Modification
Section 4.2.1 Section 4.2.3, Section 4.2.2 Section 4.3, Section 4.3 to Section 4.6 Section 4.4 to Section 4.7
Dec. 2013 SH(NA)-080984ENG-H Correction Section 2.1
Mar. 2014 SH(NA)-080984ENG-I Correction Section 2.6, Appendix 3
Jun. 2014 SH(NA)-080984ENG-J Correction Section 4.2.1, Section 4.2.2, Section 4.2.3, Appendix 3
Sept. 2014 SH(NA)-080984ENG-K Correction Section 5.3
Mar. 2015 SH(NA)-080984ENG-L Correction Section 4.4
Jan. 2018 SH(NA)-080984ENG-M Correction GENERIC TERMS AND ABBREVIATIONS IN THIS MANUAL
A - 4
Japanese Manual Version SH-080983-Q
Jun. 2018 SH(NA)-080984ENG-N Correction SAFETY PRECAUTIONS, Section 4.2.3
Jun. 2020 SH(NA)-080984ENG-O Correction Section 2.3.5
*1 : The manual number is written at the bottom left of the back cover.
Print date Manual number*1 Revision
2011 MITSUBISHI ELECTRIC CORPORATION
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.
A - 5
INTRODUCTION
Thank you for purchasing the engineering software, MELSOFT series. Before using the product, thoroughly read this manual to develop full familiarity with the functions and performance to ensure correct use.
CONTENTS
SAFETY PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A - 1
CONDITIONS OF USE FOR THE PRODUCT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A - 2
REVISIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A - 3
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A - 5
CONTENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A - 5
MANUALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A - 8
GENERIC TERMS AND ABBREVIATIONS IN THIS MANUAL. . . . . . . . . . . . . . . . . . . . . . . . . A - 16
TERMS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A - 17
1 OVERVIEW OF FUNCTION BLOCKS
1.1 Function Blocks (FBs) 1 - 2
1.2 Features of FBs 1 - 3
1.3 Labels 1 - 4
1.4 Programming Flow with FBs 1 - 5
1.4.1 FB creation procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 5
1.4.2 Sequence program creation procedure using FBs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 7
1.5 Overview of Screen Configuration 1 - 8
1.5.1 Main frame configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 8
1.5.2 Label setting editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 10
2 CREATING FUNCTION BLOCKS
2.1 Creating Projects for FBs 2 - 2
2.2 Creating New FB Data 2 - 3
2.3 Setting Local Labels 2 - 4
2.3.1 Setting labels on Function/FB Label Setting screen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 4
2.3.2 Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 5
2.3.3 Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 6
2.3.4 Selecting data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 7
2.3.5 Assigning devices automatically. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 9
2.4 Creating FB Programs 2 - 12
2.5 Converting FBs 2 - 13
2.6 Considerations when Creating FB Programs 2 - 14
A - 6
3 USING FUNCTION BLOCKS
3.1 Creating Sequence Programs with FBs 3 - 2
3.1.1 Pasting FBs to sequence programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 2
3.1.2 Creating input and output circuits of FB instances. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 6
3.1.3 Aligning sequence program and FB program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 11
3.1.4 Converting/compiling all sequence programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 12
3.1.5 Writing sequence programs to programmable controller CPU. . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 16
3.2 Checking Operations of Sequence Programs 3 - 19
4 MANAGING AND EDITING FUNCTION BLOCKS
4.1 Reading FB Programs from Programmable Controller CPU 4 - 2
4.2 Reusing FBs from Library (Project) 4 - 3
4.2.1 Library (project) reusing procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 3
4.2.2 Exporting FBs to other project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 4
4.2.3 Importing FBs from other project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 6
4.3 Copying FBs from Project 4 - 9
4.4 Changing FB Instance Names 4 - 10
4.5 Deleting Unnecessary FB Data from Projects 4 - 11
4.6 Protecting FBs 4 - 13
4.7 Searching/Replacing FB Instance Names 4 - 16
5 USING FB LIBRARIES
5.1 Installing FB Library 5 - 2
5.1.1 Obtaining FB Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 2
5.1.2 Installing FB Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 2
5.2 Using FB Libraries 5 - 3
5.3 Displaying Reference Manual 5 - 5
5.4 Uninstalling FB Library 5 - 6
6 PROGRAM EXAMPLES USING FUNCTION BLOCKS
6.1 System Configuration of Program Examples 6 - 2
6.2 Processing of Program Examples 6 - 3
6.3 Creating Program Examples 6 - 4
APPENDIX
Appendix 1 Character Strings that cannot be Used for Label Names and FB Data Names/Instance Names App - 2
A - 7
Appendix 2 Supported CPU modules App - 5
Appendix 3 Using FBs Created with GX Developer in GX Works2 App - 6
INDEX
TRADEMARKS
A - 8
MANUALS
Related manuals are separately issued according to the purpose of their functions in GX Works2.
Related manuals
The manuals related to this product are shown below. Refer to the following tables when ordering required manuals.
1) Operation of GX Works2
2) Structured Programming
Manual name Manual number
(Model code)
GX Works2 Version 1 Operating Manual (Simple Project, Function Block) Explains methods for such as creating function blocks, pasting function blocks to sequence programs, and operating FB library in Simple project of GX Works2.
(Sold separately)
SH-080984ENG (13JU72)
(this manual)
GX Works2 Version 1 Operating Manual (Common) Explains the system configuration of GX Works2 and the functions common to Simple project and Structured project such as parameter setting, operation method for the online function.
(Sold separately)
SH-080779ENG (13JU63)
GX Works2 Version 1 Operating Manual (Simple Project) Explains methods for such as creating and monitoring programs in Simple project of GX Works2.
(Sold separately)
SH-080780ENG (13JU64)
GX Works2 Version 1 Operating Manual (Structured Project) Explains methods for such as creating and monitoring programs in Structured project of GX Works2.
(Sold separately)
SH-080781ENG (13JU65)
GX Works2 Version 1 Operating Manual (Intelligent Function Module) Explains methods of intelligent function module for such as parameter setting, monitoring programs, and predefined protocol support function in GX Works2. (Sold separately)
SH-080921ENG (13JU69)
GX Works2 Beginner's Manual (Simple Project) Explains fundamental methods for such as creating, editing, and monitoring programs in Simple project for users inexperienced with GX Works2. (Sold separately)
SH-080787ENG (13JZ22)
GX Works2 Beginner's Manual (Structured project) Explains fundamental methods for such as creating, editing, and monitoring programs in Structured project for users inexperienced with GX Works2. (Sold separately)
SH-080788ENG (13JZ23)
Manual name Manual number
(Model code)
MELSEC-Q/L/F Structured Programming Manual (Fundamentals) Explains the programming methods, types of programming languages, and other information required to create structured programs. (Sold separately)
SH-080782ENG (13JW06)
MELSEC-Q/L/F Structured Programming Manual (Common Instructions) Explains the specifications and functions of common instructions such as sequence instructions, basic instructions, and application instructions, that can be used in structured programs. (Sold separately)
SH-080783ENG (13JW07)
MELSEC-Q/L Structured Programming Manual (Application Functions) Explains the specifications and functions of application functions that can be used in structured programs. (Sold separately)
SH-080784ENG (13JW08)
MELSEC-Q/L Structured Programming Manual (Special Instructions) Explains the specifications and functions of special instructions such as module dedicated instruction, PID control instruction, and built-in I/O function dedicated instruction, that can be used in structured programs. (Sold separately)
SH-080785ENG (13JW09)
FXCPU Structured Programming Manual (Device & Common) Explains the devices and parameters provided in GX Works2 for structured programming.
(Sold separately)
JY997D26001 (09R925)
FXCPU Structured Programming Manual (Basic & Applied Instruction) Explains the sequence instructions provided in GX Works2 for structured programming.
(Sold separately)
JY997D34701 (09R926)
FXCPU Structured Programming Manual (Application Functions) Explains the application functions provided in GX Works2 for structured programming.
(Sold separately)
JY997D34801 (09R927)
A - 9
3) Operation of iQ Works
The Operating Manuals are included on the DVD-ROM and CD-ROM of the software package in a PDF file format. Manuals in printed form are sold separately for single purchase. Order a manual by quoting the manual number (model code) listed in the table above.
Manual name Manual number
(Model code)
Let's start iQ Works Version 2 Explains fundamental methods for such as managing the system using MELSOFT Navigator and using system labels for users inexperienced with GX Works2. (Sold separately)
SH-081261ENG (13JZ79)
A - 10
Purpose of this manual
This manual explains the operations for creating sequence programs with function blocks (FB) in Simple project using the functions supported by GX Works2. Manuals for reference are listed in the following table according to their purpose. For information such as the content and number of each manual, refer to the list of 'Related manuals'.
1) Installation of GX Works2 and the USB driver
2) Operation of GX Works2
Purpose GX Works2 Installation Instructions
GX Works2 Version 1 Operating Manual
Common
Learning the operating environment and installation method
Learning a USB driver installation method
Purpose
GX Works2 Beginner's Manual
GX Works2 Version 1 Operating Manual
Simple Project
Structured Project
Common
Simple Project Structured
Project
Intelligent Function Module
Function Block
Learning all functions of GX Works2
Learning the project types and available languages in GX Works2
Learning the basic operations and operating procedures when creating a simple project for the first time
Learning the basic operations and operating procedures when creating a structured project for the first time
Learning the operations of available functions regardless of project type.
Learning the functions and operation methods for programming
Learning the operations and operating procedures when using function blocks (FBs) in Simple project
Learning data setting methods for intelligent function module
Details
Details
Outline
Outline
Details
Details
Details
Outline Details Details
Details
Details
A - 11
3) Operations in each programming language For details of instructions used in each programming language, refer to the section 4 and the section 5 on the following pages.
Purpose
GX Works2 Beginner's Manual GX Works2 Version 1
Operating Manual
Simple Project
Structured Project
Simple Project
Structured Project
Simple Project
Ladder Diagram
Sequential Function Chart
Structured Text
Structured project
Ladder Diagram
Sequential Function Chart
Structured Ladder /FBD
Structured Text
*1 : MELSAP3 and FX series SFC only
Outline Details
Outline
*1
Details
Outline Details
Outline Details
Outline
*1
Details
Outline Details
Outline Details
A - 12
4) Details of instructions in each programming language (for QCPU (Q mode)/LCPU)
Purpose
MELSEC-Q/L/F Structured
Programming Manual
MELSEC-Q/L Structured Programming
Manual
MELSEC-Q/L Programming
Manual
MELSEC-Q/L/QnA Programming Manual
Manual for
module to be used
Fundamentals Common
Instructions Special
Instructions Application Functions
Common Instruction
PID Control Instructions
SFC -
All languages
Learning details of programmable controller CPU error codes, special relays, and special registers
Using Ladder Diagram
Learning the types and details of common instructions
Learning the types and details of instructions for intelligent function modules
Learning the types and details of instructions for network modules
Learning the types and details of instructions for the PID control function
Using Sequential Function Chart
Learning details of specifications, functions, and instructions of SFC (MELSAP3)
Using Structured Ladder/ FBD or Structured Text
Learning the fundamentals for creating a structured program
Learning the types and details of common instructions
Learning the types and details of instructions for intelligent function modules
Learning the types and details of instructions for network modules
Learning the types and details of instructions for the PID control function
Learning the types and details of application instructions
Details
Details
Details
Details
Details
Details
Details
Details
Outline Details
Outline Details
Outline Details
Details
A - 13
5) Details of instructions in each programming language (for FXCPU)
Purpose
MELSEC-Q/L/F Structured
Programming Manual
FXCPU Structured Programming
Manual
FXCPU Programming
Manual
Fundamentals Device & Common
Sequence Instructions
Application Functions
FX0, FX0S, FX0N, FX1, FXU, FX2C
FX1S, FX1N, FX2N, FX1NC,
FX2NC
FX3S, FX3G,FX3U,
FX3GC,FX3UC
Using Ladder Diagram
Learning the types and details of basic/ application instructions, descriptions of devices and parameters
Using Sequential Function Chart
Learning details of specifications, functions, and instructions of SFC
Using Structured Ladder/ FBD or Structured Text
Learning the fundamentals for creating a structured program
Learning the descriptions of devices, parameters, and error codes
Learning the types and details of sequence instructions
Learning the types and details of application instructions
Details Details Details
Details Details Details
Details
Details
Details
Details
A - 14
How to read this manual
Section title
Clarifies the section of currently
open page.
Reference location
leads to the reference location
and reference manual.
Operating procedure
Describes the operating procedure
of the function.
Screen display
Describes the screen display
procedure.
Follow the and select [(menu)] to
open the screen.
*Screen display may differ
depending on the CPU type.
In that case, typical example is
described.
Chapter heading
Index on the right of the page
number clarifies the chapter of
currently open page.
A - 15
This manual also uses the following columns:
This explains notes requiring attention or useful functions relating to the information given on the same page.
Symbols used in this manual
The following shows the symbols used in this manual with descriptions and examples.
No. Symbol Description Example
[ ] Menu name on a menu bar [Project]
Toolbar icon
(Underline) Screen name Q Parameter Setting screen
<< >> Tab name on a screen <
" " Item name on a screen "Timer Limit Setting"
Button on a screen button
- Keyboard key
1
2
4
5
6
3
A - 16
GENERIC TERMS AND ABBREVIATIONS IN THIS MANUAL
The following are the generic terms/abbreviations of such as software packages and programmable controller CPUs used in this manual.
Generic term and abbreviation
Description
GX Works2 Generic product name for SWnDND-GXW2-E and SWnDNC-GXW2-E (n: version)
GX Developer Generic product name for SWnD5C-GPPW-E, SWnD5C-GPPW-EA, SWnD5C-GPPW-EV, and SWnD5C-GPPW-EVA (n: version)
Personal computer Generic term for personal computers on which Windows operates
Basic model QCPU Generic term for Q00J, Q00, and Q01
High Performance model QCPU
Generic term for Q02, Q02H, Q06H, Q12H, and Q25H
Process CPU Generic term for Q02PHCPU, Q06PHCPU, Q12PHCPU, and Q25PHCPU
Redundant CPU Generic term for Q12PRHCPU and Q25PRHCPU
Universal model QCPU Generic term for Q00UJ, Q00U, Q01U, Q02U, Q03UD, Q03UDE, Q03UDV, Q04UDH, Q04UDEH, Q04UDV, Q06UDH, Q06UDEH, Q06UDV, Q10UDH, Q10UDEH, Q13UDH, Q13UDEH, Q13UDV, Q20UDH, Q20UDEH, Q26UDH, Q26UDEH, Q26UDV, Q50UDEH, and Q100UDEH
QCPU (Q mode) Generic term for Basic model QCPU, High Performance model QCPU, Process CPU, Redundant CPU, and Universal model QCPU
LCPU Generic term for L02S, L02S-P, L02, L02-P, L06, L06-P, L26, L26-P, L26-BT, and L26-PBT
FXCPU Generic term for FX0S, FX0, FX0N, FX1, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G, FX3GC, FX3U, FX3UC
SFC Generic term for MELSAP3, MELSAP-L, and FX series SFC
MELSOFT Library
Generic term for components (FB library, sample programs, drawing data) which provide easy operation of programmable controller related modules and GOTs, and various devices that are connected to them Contact your local Mitsubishi Electric sales office or representative to obtain components of MELSOFT Library.
FB Abbreviation for a function block
A - 17
TERMS
The following are the terms used in this manual.
Term Description
Actual device An actual device assigned to label after compiling a project with labels, or a device that is not described using a label
Common instruction Generic term for sequence instructions, basic instructions, application instructions, data link instructions, multiple CPU dedicated instructions, and multiple CPU high-speed transmission dedicated instructions
Special instruction Generic term for module dedicated instructions, PID control instructions, socket communication function instructions, built-in I/O function instructions, and data logging function instructions
Simple Project Generic term for projects created using Ladder Diagram, Sequential Function Chart, Structured Text
Without labels Generic term for projects created without selecting "Use Label" when creating new projects
With labels Generic term for projects created with selecting "Use Label" when creating new projects
Project without labels Generic term for Simple projects that do not use labels
Project with labels Generic term for Simple projects that use labels and Structured projects
Project with security Generic term for projects whose securities are set
Utilization To paste FB to a sequence program
Reuse To use FB to other project
Library (project) A project to be used as an FB library
FB instance An FB pasted to a sequence program
Global label A label which becomes effective for all program data when multiple program data items are created in a project
Local label A label which becomes effective only for each program data Set for each program data.
Structure A data type which allows various device types (bit device, word device, etc.) to be stored in single aggregate (single data)
Array A data type which allows the same device type to be stored in a consecutive area
A - 18
MEMO
1
O V
E R
V IE
W O
F
F U
N C
T IO
N
B L
O C
K S
2
C R
E A
T IN
G
F U
N C
T IO
N
B LO
C K
S
3
U S
IN G
F U
N C
T IO
N
B L
O C
K S
4
M A
N A
G IN
G A
N D
E
D IT
IN G
F U
N C
T IO
N
B LO
C K
S
5
U S
IN G
F B
LI
B R
A R
IE S
6
P R
O G
R A
M
E X
A M
P LE
S U
S IN
G
F U
N C
T IO
N B
LO C
K S
A
A P
P E
N D
IX
I
IN D
E X
1 - 1
1 OVERVIEW OF FUNCTION BLOCKS
This chapter explains features of FBs, overview of labels, and work flow for using FBs.
1.1 Function Blocks (FBs) 1 - 2
1.2 Features of FBs 1 - 3
1.3 Labels 1 - 4
1.4 Programming Flow with FBs 1 - 5
1.5 Overview of Screen Configuration 1 - 8
1 - 2
1 OVERVIEW OF FUNCTION BLOCKS
1.1 Function Blocks (FBs)
An FB is designed to convert a ladder block, which is used repeatedly in a sequence program, into a component to be utilized in a sequence program. FBs can be used in projects with labels. This manual explains FBs used in Simple projects. In the operation examples, Ladder Diagram is selected as a programming language, but Structured Text can also be selected. Note, however, that FXCPU Simple projects do not support Structured Text.
Program 1
Program 2
Program 1
Program 2
Project A
Project B
Program 3
Program 3
Project A
Project B
FB
FB
FB Utilize
FB
Convert the
repeatedly-used
ladder block to
a component
1.2 Features of FBs
1 - 3
1
O V
E R
V IE
W O
F
F U
N C
T IO
N
B L
O C
K S
2
C R
E A
T IN
G
F U
N C
T IO
N
B LO
C K
S
3
U S
IN G
F U
N C
T IO
N
B L
O C
K S
4
M A
N A
G IN
G A
N D
E
D IT
IN G
F U
N C
T IO
N
B LO
C K
S
5
U S
IN G
F B
LI
B R
A R
IE S
6
P R
O G
R A
M
E X
A M
P LE
S U
S IN
G
F U
N C
T IO
N B
LO C
K S
A
A P
P E
N D
IX
I
IN D
E X
1.2 Features of FBs
Creating programs efficiently
Converting a standard program into a component as a single block enables the program to be utilized easily. As an easy utilization for a sequence program is possible, the efficiency of creating a large-scale program is improved. In addition, converting a program into a component improves program readability and eases editing and debugging.
Consistency of program quality
Converting a program into a component as an FB to utilize the program allows consistency of program quality, without relying on the technological skills of the program developers. In addition, programming mistakes which may occur at the time of utilization can be prevented.
Reducing program creation man-hours with FB libraries
With QCPU (Q mode)/LCPU, man-hours for creating a program can be reduced using FB libraries. There are FB libraries which support various devices such as CPU modules, analog input/output modules, and counter modules. FB libraries which support partner products are also supplied.
Programming languages according to the intended use are selectable
In Simple projects, Ladder Diagram or Structured Text can be selected as a programming language for FBs. The optimum programming language which meets the intended use can be selected to create FBs. FXCPU Simple project supports only Ladder Diagram.
1 - 4
1 OVERVIEW OF FUNCTION BLOCKS
1.3 Labels
A label is a character string which represents a device. Using labels allows a program to be created without considering devices in the program. Therefore, a program with labels can be easily utilized even for a system with different module configuration.
Global labels and local labels
There are two types of labels, global labels and local labels.
Global labels Global labels are shared among all sequence programs in a project. A specific device can be assigned to a global label.
Local labels Local labels are used only in a single sequence program. They cannot be shared even if local labels with the same name are set for multiple sequence programs. Different devices are assigned to local labels for each sequence program.
1.4 Programming Flow with FBs
1.4.1 FB creation procedure 1 - 5
1
O V
E R
V IE
W O
F
F U
N C
T IO
N
B L
O C
K S
2
C R
E A
T IN
G
F U
N C
T IO
N
B LO
C K
S
3
U S
IN G
F U
N C
T IO
N
B L
O C
K S
4
M A
N A
G IN
G A
N D
E
D IT
IN G
F U
N C
T IO
N
B LO
C K
S
5
U S
IN G
F B
LI
B R
A R
IE S
6
P R
O G
R A
M
E X
A M
P LE
S U
S IN
G
F U
N C
T IO
N B
LO C
K S
A
A P
P E
N D
IX
I
IN D
E X
1.4 Programming Flow with FBs
This manual explains the operating procedures with examples of FBs used on QCPU (Q mode)/LCPU. For the instructions and functions which are available for FXCPU, refer to the following manuals. FXCPU user's manuals and programming manuals
1.4.1 FB creation procedure
Operating procedure
1. Creating a project for FBs
2. Creating new FB data
3. Setting local labels
4. Creating an FB program
5. Converting FBs
Procedure Reference
Create a project with labels. Section 2.1
Procedure Reference
Create new FB data. Section 2.2
Procedure Reference
Set local labels to be used for the FB program. Section 2.3
Procedure Reference
Create an FB program using labels. Section 2.4
Procedure Reference
Conversion finalizes the edited FB program content. Section 2.5
1 - 6
1 OVERVIEW OF FUNCTION BLOCKS
1.4.1 FB creation procedure
Operations for created FBs
Reading programs from programmable controller CPU (Section 4.1)
Utilizing FBs (Section 4.2)
Changing FB instance names (Section 4.4)
Deleting FBs (Section 4.5)
Protecting FBs (Section 4.6)
Searching/replacing FB instance names and labels (Section 4.7)
1.4 Programming Flow with FBs
1.4.2 Sequence program creation procedure using FBs 1 - 7
1
O V
E R
V IE
W O
F
F U
N C
T IO
N
B L
O C
K S
2
C R
E A
T IN
G
F U
N C
T IO
N
B LO
C K
S
3
U S
IN G
F U
N C
T IO
N
B L
O C
K S
4
M A
N A
G IN
G A
N D
E
D IT
IN G
F U
N C
T IO
N
B LO
C K
S
5
U S
IN G
F B
LI
B R
A R
IE S
6
P R
O G
R A
M
E X
A M
P LE
S U
S IN
G
F U
N C
T IO
N B
LO C
K S
A
A P
P E
N D
IX
I
IN D
E X
1.4.2 Sequence program creation procedure using FBs
Operating procedure
1. Pasting FBs
2. Creating input/output circuits of an FB instance.
3. Converting/compiling a sequence program
4. Writing a program to a programmable controller CPU
5. Checking the operation
Procedure Reference
Paste FBs to the sequence program. Section 3.1.1
Paste FBs of the FB Library to the sequence program. Chapter 5
Procedure Reference
Create input and output circuits of the FB instance. Section 3.1.2
Procedure Reference
Convert/compile the sequence program. Section 3.1.4
Procedure Reference
Write the sequence program to the programmable controller CPU. Section 3.1.5
Procedure Reference
Monitor the operation of the sequence program written to the programmable controller CPU.
Section 3.2
1 - 8
1 OVERVIEW OF FUNCTION BLOCKS
1.5.1 Main frame configuration
1.5 Overview of Screen Configuration
1.5.1 Main frame configuration
This section explains the screen configuration of the main frame (basic screen) of GX Works2 that is displayed when it is started up. The following is an example of a screen on which a work window and docked windows are displayed.
Screen display
Element Selection
window
Status bar
Work
window
Title bar
Toolbar
Menu bar
FB component
Navigation window
Sequence program
FB data
Docked window
FB instance (Entity)
1.5 Overview of Screen Configuration
1.5.1 Main frame configuration 1 - 9
1
O V
E R
V IE
W O
F
F U
N C
T IO
N
B L
O C
K S
2
C R
E A
T IN
G
F U
N C
T IO
N
B LO
C K
S
3
U S
IN G
F U
N C
T IO
N
B L
O C
K S
4
M A
N A
G IN
G A
N D
E
D IT
IN G
F U
N C
T IO
N
B LO
C K
S
5
U S
IN G
F B
LI
B R
A R
IE S
6
P R
O G
R A
M
E X
A M
P LE
S U
S IN
G
F U
N C
T IO
N B
LO C
K S
A
A P
P E
N D
IX
I
IN D
E X
Display contents
Name Description Reference
Title bar Display a project name.
Menu bar Display menu options for executing each function.
Toolbar Display tool buttons for executing each function. GX Works2 Version 1 Operating Manual (Simple Project)
Work window A main screen used for operations such as programming, parameter setting, and monitoring. GX Works2 Version 1
Operating Manual (Common)
Docking window A sub screen to support operations performed on a work window.
Navigation Display contents of a project in tree format.
Element Selection Display a list of functions (such as FBs) used for programming. Section 3.1.1
FB component An FB registered as a component
Output Display compilation and check results (errors and warnings). GX Works2 Version 1 Operating Manual (Simple Project)
Cross Reference Display cross reference results.
GX Works2 Version 1 Operating Manual (Common)
Device List Display the device list.
Watch 1 to 4 A screen used for monitoring and changing current device values.
Intelligent function module monitor 1 to 10
A screen used for monitoring intelligent function modules.
Find/Replace A screen used for searching and replacing character strings in the project.
Debug A screen used for setting the debug which uses the simulation function.
Status bar Display information about a project being edited.
Sequence program A program and local labels.
FB data A program and local labels of FB.
FB instance (entity) An FB pasted to a sequence program.
1 - 10
1 OVERVIEW OF FUNCTION BLOCKS
1.5.2 Label setting editor
1.5.2 Label setting editor