You are on page 1of 28

fnb

Mitsubishi GX Works3 and FX5U Training 2018/02/12 Page |1


Contents
Introduction ..................................................................................................................................... 3
 Course Introduction ........................................................................................ 3
 Course Prerequisites ....................................................................................... 3
Hardware requirements ............................................................................................................... 3
Software requirements ................................................................................................................ 3
 Course Outcomes ........................................................................................... 3
Installation ....................................................................................................................................... 4
Launching GX Works3 ........................................................................................................................ 5
Programming and Variables................................................................................................................ 6
 General ......................................................................................................... 6
 Structured or simple mode projects .................................................................. 6
Ladder Diagram (LD) .................................................................................................................. 6
Function Block (FB) ..................................................................................................................... 6
Structured Text (ST) ................................................................................................................... 6
 Variables ....................................................................................................... 7
Local Labels ............................................................................................................................... 7
Global Labels.............................................................................................................................. 7
Module Labels ............................................................................................................................ 7
System Labels ............................................................................................................................ 7
Creating a new PLC project ................................................................................................................ 8
 Create a Structured Data Type (SDT) ............................................................. 11
 Create an instance of a Structured Data Type for Motor 1 ................................ 13
 Creating the motor Function Block ................................................................. 16
 Create an instance of the Function Block for motor 1 ....................................... 19
Testing of the Function Block ........................................................................................................... 22
e-Manual Viewer (HELP) .................................................................................................................. 26
 General ....................................................................................................... 26
 F1 Help Menu .............................................................................................. 28

Mitsubishi GX Works3 and FX5U Training 2018/02/12 Page |2


Introduction
Course Introduction
The purpose of this training course is to learn how to program a simple program within the new Mitsubishi
GX Works3 programming software package.

Course Prerequisites
The training course is not designed to teach the basic first principles of PLC programming; it teaches the
features and functions of GX Works3 software.

Hardware requirements
 Laptop i5 Core
 15 GB hard drive free space
 CDRom on laptop

NOTE: Windows Home editions are not compatible.

Software requirements
 Windows 7 Pro or higher
 Basic understanding of Windows Operating System environment

NOTE: Windows Home editions are not compatible.

Course Outcomes
On completion of the course the delegate will:

 Have familiarised themselves with the new GX Works3 programming environment.


 Have a better understanding of the features of GX Works3 software package.
 Be able to create a fully functional motor starter Function Block with Data Unit Type (DUT) and an instance of
the motor block.

NOTE: Delegates will not be expert programmers but will have gained programming experience.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 Page |3


Installation
1. Before installing GX Works3, ensure there is a minimum of 15 GB free drive space.
2. Install the software from the DVD disk provided.
3. Open the disk in Windows Explorer and click Autorun.exe.
This will launch the MELSOFT Autorun screen.
4. Select GX Works3.
5. On this screen, type in your name, company and CD-key.

NOTE: This is the software key provided for you in the software package.

Figure 1: GX Works 3 – InstallShield Wizard

6. The instructions displayed on the screen will ask to install additional tools.

NOTE: GX Works2 and GX Developer are available to install.

7. Select both options. This is the latest update of the software available.
8. On the next screen, select that all the software gets installed in the same folder as the GX Works3 folder.
9. Leave the software to install.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 Page |4


Launching GX Works3
1. On the desktop there is a shortcut to launch GX Works3.
2. Double click on the shortcut.
The following screen should open. (Figure 2)

Figure 2: GX Works 3 Software Interface

NOTE: The GX Works3 screen consists of many components. Many of these components, such as toolbars
and certain windows, can be docked at various locations around the screen, or their display can be turned
off.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 Page |5


Programming and Variables
General
Before creating a new PLC project, you need to understand the modern concepts of PLC programming
using configuration tools and labels. Using traditional Mitsubishi PLC I/O addresses such as X0 and Y10,
and even referring to data registers by their address such as D0, is considered an old style of programming
and is not in line with using modern programming methods such as IEC 61131.

