Download as pdf or txt
Download as pdf or txt
You are on page 1of 57

MELSEC IL to IEC Ladder

Conversion Utility
Customer Information Sheet

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
1/57

1 Table of Content
1

Table of Content ...............................................................................................................................2

History ...............................................................................................................................................3

MELSEC IL to IEC Ladder Conversion Utility basics....................................................................4

3.1
3.2

GX Developer Projects .......................................................................................................................5


DOS MEDOC Projects .......................................................................................................................6

Requirements....................................................................................................................................7

4.1
4.2
4.3

For DOS MEDOC programs...............................................................................................................7


For GX Developer programs ..............................................................................................................7
For PLC Upload..................................................................................................................................7

Import of programs and name lists ................................................................................................8

5.1
5.1.1
5.1.2
5.2
5.2.1
5.2.2

5.3
5.3.1
5.3.2

Import of DOS MEDOC programs and name lists..............................................................................8


Preparing the print file for DOS MEDOC............................................................................................8
Import the print file to GX IEC Developer V6.0 or later ....................................................................12
Import of GX Developer programs and name lists ...........................................................................18
Installing the GX Converter ..............................................................................................................18
Export of a GX Developer program ..................................................................................................19
5.2.2.1 Export of a GX Developer program (without label programming) .....................................19
5.2.2.2 Export of a GX Developer program with label programming ............................................25
Export of a GX Developer name list .................................................................................................26
5.2.3.1 Export of a GX Developer name list with MX Change ......................................................26
5.2.3.2 Export of a GX Developer name list without Label programming to EXCEL ....................36
5.2.3.3 Export of a GX Developer name list with Label ................................................................40
Upload of a PLC program.................................................................................................................44
How to upload several programs from Q and System Q..................................................................44
How to upload a Comment file from a PLC ......................................................................................44

The MELSEC IL to IEC Ladder Conversion Utility.......................................................................45

6.1
6.1.1

General Rules for the Conversion ....................................................................................................45


Summary of conversion rules ...........................................................................................................48
6.1.1.1 Definitions .........................................................................................................................48
6.1.1.2 Conversion rules ...............................................................................................................49
Using the MELSEC IL to IEC Ladder Conversion Utility ..................................................................51
ASCII Export from GX IEC Developer ..............................................................................................51
Conversion from IL to LADDER........................................................................................................51
Import of the converted ASCII file.....................................................................................................54
Limitations ........................................................................................................................................55
Hints and Tips...................................................................................................................................56

5.2.3

6.2
6.2.1
6.2.2
6.2.3
6.3
6.4

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
2/57

2 History
Date
16.09.2003
26.04.2004

Version
V0.0
V1.0 E

Author
Th. Lantermann
Chris Evans

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Description
First version
English Version

Date:
Date:
Page:

17.09.2003
26.04.2004
3/57

3 MELSEC IL to IEC Ladder Conversion Utility basics


The MELSEC IL to IEC Ladder Conversion Utility is a stand-alone tool to convert MELSEC IL
POUs to IEC Ladder POUs for GX IEC DEVELOPER 6.0 or later.
A GX Developer project can be exported as an ASCII file and then imported to GX IEC
Developer as a MELSEC IL POU.
In a similar way, a MEDOC project can be exported as an *.TMP file (print file) and then
imported to GX IEC Developer as a MELSEC IL POU.
The converter then converts the ASCII file export of these files and then allows this converted
file to imported back into GX IEC Developer as converted IEC Ladder code.
These procedures are described in detail in this document.
In addition, the handing of name lists from both GX Developer and MEDOC is covered, along
with program UPLOADS from the PLC.
NOTES:
POUs which are not MELSEC-IL are exported to the output file without change.
SFC programs are not converted!

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
4/57

3.1 GX Developer Projects

Section 5.2.2
GX Developer
Ladder Program

Name List

Section 5.2.3.2

Section 5.2.3.1

Excel 2000

MX Change

Section 6
GX IEC Developer
Melsec IL to Ladder Converter
GX IEC Developer

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
5/57

3.2 DOS MEDOC Projects

Section 5.1
DOS MEDOC
Ladder Program

Name List

Print File (*.TMP)

Section 6
GX IEC Developer
Melsec IL to Ladder Converter
GX IEC Developer

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
6/57

4 Requirements
4.1 For DOS MEDOC programs
The requirement is simply a print file (*.TMP) of the name list and program, no additional
tools are required.
If this is not available then a version of DOS MEDOC must be used to generate this print file.

