Top Banner

of 57

1009en Ladder Converter GB

Jun 02, 2018

Download

Documents

aldoalvarez13
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/10/2019 1009en Ladder Converter GB

    1/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 1/57

    MELSEC IL to IEC LadderConversion Utility

    Customer Information Sheet

  • 8/10/2019 1009en Ladder Converter GB

    2/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 2/57

    1 Table of Content

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

    2 History ...............................................................................................................................................3

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

    3.1 GX Developer Projects .......................................................................................................................53.2 DOS MEDOC Projects .......................................................................................................................6

    4 Requirements....................................................................................................................................7

    4.1 For DOS MEDOC programs...............................................................................................................74.2 For GX Developer programs ..............................................................................................................74.3 For PLC Upload..................................................................................................................................7

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

    5.1 Import of DOS MEDOC programs and name lists..............................................................................85.1.1 Preparing the print file for DOS MEDOC............................................................................................85.1.2 Import the print file to GX IEC Developer V6.0 or later ....................................................................12

    5.2 Import of GX Developer programs and name lists ...........................................................................185.2.1 Installing the GX Converter ..............................................................................................................185.2.2 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 ............................................255.2.3 Export of a GX Developer name list .................................................................................................265.2.3.1 Export of a GX Developer name list with MX Change ......................................................265.2.3.2 Export of a GX Developer name list without Label programming to EXCEL ....................365.2.3.3 Export of a GX Developer name list with Label ................................................................40

    5.3 Upload of a PLC program.................................................................................................................445.3.1 How to upload several programs from Q and System Q..................................................................445.3.2 How to upload a Comment file from a PLC ......................................................................................44

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

    6.1 General Rules for the Conversion ....................................................................................................456.1.1 Summary of conversion rules...........................................................................................................48

    6.1.1.1 Definitions .........................................................................................................................48

    6.1.1.2 Conversion rules ...............................................................................................................496.2 Using the MELSEC IL to IEC Ladder Conversion Utility ..................................................................516.2.1 ASCII Export from GX IEC Developer..............................................................................................516.2.2 Conversion from IL to LADDER........................................................................................................516.2.3 Import of the converted ASCII file.....................................................................................................54

    6.3 Limitations ........................................................................................................................................556.4 Hints and Tips...................................................................................................................................56

  • 8/10/2019 1009en Ladder Converter GB

    3/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 3/57

    2 History

    Date Version Author Description

    16.09.2003 V0.0 Th. Lantermann First version26.04.2004 V1.0 E Chris Evans English Version

  • 8/10/2019 1009en Ladder Converter GB

    4/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 4/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 ILPOUs 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 IECDeveloper as a MELSEC IL POU.In a similar way, a MEDOC project can be exported as an *.TMP file (print file) and thenimported to GX IEC Developer as a MELSEC IL POU.

    The converter then converts the ASCII file export of these files and then allows this convertedfile 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, alongwith 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!

  • 8/10/2019 1009en Ladder Converter GB

    5/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 5/57

    3.1 GX Developer Projects

    Ladder Program Name List

    GX Developer

    Section 5.2.2

    Section 5.2.3.2 Section 5.2.3.1

    Excel 2000 MX Change

    Melsec IL to Ladder Converter

    Section 6

    GX IEC Developer

    GX IEC Developer

  • 8/10/2019 1009en Ladder Converter GB

    6/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 6/57

    3.2 DOS MEDOC Projects

    Ladder Program Name List

    DOS MEDOC

    Section 5.1

    Melsec IL to Ladder Converter

    Section 6

    GX IEC Developer

    GX IEC Developer

    Print File (*.TMP)

  • 8/10/2019 1009en Ladder Converter GB

    7/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 7/57

    4 Requirements

    4.1 For DOS MEDOC programs

    The requirement is simply a print file (*.TMP) of the name list and program, no additionaltools 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 toGX IEC Developer.If the program has used labels then only an editor is needed to import the name list. But it isalso 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 thename list from the PLC and follow the procedures outlined on point 4.1 or 4.2.

  • 8/10/2019 1009en Ladder Converter GB

    8/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 8/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.

  • 8/10/2019 1009en Ladder Converter GB

    9/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 9/57

    Select the functionPrint.

    Select the menuOptions Output.

  • 8/10/2019 1009en Ladder Converter GB

    10/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 10/57

    In the menuHeaderselect the optionPrint without header and in the menuListingsselectonlyNameand Instr.

  • 8/10/2019 1009en Ladder Converter GB

    11/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 11/57

    Then selectGo and follow the instructions.

    Now you have generated the printout file TEST.TMP.

  • 8/10/2019 1009en Ladder Converter GB

    12/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 12/57

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

    Start the application GX IEC Developer.

  • 8/10/2019 1009en Ladder Converter GB

    13/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 13/57

    Open a new project.

    Select the PLC type.

  • 8/10/2019 1009en Ladder Converter GB

    14/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 14/57

    In the project wizard selectMELSEC IL.If a later requirement is to add some more IEC POUs then select the item EmptyProjectand create a new MELSEC IL POU.

  • 8/10/2019 1009en Ladder Converter GB

    15/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 15/57

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

  • 8/10/2019 1009en Ladder Converter GB

    16/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 16/57

    Now open the menuToolsand selectImport MEDOC Network.

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

  • 8/10/2019 1009en Ladder Converter GB

    17/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 17/57

    From the dialog choose whether to import theMEDOC programor theMEDOC symbolicnames, or both.

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

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

  • 8/10/2019 1009en Ladder Converter GB

    18/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 18/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 aprogram first install GX Converter that can be found on the MELSOFT CD.

    Start the installation routine for the GX Developer again and select Q Utilitiesand thenGXConverter.

    Follow the instructions of the installer.Now the export function for GX Developer will have been installed.

  • 8/10/2019 1009en Ladder Converter GB

    19/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 19/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.

  • 8/10/2019 1009en Ladder Converter GB

    20/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 20/57

    SelectProject- Export fileand thenExport to TEXT.CSV format file.

    UnderExport file typeselectText Fileand press Finish. If the project is a PLC type thatuses several programs, e.g. System Q, please do the export and import routine, program-by-program.

  • 8/10/2019 1009en Ladder Converter GB

    21/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 21/57

    Select the desired path and pressOK.

    Now start GX IEC Developer.

  • 8/10/2019 1009en Ladder Converter GB

    22/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 22/57

    Open a new project.

    Select the PLC type.

  • 8/10/2019 1009en Ladder Converter GB

    23/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 23/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 EmptyProjectand create a new MELSEC IL POU.

  • 8/10/2019 1009en Ladder Converter GB

    24/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 24/57

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

    Now open the menuToolsand selectImport GX Developer Network.

  • 8/10/2019 1009en Ladder Converter GB

    25/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 25/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 projectto 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 toa 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 variablesare used with their direct address. In the downloaded program the structure of the FB ismissing. 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.

  • 8/10/2019 1009en Ladder Converter GB

    26/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 26/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 SuperProject Manager. This tool allows the exchange of the name list between GX Developer andGX IEC Developer.

    First step is to start the Server.

    Now minimise the following dialogue box.

  • 8/10/2019 1009en Ladder Converter GB

    27/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 27/57

    After this open GX Developer and the selected project.By using the menu optionExport 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.

  • 8/10/2019 1009en Ladder Converter GB

    28/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 28/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.

  • 8/10/2019 1009en Ladder Converter GB

    29/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 29/57

    5.2.3.1.2 The Super Project Manager

    Start the Super Project Manager.

    Log into the Server database.

  • 8/10/2019 1009en Ladder Converter GB

    30/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 30/57

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

  • 8/10/2019 1009en Ladder Converter GB

    31/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 31/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 importedGX Developer program, and select Project MXChange Database Actions Opentoenable MX Change.

  • 8/10/2019 1009en Ladder Converter GB

    32/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 32/57

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

  • 8/10/2019 1009en Ladder Converter GB

    33/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 33/57

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

  • 8/10/2019 1009en Ladder Converter GB

    34/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 34/57

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

    In GX IEC Developer selectProject MXChange Prompt Actions Global Adjust.

  • 8/10/2019 1009en Ladder Converter GB

    35/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 35/57

    SelectMX Change databaseand pressOK.

    These variables can now be found in the GVL.

  • 8/10/2019 1009en Ladder Converter GB

    36/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 36/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.

    SelectCommon commentand CSV File. If the project is a PLC type that uses severalprograms, e.g. System Q, please do the export and import routine, program-by-program.

  • 8/10/2019 1009en Ladder Converter GB

    37/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 37/57

    Select the desired path and pressOK.

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

  • 8/10/2019 1009en Ladder Converter GB

    38/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 38/57

    Now open the GX Developer exported CSV file in EXCEL.

    Press the keys CTRL A and the macroASC Converteris started. Press Create ASCand thefile C:\MMP.ASC will be generated.

  • 8/10/2019 1009en Ladder Converter GB

    39/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 39/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 pressOpen.

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

  • 8/10/2019 1009en Ladder Converter GB

    40/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 40/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.

  • 8/10/2019 1009en Ladder Converter GB

    41/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 41/57

    This information is stored in the folder Project Name. (Here the project name isTestand sothe 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

    CONFIGURATIONProject Name(hereTest) and in front of END-CONFIGURATION.Copy this marked string into the clipboard (CTRL C).

  • 8/10/2019 1009en Ladder Converter GB

    42/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 42/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 inthe GVL.

  • 8/10/2019 1009en Ladder Converter GB

    43/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 43/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.

  • 8/10/2019 1009en Ladder Converter GB

    44/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 44/57

    5.3 Upload of a PLC programFor 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 fromQ and SystemQ

    If the Q or System Q PLC contains multiple programs, then these must be uploaded into GXDeveloper and then follow the description for exporting from GX Developer and importing intoGX 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 orGX Developer and follow the description for importing the name lists, as outlined in 5.2.3.

  • 8/10/2019 1009en Ladder Converter GB

    45/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 45/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 willbe copied to the output file. By activating the option Replace all direct addresses withglobal variable names, the direct addresses used in MELSEC IL are replaced by globalvariables, 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 maximumnumber 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 IECDeveloper 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:

  • 8/10/2019 1009en Ladder Converter GB

    46/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 46/57

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

    MPS, MPP and MPR constructs will be converted to a graphical ladder correspondence likein GX Developer. An OR/ORI Instruction following an MPP or MRD is not convertible sincethis would result in crossing lines! The following example shows the MELSEC IL codecontaining 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 toUse MLIB functions MPS_E, MPP_E & MRD_E. In this case, all MPS, MPP and MRDinstructions are represented by their corresponding MLIB-function.

    All functions will be converted to the corresponding manufacturer library functions for theused PLC type. If a function is invalid or not listed in the MLIB, it will be handled as an illegalinstruction.

    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.

  • 8/10/2019 1009en Ladder Converter GB

    47/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 47/57

    In case of illegal instructions, a comment will be inserted, which contains the illegalInstructions, as original MELSEC IL code. Furthermore, an invalid FB (FB-nameINVALID_CODE) will be inserted to generate a compiler error at the invalid section whencompiling 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 lastcase, 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.

  • 8/10/2019 1009en Ladder Converter GB

    48/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 48/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, LDD=, LDD, LDE=, LDE, LD$=, LD$

  • 8/10/2019 1009en Ladder Converter GB

    49/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 49/57

    6.1.1.2 Conversion rules

    The following table shows the handling for the different instruction classes and the validsuccessors. E.g. for the first instruction, a new network is created. This means, that the onlyvalid instructions at the beginning of a new network are LOAD and JUMP instructions. For afollowing LOAD, the LOAD instruction will be connected to the power rail. In case of afollowing 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

    Valid

    successors

    Action/description

    new network invoked by LOAD, JUMP and LABELLOAD attach LOAD instruction to the power railJUMP attach JUMP instruction to the power rail

    LOAD

    CONTACT AND, ANI: add CONTACT in rowOR, ORI: add parallel contact connected to the

    COIL attach COILFUNCTION attach FUNCTIONLOAD add LOAD to new networkCJUMP attach CJUMP

    CONTACTCONTACT AND, ANI: add CONTACT in row

    OR, ORI: add parallel contact connected to theCOIL attach COILFUNCTION attach FUNCTIONLOAD add LOAD to new networkCJUMP attach CJUMP

    COILCOIL attach COIL to the input of the current COILLOAD add LOAD to new network

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

    FUNCTIONCONTACT attach CONTACT to ENOCOIL attach COIL to ENOFUNCTION attach FUNCTION to ENOLOAD add LOAD to new networkCJUMP attach CJUMPLABEL create new network with symbolic label

    FEND all following instructions must be assigned to a labelCJUMP

  • 8/10/2019 1009en Ladder Converter GB

    50/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 50/57

    Currentinstruction Validsuccessors Action/description

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

    JUMP occupies a single line in a single networkLOAD add LOAD to new networkLABEL create new network with symbolic labelFEND all following instructions must be assigned to a label

    RETURN occupies a single line in a single networkLOAD add LOAD to new networkLABEL create new network with symbolic labelFEND all following instructions must be assigned to a label

    LABEL create new network with symbolic labelLOAD attach LOAD instruction to the power railJUMP attach JUMP instruction to the power rail

    FEND all following instructions must be assigned to a labelLABEL see instructionLABEL

    CONNECTION ANB: connect current network in a row with the

    previousORB: connect current network parallel to the previous

    same asLOAD

  • 8/10/2019 1009en Ladder Converter GB

    51/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 51/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 itemProject Other Export.

    In the opened dialogExport to fileyou can select or input a desired path and file name forthe 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 thedropdown menusPLC Seriesand PLC Type.

    UnderActive Manufacturer libraryselect the valid path of the required MLIB. In thedropdown 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 tobe entered in the edit fieldMELSEC IL Input File. The desired path can be searched byusing the browse button to open the browser dialog.

  • 8/10/2019 1009en Ladder Converter GB

    52/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 52/57

    The path and file name for the output file after the conversion can be entered in the edit fieldLadder Output File. The desired path can be searched by using the browse button to openthe browser dialog.

    By pressing the buttonOptionsthe 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 optionRight default border. If more space is needed this setting will be ignored.

    When the optionAutomatically create new POU is activated, the converter will split thesingle Ladder POUs automatically after the set number of networks.

    The placement of functions and function blocks can be set by the optionPlacement ofFunctions and FunctionBlocks:Parallel: consecutively called functions in MIL are placed parallel in Ladder editorSerial: consecutively called functions in MIL are placed in a row in Ladder editor

  • 8/10/2019 1009en Ladder Converter GB

    53/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 53/57

    Under the optionBehaviour of MPS,MPP & MRD the user can decide how MPS, MPP andMRD instructions will be treated during conversion:Create graphical representation: MPS, MPP and MRD instructions are placed as theirgraphical representation as in GX Developer.Use MLIBfunctions MPS_E,MPP_E& MRD_E: MPS, MPP and MRD instructions areplaced as their counterpart function MPS_E, MPP_E and MRD_E to get a maximum codecompatibility.

    When the optionReplace all direct addresses with global variable names is activated, theMELSEC IL to IEC Ladder Conversion Utility scans the GVL for all global variables. If aglobal variable matches the device type (or compatible) and address, during conversion the

    address will be replaced by its global variable.

    By activating the optionAutomatically create new & global variable..., the MELSEC IL toIEC Ladder Conversion Utility automatically creates global variables for data types that areunusable 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 isfound, a new global variable VAR_D0 will be created as replacement of D0.

    The optionAutomatically create new POU and Taskfor interrupt labellets the MELSECIL to IEC Ladder Conversion Utility create a new POU and a corresponding Task for eachinterrupt label subprogram.

    When the optionUse multiple line variable names is activated, the MELSEC IL to IECLadder Conversion Utility adds a flag to all elements that allows the full display of a multipleline variable name.

    By pressingOKthe user accepts the changes made in the options settings.Otherwise pressCancelto discard all changes made.

    To start the conversion, press the buttonConvertin 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.

  • 8/10/2019 1009en Ladder Converter GB

    54/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 54/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 PLCtype.

    In the project wizard selectEmpty Project.If a later requirement is to add some more IEC POUs then select the item EmptyProjectand create a new MELSEC IL POU.

    Select the menu itemProject Other Import.

    The converted ASCII file can be selected in the dialog Import from file.Press the buttonOpento start the import.

    NOTE:For further information about the export and import function of GX IEC Developer and otherdetails please read the users manual for GX IEC Developer.

    The imported project now can be edited.

  • 8/10/2019 1009en Ladder Converter GB

    55/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 55/57

    6.3 LimitationsIn the following section details some limitations concerning the use of the MELSEC IL to IECLadder Conversion Utility.

    The MELSEC IL to IEC Ladder Conversion Utility can only be used in connection with aversion GX IEC Developer 6.00 or later.

    Converting GX Developer programs with labelsImport of GX Developer system Q label programs is not possible because GX Developerdoes not supports export functionality for this program type.

    The only possible way is to upload the project from the PLC without comments and variablenames. The global variables can be copied with Excel (see section 5.2).

    MPS followed by OR/ORIAn OR/ORI Instruction following an MPP or MRD instruction is not convertible since thiswould result in crossing lines.

    LabelsJumps to Labels within other POUs than the current will be supported by GX IEC Developer6.10 and later and only for direct labels.

    IndexregistersThe MELSEC IL to IEC Ladder Conversion Utility generates a symbolic variable in the GVLfor 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 Developer6.10 and later. For previous versions, the GX IEC Developer compiler will generate an error.

    Unconvertible functionsFor conversion it is necessary that the MELSEC IL function has an equivalent function forIEC Ladder in the Manufacturer Library. Therefore, even if the code is compilable in MELSECIL, it might be, that the function is added as unconvertible code to the LADDER POUbecause 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 ormore different functions or by creating a MELSEC-IL Function Block containing theunconvertible function. This Function Block can then be used to replace the unconvertiblefunction in LADDER.

  • 8/10/2019 1009en Ladder Converter GB

    56/57

    Written by: Thomas Lantermann Date: 17.09.2003Last Changed by: Chris Evans MEU-UK Date: 26.04.2004Customer Technology Centre Page: 56/57

    6.4 Hints and TipsWhen importing projects from GX Developer or from DOS MEDOC as Melsec IL POUs, intoGX IEC Developer, certain compiler messages may be produced, under certaincircumstances.

    System Variable Conflicts

    The devices used by the original project, may conflict with the default System Variable areaof 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 usingdevices, reserved by default for System Variables in GX IEC Developer.To rectify this, simply accessExtras Options System Variablesand reallocate theSystem 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 orDOS MEDOC.

    Parameter Errors

    Some conflicts may occur because the new project created in GX IEC Developer containsdefault settings for PLC Parameters and the original project may have contained specificparameters set by the user.The compiler will generate various errors associated with this issue, an example is shownbelow.

  • 8/10/2019 1009en Ladder Converter GB

    57/57

    Error Fo137 Illegal device used or symbol not valid, indicates that the original project isusing devices outside of the default device range in PLC Parameters.This can be rectified, simply by modifying the new project parameters, in line with originalproject.

    Naming Conventions

    Both GX Developer and DOS MEDOC will allow naming conventions, which contravene IECprogramming rules.Generally, if the name begins with a digit, then this will not be allowed by the compiler.