The purpose of creating a project is to teach the basic principles of programming. For this project use the
programing language, Function Block Diagram (FBD) and Structured Ladder Diagram (LD) programming,
FBD/LD.

IEC 61131 is an international standard for programmable controller systems. Programming languages for
PLCs are standardised by IEC 61131-3. Each language has different features to accommodate your
application and programmers skill. The IEC 6113 programming methods are supported in GX Works3:
 The variables and devices used in each program can be shared across multiple platforms.
 User-defined function blocks are supported.
 Use any language in the same project.

Structured or simple mode projects


There have always been two ways of programming a Mitsubishi PLC. Historically the choice was to either
use GX Developer or GX IEC Developer software packages. More recently the choice was a simple mode or
structured mode project in the GX Works2 software. Practically, that meant at the beginning of a project,
you had to decide if you were going to be creating a PLC project using the IEC 61131 method of
programming (using GX IEC Developer or GX Works2 in structured mode) or not.

NOTE: In GX Works3, the two methods of programming a PLC are both still supported but they can both be
implemented within the same project and the choice does not have to be made at the beginning of a project.

Ladder Diagram (LD)


In ladder diagram programming, contacts and coils are used to create a program resembling an electrical
circuit. The instruction processes are easy to follow and understand.
Function Block (FB)
Function block diagram programs are written by arranging blocks with different functions and indicating
relationships between the blocks.
Structured Text (ST)
Structured text programs are programs written in text. It is easy to learn for those with experience in
writing programs in C or BASIC. Calculation formulas are similar to mathematical expressions which are
easy to understand. Structured text programs are suitable for data handling.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 Page |6


Variables
A variable is a storage location paired with an associated symbolic name (an identifier), which contains
some known or unknown quantity of information referred to as a value. The variable name is the usual way
to reference the stored value; this separation of name and content allows the name to be used
independently of the exact information it represents. The Mitsubishi MELSOFT GX Works 3 software
consists of four types of variables (labels); Local, Global, Module and System. These labels are available
the Navigation window on the left of your screen.

NOTE: The labels can be up to 32 characters long, but cannot include spaces, special characters, device
numbers and cannot begin with a number.

Local Labels
Local labels (variables) can ONLY be used in each Program Organization Units (POU). Local labels that are
not included in POUs cannot be used. When setting a local label, set the label name, class, and data type.
The local label consist of 9 classes:
 VAR: Label that can be used within the range of declared POUs. This label cannot be used in other POUs.
 VAR_CONSTANT: Constant that can be used within the range of declared POUs. This label cannot be used in
other POUs.
 VAR_RETAIN: Latch type label that can be used within the range of declared POUs This label cannot be used
in other POUs.
 VAR_INPUT: Label that inputs to a function or a Function Block. This label receives a value, and cannot be
changed in POUs.
 VAR_OUTPUT: Label that outputs a value from a function or a Function Block.
 VAR_OUTPUT_RETAIN: Latch type label that outputs a value from a function or a Function Block.
 VAR_IN_OUT: Local label which receives a value, outputs it from a POU, and can be changed in POUs.
 VAR_PUBLIC: Label that can be accessed from other POUs.
 VAR_PUBLIC_RETAIN: Latch type label that can be accessed from other POUs.

Global Labels
Global labels (variables) are labels that can be shared by programs in a project. Global labels can be used
in all the programs in a project. Global labels can be used in program blocks and Function Blocks. When
setting a global label, set the label name, class and data type, and assign a device. A global label consist of
3 types of classes:
 VAR_GLOBAL: Common label that can be used in program blocks and Function Blocks.
 VAR_GLOBAL_CONSTANT: Common constant that can be used in program blocks and Function Blocks.
 VAR_GLOBAL_RETAIN: Latch type label that can be used in program blocks and Function Blocks.