4.2 For GX Developer programs


GX Converter must be installed to create the necessary export files from GX Developer.
Microsoft EXCEL 2000 or later and an EXCEL macro, is required to import the name list to
GX IEC Developer.
If the program has used labels then only an editor is needed to import the name list. But it is
also possible to do this using the EXCEL macro.

4.3 For PLC Upload


A program upload into GX IEC Developer will be displayed as MELSEC IL.
The converter will simply convert this uploaded code to IEC Ladder.
If there are comments in the PLC, you need DOS MEDOC or GX Developer to upload the
name list from the PLC and follow the procedures outlined on point 4.1 or 4.2.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
7/57

5 Import of programs and name lists


5.1 Import of DOS MEDOC programs and name lists
5.1.1 Preparing the print file for DOS MEDOC
Start the application DOS MEDOC and open the project.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
8/57

Select the function Print.

Select the menu Options Output.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
9/57

In the menu Header select the option Print without header and in the menu Listings select
only Name and Instr.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
10/57

Then select Go and follow the instructions.

Now you have generated the printout file TEST.TMP.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
11/57

5.1.2 Import the print file to GX IEC Developer V6.0 or later


Start the application GX IEC Developer.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
12/57

Open a new project.

Select the PLC type.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
13/57

In the project wizard select MELSEC IL.


If a later requirement is to add some more IEC POUs then select the item Empty
Project and create a new MELSEC IL POU.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
14/57

Highlight the box containing MELSEC (move the mouse pointer above this square and press
the left-hand mouse button). This is important!

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
15/57

Now open the menu Tools and select Import MEDOC Network.

In the Windows dialog select the created print file and press Open.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
16/57

From the dialog choose whether to import the MEDOC program or the MEDOC symbolic
names, or both.

The import of the program and the symbolic names is now finished. GVL, HEADER and
MELSEC IL PROGRAM have been imported. The comments of the program are now
available, too.

Now jump to Chapter 6, to convert the project to IEC Ladder.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
17/57

5.2 Import of GX Developer programs and name lists


5.2.1 Installing the GX Converter
GX Developer has no standard export function for programs and name lists. So to export a
program first install GX Converter that can be found on the MELSOFT CD.
Start the installation routine for the GX Developer again and select Q Utilities and then GX
Converter.

Follow the instructions of the installer.


Now the export function for GX Developer will have been installed.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
18/57

5.2.2 Export of a GX Developer program


5.2.2.1 Export of a GX Developer program (without label programming)
Start GX Developer and open the project to be converted.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
19/57

Select Project - Export file and then Export to TEXT.CSV format file.

Under Export file type select Text File and press Finish. If the project is a PLC type that
uses several programs, e.g. System Q, please do the export and import routine, program-byprogram.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
20/57

Select the desired path and press OK.

Now start GX IEC Developer.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
21/57

Open a new project.

Select the PLC type.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
22/57

In the project wizard select the item MELSEC IL.


If a later requirement is to add some more IEC POUs then select the item Empty
Project and create a new MELSEC IL POU.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
23/57

Highlight the box containing MELSEC (move the mouse pointer above this square and press
the left-hand mouse button). This is important!

Now open the menu Tools and select Import GX Developer Network.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
24/57

In the Windows dialog select Text file and press Open.

The program has now been imported to GX IEC Developer.

Now jump to section 5.2.3 for the import of the name list or to section 6, to change the project
to IEC Ladder.

5.2.2.2 Export of a GX Developer program with label programming


GX Converter does not work with label programs but it is possible to download the project to
a PLC and make an upload to GX IEC Developer.
Function Blocks in GX Developer are used as MACRO CODE.
This means the code of the function block is expanded and the Input and Output variables
are used with their direct address. In the downloaded program the structure of the FB is
missing. It is possible to get the name list.
For the upload from a PLC see the corresponding chapter.
For the import of the name list see the corresponding chapter.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
25/57

5.2.3 Export of a GX Developer name list


5.2.3.1 Export of a GX Developer name list with MX Change
5.2.3.1.1 Installation of MX Change
MX Change is a common database for MELSOFT products. MX Change includes a Super
Project Manager. This tool allows the exchange of the name list between GX Developer and
GX IEC Developer.
First step is to start the Server.

Now minimise the following dialogue box.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
26/57

After this open GX Developer and the selected project.


By using the menu option Export file - Export to MX Change tags, export the name list.

Now select the address under which the server is installed. In this case use local address.
NOTE:
For more detailed information read the MX Change manual or use the program help.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
27/57

Here, select which comment file is to be exported to the MX Change database.

If there is no Node in the MX Change database, it will be added automatically.

Now the information is stored in the MX Change database.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
28/57

5.2.3.1.2 The Super Project Manager


Start the Super Project Manager.

Log into the Server database.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
29/57

The Super Project Manager displays all information exported from GX Developer.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
30/57

5.2.3.1.3 Connect GX IEC Developer to the Super Project Manager.


Open an empty GX IEC Developer project, or maybe the project used for the imported
GX Developer program, and select Project MXChange Database Actions Open to
enable MX Change.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
31/57

Log in to the server address. Normally this is the local address.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
32/57

After having logged in a new node is seen in the Super project manager.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
33/57

Click with the right-hand mouse button to access the menu option Group Copy and Rename
Tags. Here, all variables can be copied from one node to another.

In GX IEC Developer select Project MXChange Prompt Actions Global Adjust.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
34/57

Select MX Change database and press OK.

These variables can now be found in the GVL.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
35/57

5.2.3.2 Export of a GX Developer name list without Label programming to EXCEL


Open GX Developer project and select the menu option Export to TEXT.CSV format file.

Select Common comment and CSV File. If the project is a PLC type that uses several
programs, e.g. System Q, please do the export and import routine, program-by-program.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
36/57

Select the desired path and press OK.

Now start Microsoft EXCEL 2000 or later and open the EXCEL sheet
Converter_for_GX_Developer.XLS. This sheet is needed to add a macro to the EXCEL
project, which is used to generate the ASC import file for the import into GX IEC Developer.
Select Enable Macros.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
37/57

Now open the GX Developer exported CSV file in EXCEL.

Press the keys CTRL A and the macro ASC Converter is started. Press Create ASC and the
file C:\MMP.ASC will be generated.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
38/57

This file MMP.ASC on the C: drive, can now be imported to the GX IEC Developer project.
Open GX IEC Developer project and select Project Other Import.

Select the path C:\MMP.ASC and press Open.

Now the name list from GX Developer has been imported into GX IEC Developer.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
39/57

5.2.3.3 Export of a GX Developer name list with Label


In the GX Developer project the Global Variables look like this.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
40/57

This information is stored in the folder Project Name. (Here the project name is Test and so
the path is: Test/Resource/POU/ Body/LABELTBL.wcf).
The file name is always the same (LABELTBL.wcf).

Open this file in Microsoft Notepad or another text editor and mark all entries following
CONFIGURATION Project Name (here Test) and in front of END-CONFIGURATION.
Copy this marked string into the clipboard (CTRL C).

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
41/57

Using another text editor than Microsoft Notepad makes this easier.

Now open the Global Variable list in the GX IEC Developer project and mark the first line in
the GVL.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
42/57

Copy the content of the clipboard into the GVL (CTRL V).

The name list from GX Developer has now been copied into GX IEC Developer.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
43/57

5.3 Upload of a PLC program


For FX and A PLCs simply upload the programs from the PLC.
For Q and System Q PLCs this procedure is the same if a single program file has been used.
If multiple program files have been used, then follow the procedure in 5.3.1.
5.3.1 How to upload several programs from Q and System Q
If the Q or System Q PLC contains multiple programs, then these must be uploaded into GX
Developer and then follow the description for exporting from GX Developer and importing into
GX IEC Developer, for each program, as outlined in section 5.2.2.
5.3.2 How to upload a Comment file from a PLC
If the PLC has stored comment files (name list), upload the comment file to DOS MEDOC or
GX Developer and follow the description for importing the name lists, as outlined in 5.2.3.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
44/57

6 The MELSEC IL to IEC Ladder Conversion Utility