Module Labels
Module labels are unique to a specific module or CPU, and are automatically generated. They are created
as Global Labels. (M+Global)
System Labels
System labels are controlled by the MELSOFT iQ Navigator and provide the same data to all projects
compatible with iQ Works. They can be referenced from other devices such as GOT, Motion Controllers,
CPU’s, etc. and used for monitoring and setting data. System labels can be created by registering Global
labels as System labels on the Global Label Editor.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 Page |7


Creating a new PLC project
Objective
Create a new PLC project.
Method
1. In the main window, from the menu bar, click Project.
2. From the menu select and click New. (Figure 3)

Figure 3: New Project: PLC type select

3. Select the FX5CPU series from the Series drop down menu.
4. Select FX5U from the Type drop down menu.
5. Select FBD/LD from the Program Language drop down menu.
6. The programing language we will be using is Function Block diagram and structured ladder programming.
7. The GX Works3 screen should look like this now. (Figure 4)

Figure 4: GX Works3 programming screen

Mitsubishi GX Works3 and FX5U Training 2018/02/12 Page |8


8. By default you will see in the design page at the top it opens 2 tabs.
ProgPou [PRG] [Local Label Setting] and ProgramBody: ProgPou [PRG]. (Figure 5)

Figure 5: Default PLC programming tabs

9. Now just to show you how easy it is to select the correct FX5U PLC, simply double click on Module
Configuration. (Figure 6)

Figure 6: Module configuration

10. A screen with the FX5U PLC will open.


11. Hover the mouse over the PLC and the details of the PLC will be displayed. (Figure 7)

Figure 7: PLC configuration workspace

Mitsubishi GX Works3 and FX5U Training 2018/02/12 Page |9


12. On the right side of the screen there is an Element Selection window. Select the different I/O cards and
drag/link them to the correct side of the PLC. (Figure 8)

Figure 8: Element Selection window and add I/O card

13. Right click on the PLC and click on “Check” and then select “System Configuration”. This will do a very simple
check of your configuration. If there is an error, right click on the PLC again, click on “Parameters” and select
“Fix”. This will explain what needs to be fixed.
It is easy to configure the PLC with additional I/O and this is not part of the training at all.
14. Close the Module Configuration tab. Do not save it. Return to the ProgramBody sheet.

NOTE: The goal of today’s training is to create a simple motor Function Block with a start, stop, latching and
interlocking signals and a working instance of it.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 10


Create a Structured Data Type (SDT)
Objective
Create a Structured Data Type
Method
1. The first Structured Data Type (SDT) is a motor template/Function Block. The reason for this is to clearly
understand what input/output and type of data is required for the Function Block to work. This also makes it
easier for SCADA communication and understanding what data type is required.
2. In the Navigation window, select Label and expand it to the lowest point.
3. Right-click on Structured Data Types and select “Add New Data”. (Figure 9)

Figure 9: Structured Data Types

4. The New Data window is displayed.


5. Type in Motor_DUT next to the Data Name.
6. Click the Ok button.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 11


4. For the motor Function Block we require the following (Figure 10):

 IN_Interlock – bit – Interlock Input


 IN_Start – bit – Start Input
 IN_Stop – bit – Stop Input
 IN_Reset – bit – Reset Input
 OUT_Run – bit – Running Signal Output
 OUT_Alarm - bit - Alarm Status

Figure 10: Structure Data Configuration

5. Click Check.
6. Close the window.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 12


Create an instance of a Structured Data Type for Motor 1
Objective
Create a motor instance of the Function Block

Prerequisites
 A created motor Function Block

1. Specify a global variable (label) and name it motor.


1. In the Navigation window, select Label and expand it.
2. Select Global Label and expand it.
3. Double click on Global.
4. In the Label Name column, type in Motor_1_Data.

5. Click the the browse button next to the Data Type.


6. In Type Category select “Structured Data Type”.
7. Select the Data Type, “MOTOR_DUT”. (Figure 11).

Figure 11: Data Type Selection MOTOR_DUT

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 13


8. In the top of your Global window click the “Show Details” button. (Figure 12).

Figure 12: Global Window Show Details button