6.1 General Rules for the Conversion
All symbolic variables in the POU Body and header will remain unchanged and the GVL will
be copied to the output file. By activating the option Replace all direct addresses with
global variable names, the direct addresses used in MELSEC IL are replaced by global
variables, if available in the GVL before exporting to the converter.
The Converter splits the MELSEC IL POU to several networks, if appropriate. This means,
that for each Ladder rung, a separate network will be inserted. In the options, a maximum
number of networks can be defined at which the POU will be split.
Subsequent POUs will be added to the same task directly below the current POU.
Labels are converted to the GX IEC Developer syntax. E.g. P100 will be converted to P_100,
which is the equivalent pointer address.
If a FEND instruction is found, a jump to the end of the POU will be inserted.
As a destination, the automatically created network label LBL_FEND will be used.
In case of split POUs, the destination network label will be skipped and the GX IEC
Developer compiler will produce an error. In this case, the user has to find an unused direct
label (e.g. P_150), which can be used for a jump to another POU.
Instructions like OR, AND, ORB, ANB, etc. will be represented by graphical arrangements.
Example:

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
45/57

Each LOAD (definition see section 6.1.1.1) implements a new network, if it is not combined
with the previous element-chain by ANB or ORB.

MPS, MPP and MPR constructs will be converted to a graphical ladder correspondence like
in GX Developer. An OR/ORI Instruction following an MPP or MRD is not convertible since
this would result in crossing lines! The following example shows the MELSEC IL code
containing MPS, MPP and MPR instructions and the corresponding IEC Ladder result:

This behaviour can be changed by setting the option Behaviour of MPS, MPP & MRD to
Use MLIB functions MPS_E, MPP_E & MRD_E. In this case, all MPS, MPP and MRD
instructions are represented by their corresponding MLIB-function.
All functions will be converted to the corresponding manufacturer library functions for the
used PLC type. If a function is invalid or not listed in the MLIB, it will be handled as an illegal
instruction.
NOTE:
Dedicated instructions are supported.
Dedicated Instructions for A-Series PLC using LEDA, LEDB, LEDC, LEDR, SUB and DXNR,
will be converted to the corresponding IEC Ladder instruction.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
46/57

In case of illegal instructions, a comment will be inserted, which contains the illegal
Instructions, as original MELSEC IL code. Furthermore, an invalid FB (FB-name
INVALID_CODE) will be inserted to generate a compiler error at the invalid section when
compiling the converted program.
The instruction NOP will be ignored. In case of an END instruction followed by program code,
the user will be asked if the listed instructions have to be ignored or converted. For the last
case, END will be ignored.
The arrangement of elements is the same as in the guided editor mode.
Interrupt labels are added as an additional task with the interrupt label as Event.
For all occurrences of the same interrupt label, an additional POU is added to that Task.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
47/57

6.1.1 Summary of conversion rules


The conversion rules are based on the different classes of MELSEC IL instructions:
6.1.1.1 Definitions
Instruction class Description
LOAD
load instructions
(MPP, MRD, LD, LDI, LDP, LDF, LD=, LD>, LD<, LD>=, LD<=, LD<>,
LDD=, LDD>, LDD<, LDD>=, LDD<=, LDD<>, LDE=, LDE>, LDE<,
LDE>=, LDE<=, LDE<>, LD$=, LD$>, LD$<, LD$>=, LD$<=, LD$<>)
CONTACT
AND, ANI, OR, ORI
COIL
OUT, SET, RST
FUNCTION
MIL FUNCTION including MPS, except functions listed in LOAD
CJUMP
conditional jump or call (CJ, CALL)
JUMP
unconditional jump (JMP)
RETURN
return (RET)
COMMENT
comments (* ... *)
CONNECTION
ORB, ANB
LABEL
program labels (e.g. P100)
FEND
FEND Instruction

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
48/57

6.1.1.2 Conversion rules


The following table shows the handling for the different instruction classes and the valid
successors. E.g. for the first instruction, a new network is created. This means, that the only
valid instructions at the beginning of a new network are LOAD and JUMP instructions. For a
following LOAD, the LOAD instruction will be connected to the power rail. In case of a
following CONTACT, see current instruction LOAD and successor CONTACT.
Comments are not listed here since they are valid at any position in the instruction list.
Current
instruction
new network

Valid
successors
LOAD
JUMP

Action / description
invoked by LOAD, JUMP and LABEL
attach LOAD instruction to the power rail
attach JUMP instruction to the power rail

LOAD
CONTACT
COIL
FUNCTION
LOAD
CJUMP

AND, ANI: add CONTACT in row


OR, ORI: add parallel contact connected to the
attach COIL
attach FUNCTION
add LOAD to new network
attach CJUMP

CONTACT
CONTACT
COIL
FUNCTION
LOAD
CJUMP

AND, ANI: add CONTACT in row