This will add the columns Class, Assign (Device/Label), Initial Value and Constant.
9. For the Motor_1_Data label you created, you should have the Data Type as MOTOR_DUT, class as
VAR_GLOBAL and in Assign, you should see Detailed Setting in pink.
10. Click on Detailed Setting and the following window will appear; (Figure 13).
11. Deselect Use Bit Specfication.

Figure 13: I/O Assignment

In this window you can assign you I/O addresses according to where it is allocated.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 14


12. Assign the I/O as follows:

Label Name Device


1 IN_Interlock X0
2 IN_Start X1
3 IN_Stop X2
4 IN_Reset X3
5 OUT_Run Y0
6 OUT_Alarm Y1

Figure 14: I/O Assignment completed

Structured Data Types are very easy to add and change PLC I/O addressing from one central point. It is not
necessary to go and change the values in different places within the program.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 15


Creating the motor Function Block
Objective
Create a motor Function Block.
1. In the Navigation window, right click on FB/FUN and select “Add New Data”.
The Function Block (FB) settings window will now appear. (Figure 15).

Figure 15: Function Block settings window

2. Type in Motor_FB for the Data Name.


3. Select Ladder as the programing language.
4. Press OK.
5. The Motor_FB program body should be open.
6. In the Navigation window browse to the Motor_FB local label.
7. Specify each variable label in the Function Block.(Figure 16)
 IN_Interlock – bit – VAR_INPUT
 IN_Start – bit – VAR_INPUT
 IN_Stop – bit – VAR_INPUT
 IN_Reset – bit – VAR_INPUT
 OUT_Run – bit – VAR_OUTPUT
 OUT_Alarm – bit – VAR_OUTPUT
 Start_Latch – bit – VAR
 Fault_Latch – bit – VAR

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 16


Figure 16: Function Block local label

13. Open the ProgramBody of the motor Function Block.

NOTE: We are now going to use simple ladder to write the Function Block. When you start with your first
contact function and start typing in the first 2 letters of the label, it gives you a drop down of the labels
starting with those 2 letters.

Program:
Start latch condition:
Start input must be true, stop and fault input false, then start latch is true.

Fault Latch condition:


Interlock input must be true and reset input false, then fault latch is true.

OUT Run condition:


If start latch is true and fault latch is false then out run is true.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 17


Below is the program for the Function Block. (Figure 17)

Figure 17: Function Block program

NOTE: Once the code is created, do a compile.

14. Browse to the menu tool bar, click on “Convert” and select “Rebuild All”.

NOTE: If the project compiles without any errors, then save the project. The Motor_FB Function Block and
MOTOR_DUT stays red. This is fine as it is not used in the program yet.

15. Click on Project in the menu bar and click Save. Name the project “GX Works3 Motor program”.
16. Browse to the C:\ drive and create a directory called Training.
17. Save the program in that directory.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 18


Create an instance of the Function Block for motor 1
1. In the Program go to Scan, open MAIN  ProgPou and then double click on ProgramBody.
2. In the Element Selection window open the POU List tab, then scroll down to Project – Function Block. There is
the Function Block that was created. (Figure 18).

Figure 18: Function Block in Element Selection window

3. Select it and drag it onto your program body workplace. Name the Function Block. Type in Demo_Motor_1.
(Figure 19).

Figure 19: Define Motor Function Block name

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 19


An instance of the Function Block has been created. This Function Block still needs inputs. (Figure 20)

Figure 20: Demo_Motor_1 Function Block

4. Click on the dot at IN_Interlock and start typing motor and a drop down will appear. Select Motor_1_Data.
(Figure 21).

Figure 21: Motor data select

5. Press dot(.) and another dropdown window appears. Specify the I/O input or output to use. (Figure 22). Select
and press Enter.

Figure 22: I/O Selection

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 20


6. Carry on assigning the correct labels with correct inputs and outputs. Below is how it should look like. (Figure
23).

Figure 23: Demo Motor 1 completed Function Block

7. Do a Rebuild All and check that there is no errors. If there are no errors then save the project.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 21


Testing of the Function Block
Objective
Testing of the Function Block

Prerequisites
 A created motor Function Block
 A created instance of a motor Function Block

1. After a successful build right click on your Function Block instance and select “Register to Watch Window” and
select “Watch 1”.
2. This will open another window tab at the bottom of your screen called Watch 1.
3. Click on the expand (+) sign. This will expose all the signals within the Function Block. (Figure 24)
4. This window is great for monitoring purposes. We will use it for simulation purposes.

Figure 24: Screen with Watch window and Function Block in it

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 22


5. To simulate and make sure the Function Block works correctly, click on Debug in your Menu Toolbar, select
Simulation and press Start Simulation.
A GX Simulator 3 interface will open together with an Online Data Operation window.
6. Select “Parameter + Program” and press Execute. (Figure 25)

Figure 25: Simulator, Parameter and Program window

This will download the program to the simulator.


8. On completion, press Close.
9. The simulator will automatically start and go into monitor mode. (Figure 26)

Figure 26: Simulator mode

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 23


10. To change an input right click on the input and select “Debug” and “Modify Value”.
This will change the input value.
11. Or alternatively press and hold “Shift” and double click on the input to change an input.
This will also change the value.
Let’s do this for Motor_1_Data.IN_Start. It gives an Out run signal. (Figure 27)

Figure 27: In Start signal true give's an Out Run signal

12. If you modify the IN_Interlock signal by changing it to 1, the Out_Run signal should fall away.
In the watch window, the Fault_Latch signal is ON. (Figure 28)

Figure 28: Interlock On

You have successfully created and simulated a simple Function Block with an instance of it.
You can now download this program to your PLC and it should work if you change the inputs manually.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 24


13. To test this, simply select Online from the menu bar, select Monitor and select Device/Buffer Memory Batch
Monitor. (Figure 29)

Figure 29: Buffer Memory monitor

14. In Device Name type in X0 and press Enter.


When you switch ON X0, the Y0 output on your PLC should come ON.

This concludes the GX Works 3 basic programming introduction training. For more information please feel
free to consult the mymitsubishi web portal where you can find a variety of manuals, program examples
and Function Blocks for cards or controllers and software updates.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 25


e-Manual Viewer (HELP)
General
1. The e-manual viewer is a new and very interactive way of providing help.
2. The e-manual viewer includes how to use GX Works 3 and the manuals necessary to program the iQ-R and iQ-F
PLC ranges.
3. Ultimately all Mitsubishi product manuals will be managed in an e-manual viewer.

NOTE: The e-manual viewer is also available as an APP for android based tablet devices.

4. On installation of the GX Works3, the e-manual viewer application is also installed along with all the GX Works3,
iQ-R, and iQ-F product manuals.
5. The e-manual viewer can be run and used as a separate standalone application and by selecting help in GX
Works3 the application will also run.
6. From the Help menu, you will find a link to the Mitsubishi Electric FA global website, as well as the software
version of GX Works3. (Figure 30)

Figure 30: GX Works 3 Help selections


7. The e-Manual Viewer is displayed in (Figure 31)

Figure 31: e-Manual Viewer

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 26


7. Once manuals are loaded, performing a cross manual search will give results from multiple manuals. Each
search will appear in a tab; up to 10 search tabs are allowed. (Figure 32)

Figure 32: e-Manual Viewer details

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 27


F1 Help Menu
To open the e-Manual Viewer when any instruction or Function Block is selected press the F1 function key.
The viewer will automatically display the appropriate information for the selected item. (Figure 33).

Figure 33: F1 Help function on functions and controls

NOTE: For the current iQ-R and iQ-F PLC products and also for the GX-Works3 software, the e-manual
viewer application is so comprehensive that it can almost be used as a training aid because it includes a step-
by-step guide to creating a PLC project.

Mitsubishi GX Works3 and FX5U Training 2018/02/12 P a g e | 28

You might also like