OR, ORI: add parallel contact connected to the
attach COIL
attach FUNCTION
add LOAD to new network
attach CJUMP

COIL
LOAD
CJUMP
LABEL
FEND

attach COIL to the input of the current COIL


add LOAD to new network
attach CJUMP to the input of the current COIL
create new network with symbolic label
all following instructions must be assigned to a label

CONTACT
COIL
FUNCTION
LOAD
CJUMP
LABEL
FEND

attach CONTACT to ENO


attach COIL to ENO
attach FUNCTION to ENO
add LOAD to new network
attach CJUMP
create new network with symbolic label
all following instructions must be assigned to a label

COIL

FUNCTION

CJUMP
Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
49/57

Current
instruction

Valid
successors
COIL
LOAD
CJUMP
LABEL
FEND

JUMP
LOAD
LABEL
FEND
RETURN
LOAD
LABEL
FEND
LABEL
LOAD
JUMP
FEND
LABEL
CONNECTION

Action / description
attach COIL to the input of the current CJUMP
add LOAD to new network
attach CJUMP to the input of the current CJUMP
create new network with symbolic label
all following instructions must be assigned to a label
occupies a single line in a single network
add LOAD to new network
create new network with symbolic label
all following instructions must be assigned to a label
occupies a single line in a single network
add LOAD to new network
create new network with symbolic label
all following instructions must be assigned to a label
create new network with symbolic label
attach LOAD instruction to the power rail
attach JUMP instruction to the power rail
all following instructions must be assigned to a label
see instruction LABEL
ANB: connect current network in a row with the
previous
ORB: connect current network parallel to the previous

same as LOAD

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
50/57

6.2 Using the MELSEC IL to IEC Ladder Conversion Utility


6.2.1 ASCII Export from GX IEC Developer
Start GX IEC Developer, open the GX IEC Developer project and select the menu item
Project Other Export.
In the opened dialog Export to file you can select or input a desired path and file name for
the export to the ASCII file. The file type ASCII Export (.asc) is selected automatically.
To start the export just press Save. The ASCII file is stored automatically.
6.2.2 Conversion from IL to LADDER
Start the MELSEC IL to IEC Ladder Conversion Utility. The following dialog will be shown.

Select the in the exported GX IEC Developer project used PLC series and PLC type in the
dropdown menus PLC Series and PLC Type.
Under Active Manufacturer library select the valid path of the required MLIB. In the
dropdown menu all manufacturer libraries on your computer are listed.
The ASCII file exported from GX IEC Developer is the input file for the conversion and has to
be entered in the edit field MELSEC IL Input File. The desired path can be searched by
using the browse button to open the browser dialog.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
51/57

The path and file name for the output file after the conversion can be entered in the edit field
Ladder Output File. The desired path can be searched by using the browse button to open
the browser dialog.
By pressing the button Options the following options dialog can be opened.

In this dialog several options for the conversion process can be set.
The right default column for placement of the last element in the row can be set by the option
Right default border. If more space is needed this setting will be ignored.
When the option Automatically create new POU is activated, the converter will split the
single Ladder POUs automatically after the set number of networks.
The placement of functions and function blocks can be set by the option Placement of
Functions and Function Blocks:
Parallel: consecutively called functions in MIL are placed parallel in Ladder editor
Serial: consecutively called functions in MIL are placed in a row in Ladder editor

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
52/57

Under the option Behaviour of MPS, MPP & MRD the user can decide how MPS, MPP and
MRD instructions will be treated during conversion:
Create graphical representation: MPS, MPP and MRD instructions are placed as their
graphical representation as in GX Developer.
Use MLIB functions MPS_E, MPP_E & MRD_E: MPS, MPP and MRD instructions are
placed as their counterpart function MPS_E, MPP_E and MRD_E to get a maximum code
compatibility.
When the option Replace all direct addresses with global variable names is activated, the
MELSEC IL to IEC Ladder Conversion Utility scans the GVL for all global variables. If a
global variable matches the device type (or compatible) and address, during conversion the
address will be replaced by its global variable.
By activating the option Automatically create new & global variable..., the MELSEC IL to
IEC Ladder Conversion Utility automatically creates global variables for data types that are
unusable with direct addresses in the Ladder Editor.
If an input variable of a function with e.g. data type DINT and the assigned address D0 is
found, a new global variable VAR_D0 will be created as replacement of D0.
The option Automatically create new POU and Task for interrupt label lets the MELSEC
IL to IEC Ladder Conversion Utility create a new POU and a corresponding Task for each
interrupt label subprogram.
When the option Use multiple line variable names is activated, the MELSEC IL to IEC
Ladder Conversion Utility adds a flag to all elements that allows the full display of a multiple
line variable name.
By pressing OK the user accepts the changes made in the options settings.
Otherwise press Cancel to discard all changes made.
To start the conversion, press the button Convert in the main dialog box.
There is no message shown during the conversion process.
Only the new ASCII file is written to the set output path and file name.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
53/57

6.2.3 Import of the converted ASCII file


The converted file can now be imported to GX IEC Developer.
Start GX IEC Developer, open a new project and select the converted project file used PLC
type.
In the project wizard select Empty Project.
If a later requirement is to add some more IEC POUs then select the item Empty
Project and create a new MELSEC IL POU.
Select the menu item Project Other Import.
The converted ASCII file can be selected in the dialog Import from file.
Press the button Open to start the import.
NOTE:
For further information about the export and import function of GX IEC Developer and other
details please read the users manual for GX IEC Developer.
The imported project now can be edited.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
54/57

6.3 Limitations
In the following section details some limitations concerning the use of the MELSEC IL to IEC
Ladder Conversion Utility.
The MELSEC IL to IEC Ladder Conversion Utility can only be used in connection with a
version GX IEC Developer 6.00 or later.
Converting GX Developer programs with labels
Import of GX Developer system Q label programs is not possible because GX Developer
does not supports export functionality for this program type.
The only possible way is to upload the project from the PLC without comments and variable
names. The global variables can be copied with Excel (see section 5.2).
MPS followed by OR/ORI
An OR/ORI Instruction following an MPP or MRD instruction is not convertible since this
would result in crossing lines.
Labels
Jumps to Labels within other POUs than the current will be supported by GX IEC Developer
6.10 and later and only for direct labels.
Index registers
The MELSEC IL to IEC Ladder Conversion Utility generates a symbolic variable in the GVL
for devices that are assigned to functions or function blocks for a 32Bit input/output variable.
Devices with index registers like D0Z0 in the GVL will be supported by GX IEC Developer
6.10 and later. For previous versions, the GX IEC Developer compiler will generate an error.
Unconvertible functions
For conversion it is necessary that the MELSEC IL function has an equivalent function for
IEC Ladder in the Manufacturer Library. Therefore, even if the code is compilable in MELSEC
IL, it might be, that the function is added as unconvertible code to the LADDER POU
because it is not supported in the IEC Ladder editor.
In this case the user should check if the same functionality can be achieved by using one or
more different functions or by creating a MELSEC-IL Function Block containing the
unconvertible function. This Function Block can then be used to replace the unconvertible
function in LADDER.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
55/57

6.4 Hints and Tips


When importing projects from GX Developer or from DOS MEDOC as Melsec IL POUs, into
GX IEC Developer, certain compiler messages may be produced, under certain
circumstances.
System Variable Conflicts
The devices used by the original project, may conflict with the default System Variable area
of the new GX IEC Developer project.
If this is the case then the compiler will produce the following error

Error F1028 Access to system address denied, indicates that the original project is using
devices, reserved by default for System Variables in GX IEC Developer.
To rectify this, simply access Extras Options System Variables and reallocate the
System Variables to an area not used by the project.
A list of devices used can be seen in the original project in either GX Developer or
DOS MEDOC.
Parameter Errors
Some conflicts may occur because the new project created in GX IEC Developer contains
default settings for PLC Parameters and the original project may have contained specific
parameters set by the user.
The compiler will generate various errors associated with this issue, an example is shown
below.

Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
56/57

Error Fo137 Illegal device used or symbol not valid, indicates that the original project is
using devices outside of the default device range in PLC Parameters.
This can be rectified, simply by modifying the new project parameters, in line with original
project.
Naming Conventions
Both GX Developer and DOS MEDOC will allow naming conventions, which contravene IEC
programming rules.
Generally, if the name begins with a digit, then this will not be allowed by the compiler.

Error C5043 Invalid name relates in this example to the identifier 0_5_SEC_PULSE which
can simply be renamed, ie HALF_SEC_PULSE.
Written by:
Thomas Lantermann
Last Changed by: Chris Evans MEU-UK
Customer Technology Centre

Date:
Date:
Page:

17.09.2003
26.04.2004
57/57

You might also like