Home
GX IEC Developer Version7 Beginner`s Manual
Contents
1. 3 The New Project dialogue box is displayed Select or enter the path under which you wish to store the new project 4 Enter a name for the new project at the end of the path the project name is also the name of the subdirectory folder in which it is stored When you are satisfied click on the Create button to create the project Fig 6 2 airada In this example a project called PROJ_NEW s being created in the subdirectory D PROJECTS Please note that PROJ_NEW is not a single file but rather a subdirectory created by GX IEC Developer to contain all the project files d projects pro_new i garage gt afa MITSUBISHI ELECTRIC Getting Started Step 1 Creating New Projects 5 In the dialogue box GX IEC Developer New Project Startup Options click on the Empty Project option button and confirm with OK GX IEC Developer New Project Startup Options 3 xj E SL a Ladder Diagram MELSECIL Project Structure Empty Project Help Please choose one of the following assistance options for creating VOUT Hew project Create a simple project consisting of one task and optionally a Sub task Each task contains one Ladder Diagram POU Prograrn Organization Unit Include a Sub task Create a simple project consisting of one task and optionally a Sub task Each task contains one MELSEC IL MELSEC Instruction List POU Only the programming language MELSEC IL ts available
2. Projet je rr rre mypage Fig 5 1 User interface em osm o eo CI o emama S CET Minimise button Tab 5 1 Key to figure above GX IEC Developer Beginner s Manual 5 1 The Elements of the User Interface The User Interface 5 1 1 NOTE 5 1 2 NOTE 5 1 3 5 1 4 The Menu Bar The GX IEC Developer menu bar uses the standard Windows procedures When you select one of the menu titles in the menu bar a drop down list of available commands is displayed Commands with an arrow symbol open a submenu of additional commands Selecting a com mand opens a dialogue or data entry box The menu structure and the available options are context sensitive changing depending on what you are currently doing in the program Options displayed in light grey are not currently available for selection A list of all menu commands with explanations is provided in the Appendix of the Reference Manual The Toolbar The toolbar enables you to select the most important menu commands directly by clicking on the corresponding icons The toolbar is context sensitive i e different tool icons are displayed depending on what you are currently doing in GX IEC Developer A complete list of all the available tools and icons is provided at the end of the Reference Manual Windows GX IEC Developer allows you to edit multiple objects at the same time e g body header task A window is opened on the screen f
3. How to select and configure the communications port Inthe Online menu select Transfer Setup then select Ports The Connection Setup dialogue box appears Transfer Setup PC side F i El i H i CCIE Cont MET II CE Link Ethernet MET 10 H board board board board COM COR 1 Transmission speed 1115 2Kbps PLC CCIE Cont MNET I CC Link Ethernet G4 module NET 10 H module module module module module afl PLC mode QCPU Qmode Other a anya ae Connection channel list station lu Ho specification Other station Single network Other station Co existence network PLE direct coupled setting Time out Sec 1 5 Retro times 0 Pe asin BEES pF nee C24 CCIE Cont WNET M COLink Ethernet MET 1O H Detail ual Multiple CPU setting pa 3 3 3 3 System image oe Co existence network route 4 Line Connected O 46TEL C24 C24 CCIE Cont WET II CC Link Ethernet Accessing host station Not specified Close Fig 6 78 Interface selection in the Connection Setup 2 Under PLC side I F click on the button Seriell USB PC side I F Serial setting xi Fig 6 79 nee PC side I F e peza Serial setting C USE Cancel COM port COM Setup Transmission speed 13 2Kbps 3 Select either USB or RS 232C The COM ports COM1 COM10 can be selected 4 Confirm the entries in the dialogue boxes with OK 6 40 afa MITSUBISHI ELECTRIC Getting Started Step 11 Downloading Programs to PL
4. ccc eee 1 1 If you already have IEC 61131 3 experience and want to get to work right away 2 0 eee eee eee 1 1 iT VOU CSU SWICK eci cones A ng III 1 2 Getting to Know GX IEC Developer Whats New in GX IEC Developer 20m pease dane aa eeu ea doe ane es 2 1 Introduction to the IEC 61131 3 Standard 2 2 Basic Terms Used in IEC 61131 3 POOO secor e et woe Seal re Erin e ate ak and Akon Beek a deca Ha apa aa oe Pe Hae 3 1 Program Organisation Units POS Vascas cc mtd Giana dio eee pared ae dade wie ie aaa 3 2 Programs Function Blocks and Functions ax 2 ace ace rr a Es avg ee cae SS 3 3 Parameters and Instancing setas ed e Hee ad Bula ee ee ee ae he ew A 3 4 TACKS a et tae e ee a eho eed Gee da ead Gal etd ea ead tea wed een oe ae aha Baad 3 5 VaN DIG aaa coa twas neato ae ach ie Bhat dave Ge ee Ae ee ee ek Ae arte ee oe ak Y a 3 6 A E deed a we Renee ae guts EA ph deme cee he are a a GAL HR OS ek Oo 3 9 3 7 1 Simple TY DGS isc ud act nedap akana aa a me eck Boek dm iih w aceasta ay Ane neh oh ae 0d ae 3 9 3 7 2 Complex Data TYDOS 22 caras ed a eas oe ae he dee eee 3 10 Programming Languages 6cseacune hu eet ada bee ah ee ene eh hehe eee as ewan eee a 3 11 20 1 NEIWWOMKS ekiro ada cbr gtd oan chee Gee Cade eee i ee Ge dd ow eee e ete 3 11 382 Ihe TOXLECIOES sos cen teed E Aes arp we a tered Sacer de y Re eh e Bosa Gh eH cys Be w AS 3 11 3 8 3 The Graphical Editors os snare chee a he ee dekh ici Bok ke ok drid dati
5. Project entry at the top of the tree 6 36 afa MITSUBISHI ELECTRIC Getting Started 6 9 NOTE Step 8 Configuring Tasks Step 8 Configuring Tasks In this section it is assumed that you have already created the tasks for your project see Step2 Their entries are displayed in the Task Pool in the Project Navigator tree Before you can use them in the program you must first specify the POUs you want to use in the tasks and configure the task attributes How to assign PRG type POUs to tasks Double click on the task s entry in the Task Pool A table is displayed on the right of the screen in which you can then assemble the task by specifying the POUs it is to contain EF MAIN_LD Prio 31 Event TRUE ul Fig 6 75 PO ame Comment a 199 fask configuration table ee O Oconto El 2 Click on the pop up list icon in the first table line and select the POU you want to add to the task in the dialogue box displayed Confirm your selection with OK Only POUs defined as programs PRG are included in the dialogue box list The name of the selected POU will then appear in the POU Name column in the first line of the table Only POUs that have not yet been included in a previously stored task are included in the dialogue box list Using the key move the cursor to the next cell of the table and enter a comment for the POU entry in the Comment column optional Repeat step 2 for each additional POU you wish to use
6. SET_RST POU in the Project Navigator window and press JJ The following dialogue box is then displayed Function Information X Fig 6 31 Function information len SET_AST Size 36 Bytes Cancel M Use Macrocode M Use MC MCR Comment M Use with EN ENO Type FE hy Language Ladder Diagram Y Last Change 04 12 02 11 17 44 Secunty Level Ost oe a a ges ge any W Allow Read Access for lower Levels Activate the EN ENO Contacts check box to assign an EN input and an ENO output to the function block and activate the Macrocode to create an optimized code 6 16 afa MITSUBISHI ELECTRIC Getting Started Programming Examples Step 2 Define the global variables The timer elements TC TS and TN must first be declared in the Global Variable List They can then be called in the header of the POU in which the timer is going to be used In this example the input and output variables are also declared globally Open the global variable declaration table see Step 3 2 Declare the following variables Global Yariable List E oR GLOBAL inpar T GLOBAL Input a wols BOOL a VAR GLOBAL Output YO GD BOOL FALSE 3 YAR_ GLOBAL 5 TIMER1C TCO 05 0 BOOL FALSE 4 VAR GLOBAL TIMER1N TNO AMASO INT jo g VAR GLOBAL Fig 6 32 Declaring the global variables TIMERS Step 3 Create the Timer POU ladder diagram Create a new POU as a program using the ladd
7. vaserne O o mna OOS e Comment text must be enclosed between and character pairs O The CJ instruction performs a jump to the specified destination network Tab 3 5 Key to figure above Structured Text ST ST is a text oriented editor programming language similar to PASCAL and supports mathe matical functions and a simple creation of loops ST body does not contain a network list because it always consists of only one network ST is an editor from the IEC 61131 programming standard The Structured Text editor is com patible to the IEC 61131 3 All IEC 61131 IEC 61131 3 PART3 1992 standard functions are supported All MELSEC instructions are supported SE TEST PRG Body ST jolxj Fig 3 9 CASE DO D2 D3 OF Structured Text body 1 5 DIO 4 ELSE D10 6 END CASE afa MITSUBISHI ELECTRIC Basic Terms Used in IEC 61131 3 Programming Languages The Accumulator In the IEC editor the result of each operation is stored in an accumulator directly after execution This accumulator always contains the operation result of the last instruction programmed NOTE You do not have to program input conditions execution conditions for the operations in this editor Execution is always based on the contents of the bit accumulator Example V The following illustrates the difference between programming in the MELSEC and IEC editors We want to program the addition D0 5 D1 10 D2 15 to
8. 3 1 Starting GX IEC Developer 4 2 Status bare gt is aceras ss 5 2 0 ee ee ee ee ee ee 3 19 Structured programming 2 2 Structured Tole 6264248846468 404 5 5 EII eos a ee a 3 11 introduction e ss ada 4242442 486 2 4 Programming languages 3 11 Syntax check eee ee 6 36 aa MITSUBISHI ELECTRIC T Task Configuring ee er ee ee ee 6 37 Creating eum hee beeen eee o 6 4 introduction e wee ae 2 3 Task Poble 4 ss es es 8 ow ase 3 1 Text editor INTFOCUCHON ea o a 544 444 864 2 4 Structured Text s sosse sssaaa 3 12 LUsor interiaco i s ae 8 aa 5 5 VICKS Bk a Se ee eR a OS we ee 6 15 TODOS 246 aos reads 5 2 TransiloOn ems a 3 19 Transition condition 3 19 Assigning a ae As Ass 6 32 U USerinieriac e 44448 6 cut ene eee es 5 1 V Variables Siehe auch Global Variables Siehe auch Local Variables WIZARD oscars SRS REESE EEG Oe 6 3 GX IEC Developer Beginner s Manual Index Index IV e MITSUBISHI ELECTRIC GX IEC Developer Version 7 SW10D5C MEDOC3 B E 13JJ00 SH NA 0805988ENG C 0811 MEE a MITSUBISHI ELECTRIC CORPORATION HEAD OFFICE TOKYO BUILDING 2 7 3 MARUNOUCHI CHIYODA KU TOKYO 100 8310 JAPAN NAGOYA WORKS 1 14 YADA MINAMI 5 CHOME HIGASHI KU NAGOYA JAPAN When exported from Japan this manual does not require application to the Ministry of Economy Tr
9. 6 7 Programming Examples 6 7 1 Inputs and outputs in ladder diagram language LD Programming inputs and outputs in the LD editor In the Project Navigator window double click on a program body entry defined with the ladder diagram language LD 2 Click on the Contact tool icon in the toolbar TE i AE ee LR ye ee eee E 9 ETa Selecting the Contact tool E Control PRG Body LD 3 Move the mouse pointer to the desired position and press the left mouse button to place the input contact a oe ae Lap ARE an to o Fig 6 16 Placing the input contact ID Control PRG Body LD Ag 4 Click on the Coil tool icon in the toolbar Fig 6 17 ue ar Hi a d PES A Selecting the Coil tool 5 Move the mouse pointer to the desired position and press the left mouse button to place the output coil de te Lap Lye th TR yr E QO OT Placing the output coil 6 10 afa MITSUBISHI ELECTRIC Getting Started NOTE Programming Examples 6 Click on the Interconnect Line tool icon in the toolbar or Click with the right mouse button to open the context menu Select the option Line EE DEl arde a OF we qu gt Fig 6 19 A RE Ue Position the pointer over the left network bar and click the left mouse button Draw a line to the connection point of the output coil and left click again E E fp ee d ae ARE Fig 6 20 M Control
10. AH UG LUHAL Pl Park Ob Lamp Ya TA BOL SE DE sk mal Car park door 15 WAL GLOBAL CARS Number DO hng INT Number of cars in the car e Fig 7 2 Global Variable List 7 5 Create the program organisation units Step 4 in Chapter 6 Create the three program organisation units Control Counter and Door_Control Define all three POUs as programs PRG and specify ladder diagram LD as the programming language Each POU consists of a header and a body The header contains the declarations of the vari ables used by the POU the body contains the actual PLC program code 7 5 1 Project Navigator Window All the tasks and POUs you create are automatically displayed in the Project Navigator window temp S aa Fig 7 3 Project c temp Tasks ceil Library_Pool E Door_Operate G A Parameter ion see H Module Configuration E Main le o Network ek e PLC POUS al o Task Pool or fp DO Door ma perat Frio 31 Event TRUE i Control ij DUT_Pool E Counter Lg Global_Vars E Door_Control a POU_Pool E rag Control PRG JLo Body LD Er rag Counter PAG e oof Body LD ag Door_Control PRG JLo Body LD GX IEC Developer Beginner s Manual 7 3 Program the bodies Step 6 in Chapter 6 Sample Program CarPark 7 6 7 6 1 Program the bodies Step 6 in Chapter 6 Body of the Control POU Te Conteed PAG Mody UD Fig 7 4 h Door control activation hian Swatch
11. Instruction List consists of a sequence of controller instructions Each controller instruction begins on a new line and con sists of a programming instruction and its parameters and variables However there are signif icant differences in the way the controller instructions are executed The MELSEC Instruction List Language MELSEC IL MELSEC Instruction List programs are written following the rules of DIN 19239 and the pro gramming rules familiar from the MELSEC MEDOC software You can only use genuine MELSEC programming instructions see Appendix of the Reference Manual MELSEC Instruction List programs can only contain MELSEC networks Access to IEC programming instructions is not possible GX IEC Developer Beginner s Manual 3 11 Programming Languages Basic Terms Used in IEC 61131 3 3 12 The IEC Instruction List Language IEC IL The IEC Instruction List language allows you to combine IEC networks and MELSEC networks in a single program The IEC networks are programmed according to the IEC 61131 3 rules and you can use both IEC programming instructions and the adapted MELSEC instructions see Appendix in Refer ence Manual Fig 3 8 Combined Instruction List networks MELSEC LO Inrequest PNET_Ot PLS M100 1 MELSEC Commenti _ LD M100 ANI hat CJ NET 0i MELSEC Description Number Description Metsec nemo S emma OOOO first double click on the network bar o
12. ON Rectangle Binary OFF DATA 40 40 seconds have elapsed SET RSTI SET RST Input sr Output EEE Fig 6 82 g EN ENO I Ladder diagram Tail Filled field between the input contacts 100 ika ON Filled rectangle Binary ON Rectangle Binary OFF DATA 100 100 seconds have elapsed SET_RST1 Input2 SET a Output ES MOVE TimeriN 100 IN DATA 100 Fig 6 83 400 Instruction list SET _RST1 EN Inputl SET Input2 RST TIMERYS O 0utput1 ON OFF status is indicated by filled not TIMER1N filled DATA rectangles afa MITSUBISHI ELECTRIC Getting Started Step 13 Uploading Data from the CPU 6 14 Step 13 Uploading Data from the CPU How to upload data from the PLC s CPU to GX IEC Developer Select Transfer in the Project menu then select the Upload from PLC option 2 This displays the PLC Parameter dialogue box Select the appropriate CPU Type and con firm with OK see Step 1 3 In the next dialogue box GX IEC Developer asks you to specify the path and name for the uploaded project data which will be stored as a new project If you want to create a new project for the upload follow the instructions in Step 1 If a project is already open you can abort the procedure by clicking on the Cancel button Click on Setup in the Transfer Setup dialogue box This displays the Transfer Setup CPU port dialogu
13. RST N Input SET Input E E Output Timer S RST Input g ON Timeri _IN DATA The function blocks used in the program can be found in the following libraries Manufacturer Library TIMER_M Function blocks SET_RST IEC Standard Library MOVE 6 18 afa MITSUBISHI ELECTRIC Getting Started Programming Examples Input1 Timer1C Timer runs for 10 seconds Timer1S Input2 Output Fig 6 36 Timer sequence Timer sequence The timer sequence begins when INPUT is set and the timer starts to run If INPUT2 is set OUTPUT1 is switched on When the 10 second period has elapsed timer contact TIMER1S is set and OUTPUT1 is switched off again If Input2 still remains set or is set Output1 will be set again The lower program block containing the MOVE instruction is only necessary to make it possi ble to follow the 10 second sequence in monitoring mode Programming the timer in function block diagram language The following illustration shows how to realize the same program using function block diagram language T DEMO_FBD PRG Body FED Fig 6 37 Function Block Diagram TIMER M program example Inputl EN ENG TIMER1C Tail 100 T alue SET_RST1 SET RST EN ENO Input SET Input G E Output Timer S RsT_ Input GX IEC Developer Beginner s Manual 6 19 Programming Examples Getting Started NOTE 6 7 5 Function blo
14. SFC afa MITSUBISHI ELECTRIC Getting to Know GX IEC Developer Variables Introduction to the IEC 61131 3 Standard Before you can actually start writing a PLC program you must first decide what variables you are going to need in the program module you are working on Each POU has alist of local vari ables These are the variables that can only be used within the POU they are defined and declared for The global variables which can be used by all the POUs in the program are declared in a separate list Global variables Fig 2 5 Global and local variables GX IEC Developer Beginner s Manual Header Local aati PLC program of POU 1 POU 1 Header eS PLC program of POU 2 Pou2 Local Introduction to the IEC 61131 3 Standard Getting to Know GX IEC Developer afa MITSUBISHI ELECTRIC Basic Terms Used in IEC 61131 3 Projects 3 Basic Terms Used in IEC 61131 3 3 1 Projects Every GX IEC Developer project consists of the following elements O The Library Pool the programming instructions contained in the standard library the programming instructions contained in the manufacturer library The PLC parameters The tasks in the Task Pool The structured data types in the DUT Pool The global variables The program organisation units in the POU Pool MESES Fig 3 1 kl Project e MELSEC The program element objects are displayed in the ffi Library Pool Project Navigator window
15. be executed when input XO is active Fig 3 10 Code for the addition In the IEC editor MELSEC n the MELSEC editor Number Description IO o The bit accumulator is undefined at the beginning of the network o The accumulator now contains a value of O or 1 depending on the state of input XO The JMPCN instruction JumpConditionalNot will be executed if the value in the accumulator is 0 The instructions in section are skipped and the program branches to the Next network If the value in the accumulator is 1 JMPCN is ignored and the instructions in are executed The accumulator then still contains the status of XO i e 1 in this case eo Writes the contents of data DO e 5 to the accumulator o Adds the value in DO to the value in D1 After the addition the result 15 is stored in the accumulator Stores the result of the addition to D2 The accumulator still contains the value 15 Tab 3 6 Key to figure above GX IEC Developer Beginner s Manual 3 13 Programming Languages Basic Terms Used in IEC 61131 3 3 14 Calling Function Blocks Function blocks can only be called as instances using the following operators CAL Call CALC CallConditional CALCN CallConditionalNot CAL is always executed CALC and CALCN first poll the status of the bit accumulator they are executed only if its value is 1 CALC or O CALCN The instance name is assigned in the header of the POU T
16. in the project Include a Sub task Start the interactive Project Structure Builder Assistant you ll be guided through several steps creating tasks and POL s depending on your selections Don t use any assistance to build your project just create an empty one containing no tasks or POUS Fig 6 3 GX IEC Developer then creates the empty new project as defined As soon as you have created a new project the Project Navigator window is displayed on the screen automatically with all the standard entries for the project proj news Library_Pool 2 entries 15 11 02 10 51 57 H E Parameter 04 12 02 08 12 12 entries for the project and the optionally JH Fig 6 4 Project Navigator showing standard Fre Project c temp prop new 04 12 02 08 12 29 a PLC 04 12 02 08 11 21 a CETS Task_Pool 0 entries 15 11 02 10 51 56 activated additional informations sees aj BUT Pool 0 entres 15 11 02 10 51 56 ge Global Wars 0 entries 15 11 02 10 51 56 Ena Cola POU Pool 0 entres 15 11 02 10 51 56 The project entries are displayed in a hierarchical tree structure which always contains the fol lowing standard components Project Name Library Pool PLC Parameters Task Pool Data Unit Types Pool Global Variables Program Organisation Units Additional information is optionally displayed in brackets behind each entry in the Project Navi gator window You can activate the display of these details by click
17. input parameters The Average function is programmed to perform the following operation DO D1 D2 D3 4 When the function has been executed the bit accumulator contains the resulting average value of the four input parameters A LD must also be used to pass the first parameter for the EN ENO functions e g E_ADD E_MUL E_XOR Their first parameter is always the Boolean EN input EN ENable Example V Fig 3 13 A SF sn a Sin This writes actual parameter XO to the EN input The 3 mes ans parameters for execution of the addition are programmed with the function itself The E_ADD function performs the following operation DO D1 D2 Following execution of this function the bit accumulator will contain the status of the ENO output ENO ENable Out which in term has the same status as the EN input GX IEC Developer Beginner s Manual 3 15 Programming Languages Basic Terms Used in IEC 61131 3 3 8 3 The Graphical Editors The Ladder Diagram Language LD You can use all available programming instructions in the ladder diagram language see Appendix in Reference Manual Ladder diagrams consist of contacts break and make contacts coils function blocks and functions These elements are linked with horizontal and vertical lines referred to as intercon nects These interconnects always begin at the power bar on the left which is sometimes also referred to as the rail NOTE Each network can contain
18. 2 Action program Clock pulse Outputs gt NOTE Transition and action programs are written in exactly the same way as any other POU You can write these programs using Instruction List ladder diagram or function block diagram language The Sequential Function Chart language itself is not supported for these programs however 6 34 afa MITSUBISHI ELECTRIC Getting Started Programming Examples Step 8 Assign actions or Boolean variables to the steps Select the step to which you wish to assign an action or variable Example Step_ 1 2 Click on the tool icon This displays the Action Association dialogue box which is still empty Initial Fig 6 71 Opened Action Association dialogue box TT Action Association Ste Mal Fa 3 Press the amp key This displays the Action Name List box showing the actions and Boolean variables that are currently available 4 Select the appropriate action variable Example Initial Output1 Step_1 Action_1 Step_1_a Output Step_2 Output4 Step_3 Output5 Step_4 Output6 Fig 6 72 Action Name List ACTION Aktion 1 Input Input Apu Impribe Inputs Inputb Input Output Outputs Outputs Output Outputs Dutput Output Clack ales RONI GX IEC Developer Beginner s Manual 6 35 Step 7 Checking PLC Programs syntax check Getting Started 5 Close the Action Name List box by double clicking on
19. 999 he POUS Control and Control 7 Counter to the Main task 1 Counter A Fig 7 8 Attributes of the Main task OK Event TRUE Le the task s two POUS Control and Counter both run continuously Priority 1 Task Attributes Event TRU E Interval o NA Priority Cancel fee Comment Name Main Size 185 Bytes Type TASK M Timer Output Control Last Change 06 12 02 09 33 56 Security Level gogig gaai ait Gin Shay M Allow Read Access For Lower Levels GX IEC Developer Beginner s Manual 7 7 Configure the tasks Step 8 in Chapter 6 7 1 2 NOTE Sample Program CarPark The Door_Operate Task 355 Door_Operate Prio 31 Event TRUE Miel ES Fig 7 9 PO mame Comment The Door_Operate task contains the AI A o o POU Door_Control E Fig 7 10 denia T Attributes of the Door_Operate task Event CPark_OK Cancel e the associated POU Door_Control is only activated when the CPark_OK signal is set Comment Priority 31 Event Giarage_OK Interval f Ele m Priority Name Daor_0 perate Size 165 Bytes Type TASK M Timer Output Control Last Change 06 12 02 09 33 56 Security Level 0913234320135 W Allow Read Access For Lower Levels Entry of the project data is now complete Compile the project Step 9 2 configure the ports of your personal computer Step 10 and 3 download the program t
20. C 6 12 Step 11 Downloading Programs to PLC When your program project is complete and has been checked for errors and successfully compiled you can download it to the controller system for execution Connecting the PLC system Connect the PLC to your personal computer 2 Make sure that you plug the connection cable into the same port on the computer that you defined in the settings described in Step 10 above NOTE Please refer to the Reference Manual for details on the various different options available for connecting the PC and PLC systems How to download a program to the PLC Select Transfer Setup in the Online menu then select Project The Download Setup dialogue box is displayed on the screen xi Fig 6 80 The Transfer Setup dialogue box options are used to specify which data are downloaded to the PLC DOWNLOAD object PLC Parameter Program f PLC Parameter and Program Driver lo Program memory Init System Addresses M Download Boot Autoexec File Dotnload Intelligent Parameter File DOWNLOAD source information No Information Symbolic 0 Program memory UPLOAD mode e MELSECIL always drive 0 Source Information Drive 0 Program memory C Upload Intelligent Parameter File Click on PLC Parameter and Program then confirm with OK WARNING You must always download the PLC parameter when you transfer a program to the PLC for the first time Q QnA series P
21. Developer Beginner s Manual 3 3 Parameters and Instancing Basic Terms Used in IEC 61131 3 3 4 Parameters and Instancing Functions and function blocks have formal parameters and actual parameters Formal parameters are the variables used when a function or function block is created The formal parameters of the programming instructions in the standard and manufacturer libraries are not visible to the user Actual parameters are the variables that are passed to the function or func tion block instance copy when it is used in another POU Actual parameters can be defined variables hardware addresses or constants Idantiier Type Lo ija Camnoant BOO FALSE riul variable Lau putt wares Jal Fig 3 4 The program organisation unit POU_9 Is a function block FB The variables IN and OUT used in this program module are declared in the header IN and OUT are the formal parameters Function blocks can only be called as instances The process of instancing or making a copy of the function block is performed in the header of the POU in which the instance is to be used In this header the function block is declared as a variable and the resulting instance is assigned a name Note that you can declare multiple instances with different names from one and the same function block within the same POU The instances are then called in the body of the POU and the actual parameters are passed to the formal parameters Each instan
22. GX IEC Developer Version 7 MITSUBI SHI a MELSOFT W i Mh intenance MELSOFT Integrated FA Software SW10D5C MEDOC3 E e SAFETY PRECAUTIONS e Always read these instructions before using this equipment Before using this product please read this manual and the relevant manuals introduced in this manual carefully and pay full attention to safety to handle the product correctly The instructions given in this manual are concerned with this product For the safety instructions of the programmable controller system please read the CPU module user s manual In this manual the safety instructions are ranked as DANGER and CAUTION aa eae eae ae aaa aa eae ae eae aL ia ae i ee me Indicates that incorrect handling may cause hazardous conditions D DANGER resulting in death or severe injury 0 l Indicates that incorrect handling may cause hazardous conditions resulting in medium or slight personal injury or physical damage A A AA A A A SA N CAUTION DRRR Note that the CAUTION level may lead to a serious consequence according to the circumstances Always follow the instructions of both levels because they are important to personal safety Please save this manual to make it accessible when required and always forward it to the end user Design Instructions lt DANGER e For data change program change and status control made to the PLC which is running from a Personal comput
23. Help Alam COT Adaem Pak OE a Lae A D in consul petri 2 Help Alam factor Wp Help call and CO Alan Door Open Motor Up CO2 alarm Alem 3 Doo Open Prt Car Gone Enter Car Gone nen M EN BNO p i i Maa_Tima_Up_C TEM Timer activation Bd T alue Ho Traite d My Time Us E Tiree Cordral s Time control Tene Cardrel 5 Tima Contre ae Lua Coy Alan Motor ren Close car park Miam Seth door Chobe cur par doo 6 hian Stih Dom lowed Motor Cire i Reset Tima Conin Ture Control FARO Door control activation When the main switch is on and no help call or CO2 alarm is registered the OK signal variable CPark_OK for the Door_Control program organisation unit is set and the CPark_OK_Lamp is switched on Help call and CO2 alarm As soon as an alarm is registered the motor rolls the car park door up The motor is reset when the door activates the upper limit switch Door_Open Timer activation When the door is open and the photoelectric barriers at the entrance Enter_Car_Gone and the exit Exit_Car_Gone do not register any vehicles the timer Max_Time_Up_C starts to count for 60 seconds afa MITSUBISHI ELECTRIC Sample Program CarPark Program the bodies Step 6 in Chapter 6 7 6 2 Time control The Time_Control relay is set as soon as the 60 second period has elapsed Close car park door When no traffic is registered or the main switch is turned off and no alarm is registered the motor rolls the car park
24. IC Getting Started Programming Examples Click on the tool icon e Inserts a jump exit point Fig 6 62 Inserted jump exit point Step 5 Assign names to the steps and the jump exit entry labels Click on the element you want to assign a name to Activates editing mode 2 Enter the name Example Step_1 through Step_4 and Jump Fig 6 63 Assigned names to the steps and jump exit entry labels GX IEC Developer Beginner s Manual 6 31 Programming Examples Getting Started NOTE Step 6 Assign transition conditions to the transitions You can use transition programs TRUE FALSE and Boolean variables referenced by direct address or name as transition conditions Assigning and creating a transition program Click on the transition to which you wish to assign a program Activates editing mode 2 Enter the program name Example TRAN_1 Fig 6 64 Entered program name 3 Click on the tool icon The New Transition dialogue box is displayed with the program name you just entered 4 Select the programming language Example ladder diagram Fig 6 65 a tat Programming language selection for transition Language Cancel Function Block Diagram Instruction List MELSEC Instruction List Structured Text 5 Click on OK The body of the transition program is displayed automatically 6 Write the transition program NN Process PRG Body SFC Transition Tran
25. LCs must be formatted first 3 Select Transfer in the Project menu then select Download to PLC to start the download The transfer process is documented in a list box if no error messages are displayed the transfer has been completed successfully GX IEC Developer Beginner s Manual 6 41 Step 12 Monitoring Programs Getting Started 6 13 NOTE NOTE NOTE Step 12 Monitoring Programs In monitoring mode GX IEC Developer can display the current status and changes of the vari ables devices used by your program You can only monitor error free programs that have been compiled and downloaded to the PLC system for execution Select Monitoring Mode in the Online menu A check mark Y in front of the option in the menu indicates that the mode is currently active and the entries in the Project Na vigator window switch to light grey 2 Open the body of the POU that you wish to monitor 3 Select Start Monitoring in the Online menu The PLC must be in RUN mode for monitoring to be possible The following examples illustrate how the status changes of the variables are displayed in monitoring mode for the various programming languages supported by GX IEC Developer More detailed information on the display options and other monitoring mode features can be found in the Reference Manual Chapter 8 TIMER M Fig 6 81 EN ENO Function block diagram Tail ge 100 TWalue i Filled rectangle Binary
26. Manual XI Contents XII afa MITSUBISHI ELECTRIC Introduction 1 1 1 2 1 3 1 4 1 5 This manual Introduction This manual lS a compact guide to using GX IEC Developer suitable both for beginners and experienced users upgrading from other systems The manual includes explanations of the terms and structural concepts of IEC programming and an introduction to the new IEC 61131 3 standard The Getting Started chapter provides a precise step by step description of how to use GX IEC Developer including a sample project This executable application is used to demonstrate the operation of the program with the help of the exercises provided in this manual The Reference Manual contains detailed descriptions of all menus and menu options Refer to it whenever you need more comprehensive information on the ins and outs of the system If you are not yet familiar with MS Windows please at least read the Windows Fundamentals section in the Windows User s Guide or work through the Windows Tutorial accessible through the Help menu of the Windows Program Manager This will teach you what you need to know about using the basic elements of MS Win dows and the operating procedures that are identical in all Windows application programs If you are not yet familiar with the IEC 61131 3 standard please do take the time to read the Introduction to the IEC 61131 3 Standard chapter This section explai
27. OU entry in the POU Pool and expand them if necessary see 3 in Step 4 2 Double click on the Body entry in the Project Navigator The editing window of the editor for the selected programming language is opened on the right hand side of the screen It contains one network 0 Control PRG Body LD Fig 6 14 Programming a POU body in a network A If you wish you can disable the background grid display by clicking on Grid in the View menu a Y check mark is displayed in the menu when the function is enabled You can adjust the size of the background grid with the Environment option in the View menu Please note that the value you enter for the grid spacing changes the setting for the entire screen setup and not just for the selected programming editor 3 Now you can start writing your PLC program You will find programming examples for the various programming languages and editors on the following pages 4 Select Save in the Object menu to save the body of your POU NOTE You can increase the size of the editing area with the mouse Position the mouse pointer on the lower edge ofthe network bar box atthe left of the editing window the pointer changes to a double arrow when it is over the resize line To resize the editing area hold down the left mouse button drag the dotted line to the desired position and then release the button GX IEC Developer Beginner s Manual 6 9 Programming Examples Getting Started
28. POU are stored Step 2 Declare the variables in the header Open the header and enter the local variables to be used in the POU see Step 3 Global variables do not need to be declared here as they can be used directly as glo bal variables Fig 6 41 a Class Identifier Type J Initial In this example only local variables are used var Hck pulse al BOOL al FALSE e E an ee Anca a To aan ee ni EEEE il input ee A e FALSO ee ee aa mo an I ee rience aaa A var cosa e a El etn ma a mel var ire mo TEER Al a rence ee E van as qa arene Ati se AE eas van eee Hl input etter Boot T I FALSE eee lume var E E apace on ee flea hoe io ot E como o as Ace ages ae er A van PP o ens Aia od AT oa gt nee E ciate aes ol ane io a var E Fire hee aio eas Ae oe ee ono E E pa Pas Io ae a nee ee iaa WH ouput O o md ioo S a eee B a B BA BU BM A B Ba eee TT TEC eee Te M A B M M B BA BBB M Cre a B M a B a B M Ba Ba M E A B M B B ere eee a Step 3 Open the body 1 Double click on the Body entry in the Project Navigator window EA Process PRG Body SFC Fig 6 42 When you open the SFC editor the following elements are displayed E sal TRUE The Initial Step double outline The transition TRUE The Final Step aa MITSUBISHI ELECTRIC Getting Started Programming Examples NOTE Steps to which no actions are yet associated are shown filled in white The fill colour changes to grey
29. PRG Body LD Drawing a connection line The character that appears above the input contact and output coil symbols serves as dummy which you must replace with declared operand names or a direct address X Y Click on the Select mode tool icon in the toolbar Using the mouse pointer select the dummy character over the contact and the coil and overwrite the dummy character with ap propriate variable names Alternatively you can also press 3 to display the operand selecti on list and select a name from the list df e Lap Lag Fig 6 21 Selecting the Selection tool EE ea Loy Control PRG Body LD For the described procedures the Auto Connect mode is not activated GX IEC Developer Beginner s Manual 6 11 Programming Examples Getting Started 6 7 2 A Sum Function in FBD Language Programming a sum function in the FBD editor Steps through below are exactly the same in the ladder diagram and function block dia gram editors Only the tools displayed in the toolbar are different in each case In the Project Navigator window double click on a body entry defined with the function block diagram language FBD 2 Click on the Function Block tool icon in the toolbar 4H Fig 6 22 R TE dk lr dr Ly Ln f he vaka avk S GG IE Function Block tool 0 sum PRG Body LD Function Block 3 Double click on the ADD instruction in the selection box displayed Ai O
30. Parameter oa Lae Global_Vars Ea POU_Pool GX IEC Developer Beginner s Manual 3 1 Program Organisation Units POUs Basic Terms Used in IEC 61131 3 3 2 Program Organisation Units POUs Each program organisation unit consists of O a header and O a body The variables to be used in the POU are defined declared in the header y POU Pood ma aja PRA LD JPRS g Hizka ot Bod iD 4 9 PaL 2 PUN INT 3 Pa JPRG UY Poy a PAG a ur Pou SPRG e 0 Pow EPR i 5 4 Pi 7 PRG i uy Pia 0 PAG EE MAIN PEGO PAG Haadas Fig 3 2 POU header top and POU body bottom The body contains the actual PLC program POUs are divided into three classes on the basis of their functionality O Programs PRG O Functions FUN and O Function blocks FB 3 2 afa MITSUBISHI ELECTRIC Basic Terms Used in IEC 61131 3 Programs Function Blocks and Functions 3 3 Programs Function Blocks and Functions Fig 3 3 blocks and functions Programming Programming Programming instructions instructions instructions Function Function blocks blocks Functions Functions The program POU is the standard program organisation unit Program POUs can contain pro gramming instructions from libraries functions and function blocks The execution of the pro gram POUs is controlled by tasks Functions POUs declared as functions or function blocks are independent program elements They function effectively as programmin
31. Select the TRUE transition Initial Fig 6 51 Selected TRUE transition GX IEC Developer Beginner s Manual 6 25 Programming Examples Getting Started Click twice on the tool icon Inserts two right divergences with transitions Initial Fig 6 52 m Two inserted new right divergences _ A Fig 6 53 Selected TRUE transition 6 26 afa MITSUBISHI ELECTRIC Getting Started Programming Examples 2 Click on the tool icon E Inserts a new step and transition pair Fig 6 54 Inserted new step and transition pair Fig 6 55 Selection rectangle for location of new step and transition pair GX IEC Developer Beginner s Manual 6 27 Programming Examples Click on the tool icon Inserts a new step and transition pair 5 Click on the final step Getting Started Fig 6 56 Inserted new step and transition pair Fig 6 57 Selected final step afa MITSUBISHI ELECTRIC Getting Started Click on the tool icon Inserts a right convergence GX IEC Developer Beginner s Manual Programming Examples Fig 6 58 Inserted new right convergence Fig 6 59 Selected step in the bottom row Programming Examples Getting Started Click on the tool icon el Inserts a jump entry point Fig 6 60 Inserted jump entry point Click on the empty space below the free transition Fig 6 61 Selected position for new item 6 30 afa MITSUBISHI ELECTR
32. _1 LD Fig 6 66 Transition program afa MITSUBISHI ELECTRIC Getting Started Assigning an existing variable to a transition Programming Examples Double click on the transition to which you wish to assign a variable Activates editing mode 2 Enter the name of an existing variable Example Input2 to Input7 NOTE This overwrites the TRUE transition condition o A pa Step_1_a apes a Z or e _ Input Inputb T ne E step_3 E step_4 Inputb Input TT E T GX IEC Developer Beginner s Manual Fig 6 67 Existing variables assigned to transitions Programming Examples Getting Started Step 7 Create the actions Select the Process POU in the Project Navigator 2 Click on the tool icon Displays the New Action dialogue box 3 Enter a name for the action Example Action_1 and select the programming language Example ladder diagram Hew Action Language Cancel Function Block Diagram Instruction List Fig 6 68 Programming language selection for action MELSEC Instruction List Structured Text The new action is displayed in the Action Pool in the Project Navigator window 4 Double click on Action_1 to open the program editor Fig 6 69 New action in the Action Pool in the Project Navigator s Body SFC ce Action_Pool Lo Action_1 LD 5 Enter the program Process PRG Action Aktion_1 LD Fig 6 70
33. aae 6 40 Step 11 Downloading Programs to PLO 0200s aeenw de arcadas ae eade eh hehe ds 6 41 Step 12 Monitoring ProdraMS sv coria den a ke ee ok ee aa da ae A ee ae 6 42 Step 13 Uploading Data from the CPU nananana ce nee ees 6 43 Sample Program CarPark PROICGE SM UGG visera tra Sat he ree ed y Hoe ed Su a eae Ro ee ee 7 1 7 1 1 The Task MORI ess tee hes Ge a eee WEE a Gea ears wee Ge ak ee 7 1 7 1 2 The Task Door_Operate 0 0 0 0 eee ee eee eae 7 2 Create the new CarPark project Step 1 in Chapter 6 0 0 00 ccc ees 7 2 Create the tasks Step 2 in Chapter 6 1 eee ee eens 7 2 Declare the global variables Step 3 in Chapter 6 0 2 0c eee 7 3 Create the program organisation units Step 4 in Chapter 6 o o ooooooocnonnonoo 7 3 7 5 1 Project Navigator WINdOW oo ooooocononnan aa 7 3 Program the bodies Step 6 in Chapter 6 o ooocooonenonno eee eee 7 4 16 1 B dyof the Conto POU ascii e entes asad an area oa pao ae a led aras Espada 7 4 7 6 2 Body of the Counter POU o o oooocooonoonor eee eee e ene 7 5 7 6 3 Body of the Door Control POU sesos acatar add dad Roi 7 6 Configure the tasks Step 8 in Chapter 6 oooooocooenon ee eee nes 7 7 EXA We Mam tas ce stax cee eee des eens bh ores oe a a o o ee Ge ae a 7 7 7 7 2 The Door_Operate Tasas ca a er Gee Be ets aed y Heda hdd wt Suita Ae en aes 7 8 Importing GX IEC Developer Beginner s
34. ables NOTES The structure of MELSEC MEDOC programs can only be remained if you select MELSEC mode in the Wizard before For further details refer to the Reference Manual GX IEC Developer Beginner s Manual 8 1 Importing afa MITSUBISHI ELECTRIC A Absolute address s e s s s s aeres Hs 3 6 ACION 4 ee oe ee ee e a 3 19 Creating E E Set see we ee E 6 34 Actual parameter gt eee ee ees 3 4 Arrays OVERVIEW s crrr sureres Tyn yes 3 10 B Bit accumulator e eA bw ae ww eS 3 13 Body So ee oe ae ee oe A RA A Be ee 3 2 Programming see eee 6 9 C COl e dsc eras Ge 6 Gs 6 3 COMMENT lt lt sirr psie pareen 3 9 Communications port 6 40 D Data type TEA EN 3 9 Data types FEET 3 9 Data Unit Types SFE 3 10 Declaration table eos w e sis a 5 4 OU Bee e eee Pee eee Gees Oe ee a 3 10 DUT P66 SS ee eee hae eRe ss 3 1 E EHO lt lt cios Baw eee ew we OE ws 5 5 Extended information 6 3 F Final step osco 6 22 Formal parameter esos sssaaa 3 4 GX IEC Developer Beginner s Manual Index FUNCION lt me 6 64 amp So He aww e 3 3 Calling in FBD lt se se caws 272 3 18 Calling in text editor 3 15 POU 2244 fee ee ee eee a eee a eee 3 2 Eunction block e r ss s s ewes suas RES 3 3 Callingin FBD gt s xa ssa i aa 3 18 Calling in graph editor 3 17 Calling in text edit
35. ade and Industry for service transaction permission Specifications subject to change without notice
36. ader of the POU they are automatically assigned a suitable memory location in the CPU You can use either the IEC syntax IEC Addr or the MITSUBISHI syntax MIT Addr to assign the absolute addresses Two address columns are available As soon as you have entered an address in one of these columns the other address also appears You can enter either of the two address formats in both columns If for instance you enter a MITSUBISHI address in the IEC column GX IEC Developer identifies it immediately places it in the correct column and produces the matching IEC address in the other column IEC Address MITSUBISHI Address Meaning MWO 450 D450 Data register D450 Tab 3 3 Examples of absolute addresses Use upper case letters only and no spaces or mathematical operator characters e g in addresses afa MITSUBISHI ELECTRIC Basic Terms Used in IEC 61131 3 Data Types 3 7 3 7 1 NOTE Data Types GX IEC Developer supports the following data types Simple Types The data type of a variable defines the number of bits it contains how they are processed and the variable s value range The following data types are available 500 O FALSE 1 TRUE T 24d 0h31m23s648 00ms eh TIME Time value to 32 bits T 24d20h31m23s647 00ms Tab 3 4 Available simple data types Please note that not every data type can be processed by every PLC type Initial Value The initial values are set automatically by the syst
37. ails on using the SFC language 5 3 1 Using the text editors All cursor movements and editing functions are similar to those of a standard word processor The following additional conventions also apply in the text editors O To activate editing mode click on the surface of a network with the mouse pointer O Each program line contains one controller instruction with the following syntax Operator TABSTOP Operand s O The operator and the operands must always be separated by tabstops Pressing F2 when the cursor is in the first column displays a list of available programming instructions pressing it in the second column displays a list of available operands variables O You can also enter optional comments which can be one or more lines long Comments must be enclosed between and characters You can move around in the program lines with the normal cursor keys GX IEC Developer Beginner s Manual 5 5 The Editors The User Interface 5 3 2 Using the graphical editors Working in the graphical editors is similar to using a drawing program You can add elements to the networks in the editing windows by selecting symbols in the toolbar and with the com mands in the Tools menu The following elements are available Contact input LD only Coil output LD only Programming instructions Input variable Output variable Return instruction Jump label Comment Once you have positioned the elements you then connec
38. ain Q number oes o Jump entry point Final step Tab 3 12 Key to figure above Sequences can also contain left and right divergences and convergences i e alternative branches for different transition conditions These branches are identified by a double hori zontal interconnect lines Jumps are also allowed within sequences These are effected with exit points jump instruc tions and entry points labels Every step can be declared as a macro step consisting in turn of a sequence Macro steps are identified by two additional horizontal lines within the block The only limitation on the nesting depth is the memory capacity of the controller You will find more detailed information on the sequencing rules of the SFC language in the Reference Manual You can find a detailed example in Chapter 6 of this manual Step 6 2 MITSUBISHI ELECTRIC Installation 4 4 1 4 1 1 4 1 2 4 2 Hardware Requirements Installation Hardware Requirements Recommended Hardware Configuration O Pentium II 350 processor or above O 64 MB RAM Microsoft Windows 2000 128 MB RAM Microsoft Windows XP 1024 MB RAM Microsoft Windows Vista Serial interface RS 232 USB port Hard disk with at least 200 MB free space CD DVD ROM drive 17 43 cm VGA monitor 1024 x 768 pixels Software Requirements GX IEC Developer is a 32 bit product The following operating systems are supported O Microsoft Window
39. ar A ns Door Closed Motor Down Ry Reset Open car park door When the car park door is closed the key switch inside Exit_Up or outside Enter_Up the building must be operated to open the door Reset The motor is reset when the car park door reaches the upper limit switch Door_Open Close car park door When a car passes through the photoelectric barrier after driving in Enter_Car_Gone or out Exit_Car_Gone of the building the motor starts to close the car park door Reset When the door reaches the lower limit switch Door_Closed the motor is reset 7 6 aa MITSUBISHI ELECTRIC Sample Program CarPark Configure the tasks Step 8 in Chapter 6 7 7 Configure the tasks Step 8 in Chapter 6 We have already created the two tasks needed by the program Main and Door_Operate see Step 2 The next step is to assign the POUSs to the tasks which are still empty Double click on the task name in the Project Navigator then select the pop up arrow icon in the cell in the POU Name column and select the POU from the list displayed After assigning the POUs you must then configure the task attributes Select the task in the Project Navigator window or open the task configuration table by double clicking on its name then press JEJor select Information in the Object menu to open the Task Information dia logue box 7 7 1 The Main task 185 Main Prio 31 Event TRUE Fig 7 7 nnn 6
40. ariables Basic Terms Used in IEC 61131 3 Class The class keyword assigns the variable a specific property that defines how it is to be used in the project peepee Ma OO X X pS Variable that is only used within the POU Local variable with unchangeable initial value used within the POU VAR_CONSTANT VAR_OUTPUT Variable passed output by the POU Local variable passed from outside and passes VARIN OUT lx output by the POU can be altered within the POU VAR_GLOBAL x X Global variable declared in the Global Variable List Global variable with unchangeable initial value A CONS TANT xoxo declared in the Global Variable List Tab 3 2 Available classes Variable passed from outside that cannot be altered Identifiers and Absolute Addresses Each variable is given a symbolic address i e a name This is referred to as the identifier it consists of a string of alohanumeric characters and underline characters The identifier must always begin with a letter or an underline character Soaces and mathematical operator char acters e g are not permitted Examples of identifiers FAULT ZEROSIG LIM_SW_5 When global variables are declared they should also be assigned absolute addresses that reference the memory location of the variable in the CPU or a physical input or output If you do not assign the absolute addresses manually they are assigned automatically When local variables are declared in the he
41. ce can be used more than once For details on activating instances of function blocks in the individual editors please refer to the chapter Programming Languages ies POU_4 PRG Header Bco o ae gt Padra f z F is m A i A o Timer51 IN oMi omel Fig 3 5 Reset ID an instance of function block POU_ 9 IN and OUT are the formal parameters TimerS1 and Comeln are the actual parameters of the instance afa MITSUBISHI ELECTRIC Basic Terms Used in IEC 61131 3 Tasks 3 5 Tasks A task contains one or more program organisation units declared as programs PRG The task controls the processing of these programs by the controller z 1O Tak Fani if Frio 3 er o TAS Pro gt 31 ae TRUE E E DUT_Pool pro i Global_ Wars a G3 POU_Pool ae MAIN _PRG_LD PRG E E Lo Body LD ag Pou_1 PRG fOr Pou_2 PRG fOr Pou_3 PRG Org Pou_4 PRG fOr Pou 5 PRG fOr Pou_6 PRG Fig 3 6 This project consists of two tasks MAIN_LD and TASK_2 If a project contains more than one task you can define execution conditions for the individual tasks Task Attributes Fig 3 7 Seat TRUE Event Execute if the variable ID TRUE mee Interval Execute at defined time intervals Miel o Priority Execute in a defined priority order Priority 31 GX IEC Developer Beginner s Manual 3 5 Variables 3 6 Basic Terms Used in IEC 61131 3 Variables Variables are similar t
42. ck diagram language Timer Coil TIMER2C Contact TIMER2S Actual value TIMER2N Programming the timer in Instruction List language The following illustration shows how to realize the same program using Instruction List lan guage E DEMO_IL PRG Body IL Input TIMER1E 100 SET RSTifEN Inputl SET Input Input2 RST Input TIMERTS G OQutputl TIMERTN DATA Fig 6 38 Instruction List program example Instruction list language Timer Coil TIMER1C Contact TIMER1S Actual value TIMERIN Please refer to Chapter 3 for detailed instructions on how to call functions and pass the actual parameters to the formal parameters of function block instances in the Instruction List language Sequential Function Chart Language You can find a basic introduction to the SFC programming language in Chapter 3 of this manual More detailed information is provided in the Reference Manual The following example is a step by step illustration of the procedures required to create an SFC program using the GX IEC Developer tools afa MITSUBISHI ELECTRIC Getting Started Programming Examples The Process sample program The program is called Process and solves the problem using a variety of selective branching constructs and the Jump instruction fia Process PRG Body SFC To n1 l step 1 step 1a EE input step 2 A A JJ pto A imputa iS z L Jump Jump step 3 step 4 Bal Input E Inp
43. ck indicates that you must enter the function block s instance name here Next the actual parameters TimerS1 and Comeln are passed to the formal parameters IN and OUT Tab 3 9 Key to figure above GX IEC Developer Beginner s Manual 3 17 Programming Languages Basic Terms Used in IEC 61131 3 3 18 The Function Block Diagram Language FBD In the function block diagram language you can also use all programming instructions see Appendix in Reference Manual They are displayed as shaded blocks which are connected with the horizontal and vertical interconnect lines Power bars are not used in this language In addition to the normal input and output parameters some blocks also have a Boolean input EN ENable and a Boolean output ENO ENable Out BarrierFeguest 0 o Fig 3 16 AND Graphical programming in the Comeln H function block language editor Drive Qut e O Alarma TIMER M ENO E TimerlC1 L TCoil TimerTh1 Tvalue AND Barrier TimerTS1 5 RST M EE Caomeln Tab 3 10 Key to figure above Calling Function Blocks and Functions In the function block language function blocks and functions are called in exactly the same way as in the ladder diagram language afa MITSUBISHI ELECTRIC Basic Terms Used in IEC 61131 3 Programming Languages The Sequential Function Chart Language SFC SFC is a structuring language which allows
44. clear representation of complex processes NOTE The program is the only available program organisation unit POU in this language The basic elements of the SFC language are steps and transitions From 0 to n actions can be assigned to each step An action can be a Boolean variable output or relay or a PLC program These programs can be written using any of the editors including the Sequential Function Chart language itself All actions are listed in the Action_Pool in the Project Navigator window Each transition is assigned a transition condition Transition conditions can be written using any of the editors except Sequential Function Chart itself All transitions are also listed in the Project Navigator window Transitions pass control to the next step in the program sequence when their condition evaluates as logical true az F Payment PRG 0 Fig 3 17 Sample SFC project Bah Body SFC eof OF TR_Amount0k LD 2 E TR_SmountsRONG IL JLo TR_Calculated LD l TR_End IL E Action Pool Lop AL calculate LD Joh AL Exit LD o wow LE A pit A number osp SSS me PLC program nas witenwihthe SO eos CO irtinscn teenie The Action Pool contains the individual actions which can also be written in different editors Tab 3 11 Key to figure above Assignment of actions to steps and of transition conditions to transitions is performed with the following toolbar icons i Fig 3 18 H Activate actio
45. cu lt c ece wie a oto eons Hee apne arel ew de eas dlgner wih area Be alee eee 6 2 Step 2 Creating TASKS sc a 2019 Sup e Scents Bk aoe Bee ai ah a Ho Soh HERES Bee SH ae ea Rw ins e 6 4 Step 3 Declaring Global Variables x icine wie deecnes pue agrada a Halle Sawai we eek eames ee ale 6 5 Step 4 Creating Program Organisation UnitS 0 0 0 0 cc ee ees 6 7 Step 5 Programming POU Headers io xcacwie ae uk dra a a ace eS Be He ad ee 6 8 Step 6 Programming POU Bodies 0 1 i 4 000 ca 66 20 oe Raed ec de bee SEDO Reed SE AEM HAS 6 9 afa MITSUBISHI ELECTRIC 6 7 6 8 6 9 6 10 6 11 6 12 6 13 6 14 7 1 Te 13 7 4 7 9 7 6 7 1 Contents Programming Examples oc or eae da eb ok SEO SG HH eR OG RAR EES HER he oes 6 10 6 7 1 Inputs and outputs in ladder diagram language LD 0 0 0 cee eee eee 6 10 6 7 2 A Sum Function in FBD Language 0 00 ccc eee eee ees 6 12 6 7 3 I O Signal Configuration Parameters 0 0 ce ee eee eens 6 14 6 7 4 Timers in LD FBDAL 6 5 cium o eee dc whet whe Oh eae Rede oe ee 6 15 6 7 5 Sequential Function Chart Language 0 ccc eens 6 20 Step 7 Checking PLC Programs syntax check 0 000 cece eee eee ees 6 36 Step 8 Configuring TaSkS aie lt add a pret ate ee wa SRS ae ee ee es 6 37 Step 9 Compiling Projects 6 opi as tae abeas dud tte bade ai cee a oo 6 39 Step 10 Communications Port Setup anaana aaa naa a
46. door down into the closed position Reset When no traffic is registered or the main switch is turned off and the door reaches the lower limit switch Door_Closed both the motor and the Time_Control relay are reset Body of the Counter POU E Countes PNG Body ILDI Fig 7 5 Entrance Enter Car Gone INC PM 4 EN TENO d Cars Numbers Entrance 2 f Exit Exit_Car_ Gone ODECE hl i i EN ENG el Cars Numbers Fuil Entrance The program counts the cars driving into the car park by incrementing the total number stored in the Cars_Number data register every time a car enters Exit Every time a car drives out of the building the program decrements the number stored in the data register The result is that the number always corresponds to the exact number of cars in the building GX IEC Developer Beginner s Manual 7 5 Program the bodies Step 6 in Chapter 6 Sample Program CarPark 7 6 3 Body of the Door_Control POU Conditions for activation of the door control routine The Door_Control POU can only be executed when the CPark_OK variable in the Control POU is set CPark_OK is only set if The main switch is on and No help call alarm is registered and No CO2 alarm is registered I Door_Control PRG Body LD Fig 7 6 ae Dons en Motor Up Open car park f pe i door Enter Up dp e en Motor Up Hesel Hre P ia Open Enter_ i Gone ila Wil Close car park door Exit il Gone Close c
47. e Selecting the ADD instruction Libraries Operators gt Last Recently Used 4 Position the mouse pointer and press the left mouse button to place the function block tb th Lap bt aha we ye o g Fig 6 24 TE i l Placing the function block 6 12 afa MITSUBISHI ELECTRIC Getting Started Programming Examples 5 Click on the dummy character of the input variable Overwrite the first dummy character with the number 12 and the second dummy character with the number 8 Fig 6 25 E i ar Ly Hg lr vaka AUAR p EE A So SF ee t Overwriting the i sum PRG Body LD dummy character Click on the dummy character of the output variable and then press 3 to display the ope rand list Select Sum and confirm with OK NOTE The variables will only appear in the operand list if the header in which they are declared has been saved EE ee ab e we me e o F La sum PRG Body LD FEF Variable Selection Mode New ar ES Scope Vanables Class Sum WAR Global ariables gt Identifier Manufacturer Lib Gn Standard Lib el Address Type ANY Type Type Class E JOL E Simple Types Initial ECE FALSE E YAR Sum BOOL FALSE Sum al Comment H Sum W Minimize Dialog after apply Apply lo Header New Off Close Help Update Fig 6 26 Declared variables in the header must have been saved GX IEC Devel
48. e box Select the correct port for your system configuration see Step 10 Confirm your entries in both dialogue boxes with OK This starts the upload procedure Progress and any errors are documented in a list box GX IEC Developer Beginner s Manual 6 43 Step 13 Uploading Data from the CPU Getting Started 6 44 afa MITSUBISHI ELECTRIC Sample Program CarPark Project Structure 7 NOTE 7 1 7 1 1 Sample Program CarPark This sample program is only intended as an illustration of programming and program structure techniques in GX IEC Developer In its present version it cannot be used as a basis for producing your own executable programs The sample version has been written for a MELSEC FX series controller Description The roll up door of a car park building can be opened from inside and outside with a key oper ated switch Safety functions included inthe program ensure thatthe door opens automatically in the event of an alarm and that it does not remain open for too long when no cars are entering or leaving the car park The program also keeps track of the number of cars in the building Project Structure Fig 7 1 Project structure Task Door_Operate POU POU ae Counter Control Control The Task Main always runs in the background with maximum priority This task contains the POUs Con trol and Counter which perform the following functions POU Control Car park status ch
49. e screen containing the declaration table for entry of the variables pp Sas Menten MIT Add IEC Addr Initial O VAR GLOBAL Fig 6 6 Declaration table of Global Variable List Click in the first cell in the Class column with the mouse cursor then click on the up arrow button and select VAR_GLOBAL or VAR_GLOBAL_CONSTANT Press L to move to the Identifier column then enter the identifier for your first global variable Press L to move to the MIT Addr or IEC Addr column Enter the absolute address of the global variable 60 Press to move to the Type column and click on the up arrow button with the mouse to open the Type Selection dialogue box Type Selection Fa Fig 6 7 Data type selection Libraries gt Type Class f Simple Types C Data Unit Types Function Blocks Cancel Help Select Simple Types in the Type Class field 7 Select the appropriate data type from the list on the left The initial value in the Initial column is assigned automatically and cannot be changed by the user If you want to enter a comment text for the variable press L to move to the Comment co lumn then enter your text GX IEC Developer Beginner s Manual 6 5 Step 3 Declaring Global Variables Getting Started NOTE To enter another variable If the editing cursor is active in the Comment column white background with blinking cursor you can create a new variable decla
50. eck Close car park door if no car drives in or out within a 60 second period Open car park door when an alarm is triggered POU Counter Count the cars GX IEC Developer Beginner s Manual 7 1 Create the new CarPark project Step 1 in Chapter 6 Sample Program CarPark 7 1 2 The Task Door_Operate Is event triggered It is activated when the OK signal for the car park door variable CPark_OK is set This task contains the POU Door_Control which handles the following functions POU Door_Control Open car park door when the key switches inside and outside the car park are operated Open car park door when an alarm is triggered NOTES GX IEC Developer allows you to apply an engineering design approach to project planning and programming This is illustrated in the CarPark project Steps S1 through S11 are fully documented In the sample program all the variables are already known and declared at the outset Of course this ideal situation is not always possible in actual projects one often has to make corrections and add and delete variables in the course of the programming work This flexible approach is fully supported in GX IEC Developer the system allows you to edit add and delete variable declarations at any time both during programming and afterwards 7 2 Create the new CarPark project Step 1 in Chapter 6 The first step is to create a new project Refer to the instructions in S1 and en
51. em and cannot be changed by the user Comment You can add a comment up to 64 k characters long for each variable Remark You can add additional user information GX IEC Developer Beginner s Manual 3 9 Data Types 3 7 2 3 10 Basic Terms Used in IEC 61131 3 Complex Data Types Arrays An array is a field or matrix of variables of a particular type For example an ARRAY 0 2 OF INT is a one dimensional array of three integer elements 0 1 2 If the start address of the array is DO then the array consists of DO D1 and D2 Identifier Address Type Length Motor_Volts DO ARRAY 0 2 OF INT In software program elements can use e g Motor_Volts 1 and Motor_Volts 2 as declara tions which in this example mean that D1 and D2 are addressed Arrays can have up to three dimensions for example ARRAY 0 2 0 4 has three elements in the first dimension and five in the second Arrays can provide a convenient way of indexing tag names i e one declaration in the Local or Global Variable Table can access many elements Data Unit Types DUT User defined Data Unit Types DUT can be created This can be useful for programs which contain common parts for example the control of six identical silos Therefore a data unit type called Silo can be created composing patterns of different elements i e INT BOOL etc When completing a global variable list identifiers of type Silo can be used This means
52. er configure the interlock circuit externally so that the system safety is ensured The action to be taken for the system at the occurrence of communication errors caused by such as loose cable connection must be determined for online operation of PLC from Personal computers CAUTION e Be sure to read the manual careful and exercise an appropriate amount of caution connecting to PLC CPU and performing online operations PLC CPU program change during RUN forced input output operation RUN STOP or other operation condition changes remote control operation while the personal computer is operating Regarding the PLC CPU program change during RUN Online change the program may be corrupted or have other problems depending on operation conditions Exercise the appropriate amount of caution with regard to the Caution points in the Reference Manual e Please refer to the manual of each module for online module change and swap module during run since there is restriction on the exchangeable module About this Manual The texts illustrations diagrams and examples in this manual are only intended as aids to help explain the functioning operation use and programming of the GX IEC Developer IEC programming and documentation system For using and usage of this software only the user his own is responsible If you have any questions regarding the installation and operation of the software described in this manual please do not hesitate t
53. er Diagram sss teeters 3 16 EIN escaneo gee sees oe as 5 5 INTFOdUCHON lt 4444 8 a wack bee eS OA Programming example 6 10 Programming languages gt 3 11 Local variables o S sa kee beats es s 3 6 introduction cs crasas a 9 5 Local Variables hice aera aeee se eeeseeeeeeeaae 3 7 LVL Siehe Local Variable List M Macro step TA 3 20 Manufacturer library 3 1 MELSEC Instruction List Editing aa daa dadas ds 5 5 Programming languages gt 3 11 Menu Dar ie oa rd es 5 2 MITSUBISHI address 3 8 N Navigator TEE eee eee eG 5 3 P Parame lon e ea e aaa oe HE 3 4 PLC configuration 3 1 POU Pool c teen eee ed oe ee oes ie 3 1 Program A e e ee a ee ae ae ee ee ae 3 3 INTOCUCION e ss a s s s 46 w amp amp DD Pollensa esas osas 3 0 Program Organisation Unit 3 2 Creating CRESE ROCHE ER SHEE SEE ESS 6 7 MtrOdUCTION e eras 6 we 40g ay 2 2 9 Programming language 3 11 Project xao y a sas ss 6 2 Project Navigator eset ees 6 3 Q Quitting GX IEC Developer 4 2 S Sequential Function Chart 3 19 Edinge eserse nest epee oes soe 5 5 INtOGUCHON e e oes ec eee 6 ee x 2 4 Programming example 6 20 Programming languages 3 11 Signal configuration 6 14 Standard library edaroniroian s
54. er diagram language see Step 4 2 Open the header of the new POU and declare the following variables 3585 SET_RST FB Header INT SET RST Fig 6 33 Declaring the variables in the header You can speed up this process by copying the variables that you have already entered in the Global Variable List and inserting them here Use global variables VAR_GLOBAL Use as local variables VAR The variable SET_RST1 is an instance of the function block SET_RST see Chapter 3 for details on instancing 3 Save the header Object Save GX IEC Developer Beginner s Manual 6 17 Programming Examples Getting Started 4 Open the body of the POU The timer we shall use is a function that is stored in the manufacturer library Lid Fig 6 34 Scope Operators The timer function is called TIMER_M TIMER_1 0 FRM Standard _Lib 4 TIMER_100_FB_M TIMER_CONT_FB_ TIMER_CONTHFE_ TIMER_HIGH_FB_ aw 4 Last Recently Used Operator Type Minimize dialog Al Types after apply Operators Honig f Functions C Function Blocks _ Close Humber of Pins E Help You can find instructions on how to insert function blocks in the editing window in the section on Sum Function in FBD 5 Create the following PLC program Gj DEMO_LD PRG Body LD Fig 6 35 Ladder Diagram Input TIMER_M EN ENO program example TIMER1 C TCail 100 T alue SET_RST1 SET
55. f the object on that level Egg Global Yars 4 entries 29 03 01 13 08 15 Egg Global Yars 4 entries 29 03 01 13 08 15 POU Pool 3 entries 26 02 01 14 46 15 E a POU_ Pool 3 entries 26 02 01 14 46 19 1x Der ag ILO PRG IL 01 02 01 14 49 14 A O O O OOOO Or MAIN _PARG_LO PRG LD 27 02 01 16 22 11 fOr stc 01 PAG SFC 26 02 01 14 46 19 Fig 5 2 Manoeuvring with the Project Navigator You can only perform the Cut Copy Paste and Delete operations on POU and Task objects You can copy and delete multiple objects at the same time To select individual multiple objects hold down the CTRL key and click on the objects one after the other with the left mouse button To select a consecutive group of multiple objects first select the first object with a single click then hold down the SHIFT key and click on the last object in the list you want to select NOTE The Extended Information command in the View menu enables or disables the display of additional information with the items in the Project Navigator window Project Navigator views Three different views can be selected for the Project Navigator via tabs below the Project Navi gator window Project This view gives a total overview of the project It contains all elements of the project Calltree For this view the corresponding root items are tasks or also POUs if they are not related to a specific task As subitems all used POUs are shown Additionally it ca
56. g instructions that can be replaced whenever neces sary and they can also be used in other program modules just like ordinary instructions NOTES Function blocks can be called by program POUs and other existing function blocks but not from functions The function blocks themselves can contain programming instructions from the libraries functions and other existing function blocks Function blocks pass one or more output variables as their result All the values of the output variables and the internal values within the function block are stored for the following execution of the function block These values are then used the next time the function block is invoked This means that invoking the same function block twice with the same input parameters does not necessarily result in the same output values Functions can contain programming instructions from the libraries and other existing functions Functions always pass an output value and they do not store any internal status information Thus you should always get the same output value every time you invoke a function with the Functions can be called by program POUSs function blocks and other existing functions same input parameters No output Outputs One output One output Multiple Outputs Repeated execution with same Does not always deliver the same Always delivers the same output input values output value value Tab 3 1 Differences Function Blocks and functions GX IEC
57. he actual parameters must then be passed to the formal parameters in the code programmed in the body 333 POU_3 PRG Header Fig 3 11 The formal parameters of function block Instance POU_9 are IN and Seen neem ee ee ne enen ee ee nen Ee een SESE ERO O OREO EER OOS SEES RE RROS EERE SSSES EEE OEO SERGE ER OOS SEES SOROS EERE SSSR SEER SSOORE SEO OSS ERESEORESSEEEI SSSR EGRESS EERE SSORSSNESEOSRESESESSSSRESEEEEOR SEES BOOL FALSE OUT Actual O Ch eee on e e e parameters TimerSt and Comeln are passed to these formal O parameters Commen Timers _ Reset IN Comeln Reset LIT Reset Number Description ssi o Declares the instance Reset of function block POU_9 e There are two ways to pass actual parameters to formal parameters There are two ways to pass actual parameters to formal parameters Tab 3 7 Key to figure above afa MITSUBISHI ELECTRIC Basic Terms Used in IEC 61131 3 Programming Languages Calling Functions When you call a function you must pass the necessary actual parameters to its formal param eters A total of n 1 actual parameters are assigned to every function where n total number of function parameters This is because the first parameter must always be written to the bit accu mulator with the LD instruction Example v T Set E T E A rn Fig 3 12 AVERAGE A Use of Average a function written by the user in IEC IL l language The function has 4
58. in the task To insert a new table line for the next POU entry select New Declaration in the Edit menu then select the position at which the line is to be inserted in the submenu When the cursor is on a comment cell that is currently in edit mode white background you can insert a new line at the end of the table automatically by pressing J GX IEC Developer Beginner s Manual 6 37 Step 8 Configuring Tasks Getting Started NOTE How to configure the task execution attributes Select the task to be configured in the Project Navigator window or in the task configu ration table select the grey number button in the first table column 2 Press Er to open the Task Information dialogue box The parameters in this dialogue box set the execution conditions and the security level for the current task Tasks can be either event triggered or interval triggered Full details on the vari ous execution options can be found in the Reference Manual eee Task Attributes CVEN EH AUE execute always Cancel Interval 0 because event triggered Comment Event Interval Priority Priority O Name MAN maximum priority Size 181 Bytes Priority 31 lowest priority Type TASK M imen nupu ico ntral Last Change 04 12 02 16 23 15 Security Level f AO s ote NE TO aE NE M Allow Read Access For Lower Levels The dialogue box also shows the current size of the task and the date and time of the las
59. ing on Extended Informa tion in the View menu a Y check mark is displayed next to the option when it is enabled The standard GX IEC Developer window background colour is light grey You can change all the colours to suit your personal taste with Colors in the View menu GX IEC Developer Beginner s Manual 6 3 Step 2 Creating Tasks Getting Started 6 2 NOTE NOTE Step 2 Creating Tasks How to define a new task Select the Project Navigator window 2 Select New in the Object menu then select the Task option Or Click on the New Task icon in the toolbar This tool icon is only displayed in the toolbar when the Project Navigator window is displayed on the screen i e when a project is open The New Task dialogue box is displayed Fig 6 5 Hame Task_Main Defining a new task Cancel 3 Enter a name max 32 characters for the new task and confirm with OK GX IEC Developer then creates the task and displays the name in the Task Pool in the Project Navigator window Assignment of the program organisation units POUs to the tasks and definition of the task attributes will be performed later on in Step 8 afa MITSUBISHI ELECTRIC Getting Started Step 3 Declaring Global Variables 6 3 Step 3 Declaring Global Variables How to declare global variables Double click on the Global_Vars branch in the Project Navigator This opens the Global Variable List window on the right hand side of th
60. ing to Know GX IEC Developer 2 2 Introduction to the IEC 61131 3 Standard IEC 61131 3 is the new international standard for PLC programs defined by the International Electrotechnical Commission IEC It defines the programming languages and structuring elements used for writing PLC programs Structured Programming The structured programming approach replaces the former unwieldy collection of individual instructions with a clear arrangement of the program into individual program modules These modules are referred to as Program Organisation Units POUs which form the basis of this new approach to programming Fig 2 1 Program organisation units POUs are used to implement all programming tasks Program Modules There are three different classes of POUs classified on the basis of their functionality O Programs O Functions O Function blocks POUs declared as functions and function blocks are effectively programming instructions in their own right and they can be used as such in every module of your programs afa MITSUBISHI ELECTRIC Getting to Know GX IEC Developer Introduction to the IEC 61131 3 Standard The final program is assembled from the POUs that you define as programs This process is handled by the task management in the Task Pool Program POUs are put together in groups referred to as Tasks Fig 2 2 The program POUs are grouped together in tasks Fig 2 3 Main PLC program In turn all the
61. is used to declare and store the variables used by the program that the POU contains In addition to global and local variables these declarations can also include instances of function blocks How to program the POU header Check that the Header and Body entries are displayed under the POU entry in the POU Pool and expand them if necessary see 3 in Step 4 2 Double click on the Header entry in the Project Navigator window This opens a window containing the declaration table for the header s local variables on the right hand side of the screen 3 Todeclare the variables proceed in exactly the same way as with the global variables in Step 3 above entering the class identifier and data type for each variable Initial Comment 4 Select Save in the Object menu to store your entries If you wish to enter global variables in the header you can copy them from the global variables declaration table cJicl and then insert them in this declaration table J The terms class identifier and data type are defined and explained in Chapter 3 afa MITSUBISHI ELECTRIC Getting Started Step 6 Programming POU Bodies 6 6 Step 6 Programming POU Bodies The body contains the actual code of the PLC program The programming language used is shown in the information in brackets following the Body entry in the project tree How to program the POU body Check that the Header and Body entries are displayed under the P
62. mes or absolute Mitsubishi addresses XO MO etc assigned to the program elements The use of symbolic declarations complies with IEC 61131 3 If symbolic declarations are used then the tag names must be cross referenced to real PLC addresses afa MITSUBISHI ELECTRIC Basic Terms Used in IEC 61131 3 Variables Local Variable List For a particular POU to access a Global Variable it must be declared in its Local Variable List LVL in the POU Header The LVL can be made up of both Global Variables and Local Variables A Local Variable can be thought of as an intermediate result i e if the program performs a five stage calculation using three values and ending with one result traditionally the programmer would construct software which produced several intermediate results held in data registers before ending with the final register result It is likely that these intermediate results serve no purpose other than for storage and only the final result is used elsewhere With GX IEC Developer the intermediate results can be declared as Local Variables and in this case only the original three numbers and the result declared as Global Variables The Global Variable List The Global Variable List GVL provides the interface for all names which relate to real PLC addresses i e I O data registers etc The GVL is available and can be read by all POU s created in the project GX IEC Developer Beginner s Manual 3 7 V
63. mpty uppermost box in the number box column selects the entire table You can then delete the selected line or table by pressing the DEL key The program performs these delete operations immediately without prompting for confirmation If you inadvertently delete something you can recover it by selecting the Undo command in the Edit menu Undo only works if you select it directly after the delete operation however Formatting Tables You can adjust the width of the table columns to suit your individual needs Move the mouse pointer to the dividing line between the shaded column title boxes so that the pointer changes to a double headed arrow Then press and hold the left mouse button and drag the shaded dividing line until the column has the desired width afa MITSUBISHI ELECTRIC The User Interface The Editors 5 3 The Editors Your PLC programs are always divided into a number of logical program sections referred to as networks These networks can be assigned names labels which can then be used as jump destinations within the PLC program New networks are inserted with the New Network command in the Edit menu To open an editing window simply double click on a Body entry in the Project Navigator window Text Editors O IEC Instruction List MELSEC Instruction List O Structured Text Graphical Editors O Ladder Diagram O Function Block Diagram O Sequential Function Chart Please refer to the Reference Manual for full det
64. n be defined per object if used global variables should also be shown Used by This view has exactly two root items The first root item is the POU pool with its POUs as nodes Subitems of the POUs and global variables are always POUs calling respectively using the cor responding POU or global variable GX IEC Developer Beginner s Manual 5 3 Declaration Tables The User Interface 5 2 NOTE Declaration Tables The local variables of program organisation units POU Header and global variables are defined in declaration tables 355 Global Variable List te GLOBAL INE AR GLOBAL 4 VAR GLOBAL d Fig 5 3 Global Variable List Working with tables You can access every cell in a table directly by clicking with the mouse When the insertion mark cursor appears you are in editing mode and can make entries You can move around in tables with the following keys and key combinations Key Movement 1 Line up Cell right a Line down iq Cell left Te Step through all cells from left to right Shitje Step through all cells from right to left Shit Entes Insert new line You can also add new lines to a table with the New Declaration command from the Edit menu You can insert a new line at the beginning end of the table or before or after the current line Deleting Tables and Lines Clicking on one of the shaded line number boxes at the left selects the corresponding line Clicking on the e
65. n transition condition Fig 3 19 Deactivate action transition condition GX IEC Developer Beginner s Manual 3 19 Programming Languages NOTE Basic Terms Used in IEC 61131 3 Sequencing Rules A sequence always begins with an Initial Step identified by a double outline The initial step does not have to be at the physical beginning of the sequence it can also be placed in other locations Steps are displayed as shaded blocks with names Transitions are shown as small boxes placed directly on the vertical connecting lines between the steps Only one step can be active at any one time this also applies in sequences with selective branching A step is activated when the directly preceding step is deactivated and the transi tion condition i e the continue condition is satisfied If the continue conditions of two or more transitions are fulfilled at the same time in a sequence with selective branching execution pri ority is defined by the order of the sequences from left to right This means that only the sequence that is furthest to the left will be executed Even if their continue conditions are satis fied the sequences further to the right will not be executed Fig 3 20 Graphical programming in the Sequential Function Chart editor ee O t I _TR_Amoun _TR_Amoun FAK A woe Again S_Calcul ate a Ltr calcu SP ated S Exit O o TEn Ag
66. no more than one contiguous circuit unit The functions and function blocks are displayed as shaded blocks in the editing window In addition to their input and output parameters some also have a Boolean input EN ENable and a Boolean output ENO ENable Out 00 E Fig 3 14 Spats EQ E Graphical programming in the AEN she PETA ladder diagram editor RealTime IN EN ENO 0 1440 IN d RealTime Light O Lightz O t gt A on number osn ooo S o remsa e eaw S yo o mw Tab 3 8 Key to figure above 3 16 afa MITSUBISHI ELECTRIC Basic Terms Used in IEC 61131 3 Programming Languages Calling Function Blocks Function blocks can only be called as instances The instance name must be declared in the header of the POU In the ladder diagram editor the name of the function block is displayed inside the shaded block The instance name declared in the header must be entered directly above the block Then the actual parameters must be passed from outside to the formal parameters shown inside the block Class Identifier Type Initial Comment Fig 3 15 o Reset Pous 7 mE Calling function blocks 1 VAR 2 Timersl BOOL F FALSE 2 VAR Comeln BOOL FALSE Instance POL_9 IN OUT Reset POL_9 IM OUT Reset Ou P q O Timers I AT Comeln Activation of function block POU_9 The word Instance above the shaded blo
67. ns the most important new terms and concepts of this industrial standard A glossary of all the terms is provided in the Appendix of the Reference Manual If you already have IEC 61131 3 experience and want to get to work right away then you can go straight to the Getting Started section for immediate results This chapter provides clear step by step descriptions of all important GX IEC Developer operations from creating a new project to downloading your finished program to the controller GX IEC Developer Beginner s Manual 1 1 If you get stuck Introduction 1 6 If you get stuck do not despair help is never far away If you run up against Seemingly insoluble problems or if you have questions about GX IEC Developer or the connected programmable controller PLC configuration please first refer to the manuals and documentation Many answers and solutions can also be found directly in the GX IEC Developer context sensitive online help system which can always be accessed by pressing the key Make use of the Search command in the Help menu as well as this will often locate the information you need If you can t find answers to your questions in any of these places contact your local MITSUBISHI ELECTRIC representative or call our European headquarters in Ratingen directly The addresses and phone numbers are provided on the back covers of all our manuals afa MITSUBISHI ELECTRIC Getting to Know GX IEC Developer Wha
68. o contact your sales office or one of your Mitsubishi distribution partners You can also obtain information and answers to frequently asked questions from our Mitsubishi website under www mitsubishi automation de The GX IEC Developer software is supplied under a legal license agreement and may only be used and copied subject to the terms of this License Agreement No part of this manual may be reproduced copied stored in any kind of information retrieval system or distributed without the prior express written consent of MITSUBISHI ELECTRIC MITSUBISHI ELECTRIC reserves the right to change the specifications of its products and or the contents of this manual at any time and without prior notice The IEC 61131 1 standard cited in this manual is available from the publishers Beuth Verlag in Berlin Germany October 2008 Beginner s Manual for MELSOFT GX IEC Developer Art no 43596 NOTE Example V Typographic Conventions Use of notes Notes containing important information are clearly identified as follows Note text Use of examples Examples containing important information are clearly identified as follows Example text Numbering in figures and illustrations Reference numbers in figures and illustrations are shown with white numbers in a black circle and the corresponding explanations shown beneath the illustrations are identified with the same numbers like this 0000 Procedures In some ca
69. o operands They contain the values of inputs outputs or the internal memory locations of the PLC system A distinction is made between two different variable types on the basis of their scope within the program as a whole O Local variables O Global variables Local variables When program elements are declared as Local Variables GX IEC Developer automatically uses some of its System Variables as appropriate storage devices within a spe cific POU These variables are exclusive to each POU and are not available to any other rou tine within a project Global variables Global Variables can be regarded as shared variables and are the inter face to physical PLC devices They are made available to all POU s and reference an actual physical PLC I O or named internal devices within the PLC External HMI and SCADA devices may interface with the user program using Global Variables Declaring Variables Before you can begin with the actual programming you should declare the variables you are going to use in the project as a whole global variables and in the individual POUs local variables Each variable declaration has the following elements Class Identifier Absolute address global variables only Data type Initial value automatically Comment optional Remark global variables only 1EC61131 3 Verses MELSEC Variables GX IEC Developer supports program creation using either symbolic declarations tag na
70. o the controller CPU Step 11 4 Monitoring mode for following the status of the program variables is explained in Step 12 afa MITSUBISHI ELECTRIC Importing 8 Importing There are two different ways to import projects created with the older MELSEC MEDOC pro gramming package for use in GX IEC Developer O Import by loading a MELSEC MEDOC print file O Import by uploading directly from the CPU Loading a print file to GX IEC Developer Procedures in MELSEC MEDOC Select a file name as the printer port The extension TMP is added automatically by the program 2 Make sure that only Instruction List and Name List are selected in the program listing options The Header must be switched off 3 Start the print procedure Procedures in GX IEC Developer 4 Open the body of an existing MELSEC Instruction List program or create a new POU and specify MELSEC Instruction List as the language Important Make very sure that the POU is declared as a program PRG In a network click on the left field reading MELSEC Open the POU body then select Import MEDOC Network in the Tools menu Qe This opens a file selection box Select the drive and directory and then select the print file TMP that you want to load and confirm your choice with OK This opens another dialogue Dox Confirm the settings with OK MEDOC Program Instruction List only MEDOC Symbolic Names Name list only 9 If necessary edit the system vari
71. oda 3 16 GX IEC Developer Beginner s Manual IX Contents 4 1 4 2 4 3 9 1 5 2 5 3 6 1 6 2 6 3 6 4 6 5 6 6 Installation Hardware Requirements nnana anaana Seed a A AA 4 1 4 1 1 Recommended Hardware Configuration 0 00 ees 4 1 4 1 2 Software Requirements 26 oe ned ctor a rar oes aos dead 4 1 Sojo ley AP OE E as See ge eee ee ee are 4 1 installing GX IEC Developer ss var a ce mi neh o teers ba Cha eee sede vaa 4 2 4 3 1 Installing GX IEC Developer on your hard disk 0 0 00 ces 4 2 4 3 2 Starting GX IEC Developer 0 0 eee eee ene 4 2 4 3 3 Quitting GX IEC Developer 0 2 ee eee ens 4 2 The User Interface The Elements of the User Interface 1 0 0 eee eee 5 1 SLI THe Menu ol es a ee ee ee eee ee ea A 5 2 512 IM DOM senos usados daa ee ada ad aire apa ER ae eae A 5 2 ES WINWNS ee seer aeren che desde ae oe SG oe ee here ae Oe ae oe eer 5 2 One TeS Ba areren Ense hae Eetoean se eieueeocaustagesuaeedsanecawataes 5 2 5 1 9 Me Project Navidad 24 6 a 06 oe tao 6 peon wd oa Bes oo ee ee ed Gee as Bom oes 5 3 Declaration Tables eiusucenacadateseneGeealestGaGotbagtads Hee eeateaanedaet san LER d 5 4 Wie EGNOS a4 0424 404 e RI 5 5 5 3 1 Using the text editors visa sir cone eek aa a ara Shae e 5 5 5 3 2 Using Ine graphical editors iu area dae alla nnani a discs eee we a eee de a 5 6 Getting Started Step 1 Creating NEW Projects 2 we ci
72. ompany name and serial number of the software Follow the instructions that appear on the screen 00065 When the installation procedure is finished the program will create a new program group in the Start menu containing the GX IEC Developer program icon For further details on the necessary Microsoft Windows procedures please refer to your Microsoft Windows documentation Starting GX IEC Developer In the Start menu click on the GX IEC Developer program icon The icon is located in Start gt Programs gt MELSOFT Application gt GX IEC Developer This starts GX IEC De veloper and displays the start up screen 2 Confirm with the E key Quitting GX IEC Developer You can quit GX IEC Developer directly at any point in the program by pressing the key combi nation J Or Click on the Quit command in the Project menu afa MITSUBISHI ELECTRIC The User Interface The Elements of the User Interface 5 The User Interface 5 1 The Elements of the User Interface The Project Navigator window and the complete menu bar are both only displayed after open ing an existing project or creating a new one see Step1 in chapter 6 Getting Started The illustration below shows a variety of different windows The Project Navigator PLC Parameter and the Header and Body windows of a POU You can resize and arrange the windows on the screen to suit your individual preferences TA a a A A ky 10 sue Bo Pet ABAD pi a de
73. oper Beginner s Manual 6 13 Programming Examples Getting Started 6 7 3 I O Signal Configuration Parameters Setting the signal configuration parameters of inputs and outputs Double click on an input contact an output coil or the connection point of a variable in a function block to display the Signal Configuration dialogue box Select the appropria te options then confirm with OK Fig 6 27 2 Signal configuration Normal C Negation i Set e Heset Cancel O v gt a O G v O IR o Negated input contact LD only Tab 6 1 Key to figure above 6 14 afa MITSUBISHI ELECTRIC Getting Started Programming Examples 6 7 4 Timers in LD FBD IL Description of the timer device All timers must have the following four elements T Value Set point value TN Actual value TC Output coil TS Input contact e Global Variable List Class Identifier MITA ddr 1ECWAdor VAR GLOBAL TIMERIC TCO YMS BOOL 4 VAR GLOBAL TIMER1S TSO AMS BOOL 3 YAR GLOBAL TIMERIN TNO Ya htyy S O INT Fig 6 28 The elements TN TC and TS must be declared in the global variables list Fig 6 29 7 eee gt The element TValue is passed to the function directly ea TValue The timer example The following example shows how to program a timer and a function block instance see Chapter 3 in ladder diagram function block diagram and Instruction List languages Objecti
74. or 3 14 POW eahGg404 4446 66446544682 3 9 Function Block Diagram 3 18 Biter 6224444242564 25e4855 5 5 introduction s es s s s sa e e bas J A Programming languages gt 3 11 Sample function ossos ossea 6 12 G Global variable lt lt lt lt e e e e e eee eee 3 6 Declaring 6 5 NTOdUCHON sas 44 4 42 6 oa es 9 5 Project ee ee ee ee ee ee ee 3 1 Global Variables EE ee ee aras ee 3 7 Graphical editors tsuru eds as 3 16 introductione s e se s se sasea 2 4 GVL Siehe Global Variable List H Hardware requirements gt 4 1 Heade e aa ee a a ee 3 2 Programming 6 8 Help Cas dass AAA 1 2 I donier as amics a a 3 8 Declaring tes es ss ss do sw 3 6 E address 6 eae ee ade eee eee ea 3 8 IEC Instruction List Editing ae eee Ae ee ee ee AS 5 5 introduction 254 264 46 ue 3 11 Index Initial step Programming 6 22 Sequencing rules 3 20 Witla VWalliG ses s ss asas Ee ee ee 3 6 ital VAIS e ou eee eee eee ee pardas 3 9 INnStaIIALION ae me 646446848584 ed 4 1 MSTINCO sde rss eee bud See os 3 4 Instancing PSS ee ee eee ea ee eee ee ee E 3 4 Instruction List ooo ea 3 11 introduction lt lt sess ssrt seg DA J Jump entry point ee ee 3 90 Jump exit point gt se sss s ee ee eee 3 90 L Ladd
75. or each object You can change the size and position of the win dows on the screen as you wish Objects often contain more information than can be displayed in the window when this happens horizontal and vertical scroll bars are included that can be used to scroll the contents of the windows up and down and from side to side The Status Bar The status bar at the bottom of the screen is used to display information on the current status of your project You can disable the status bar if you wish and you can also configure the informa tion to be displayed to suit your needs afa MITSUBISHI ELECTRIC The User Interface The Elements of the User Interface 5 1 5 The Project Navigator The Project Navigator is the control centre used for selecting and handling the objects used in GX IEC Developer This is the starting place for all operations performed on GX IEC Devel oper objects The Project Navigator window is not displayed until you open a project Closing the Project Navigator window automatically closes the project currently on screen Using the Project Navigator In the Project Navigator tree you can expand a branch by clicking on its symbol and col lapse a branch by clicking on its symbol Expanded and collapsed branches are identified by different symbols or in the tree You can also expand or collapse branches by double clicking on the appropriate branch icons Double clicking on the lowest level opens the window o
76. or the new POU and specify whether it is to be created as a program PRG a function FUN or a function block FB Then select the programming language editor to be used for the creation of the PLC program in the POU s body When you are satisfied that all your entries are correct select OK to add the new POU to the project Hew POU Project x Name Control Llass Cancel PRG FUN FB Language of the Body Fig 6 10 A new POU called Control is being defined and declared as a Program PRG type The PLC program in the body of the POU is going to be written in ladder diagram language Function Block Diagram See Lh eee ram MELSEC Instruction List Sequential Function Chart Structured Text Result toe ar Flora INT The new Control POU is then added to the project and appears in the POU Pool in the Project Navigator window Fig 6 11 The symbol to the left of Control in the project tree indicates that this entry has subordinate entries that are currently collapsed The asterisk in front of the term Control indicates that this POU has not yet been compiled Gg POU_Pool Fig 6 12 Every POU has two main components a header and a body a containing the actual program in the selected programming io Body LD anguage GX IEC Developer Beginner s Manual 6 7 Step 5 Programming POU Headers Getting Started 6 5 NOTE Step 5 Programming POU Headers The POU header
77. ration line by pressing J Comment Fig 6 8 TO Entering another variable or Select any cell in the last line of the table and press Sree Clima llantos MT Adel IEC Arlie yp EAE Comment Rlosrark Oar GLOBAL Fig 6 9 Entering another variable Or Select New Declaration in the Edit menu and then select the position in which it is to be inserted from the submenu Or Copy an existing declaration line First select the line by clicking on its number button at the left then press Leic to copy it to the clipboard Then select the insertion position by A clicking on the appropriate number button and press one ofthe icons EE tE to inserta new line above or below the selected line Click on the number ofthe new line and press cu Jlv to overwrite the new line with the copied line from the clipboard Save your new entries with Object Save The terms identifier address and data type are defined and explained in Chapter 3 afa MITSUBISHI ELECTRIC Getting Started Step 4 Creating Program Organisation Units 6 4 Step 4 Creating Program Organisation Units Program organisation units POUs always consist of two main parts a header and a body How to create a new program organisation unit GQ Click on the New POU icon in the toolbar This tool icon is only displayed in the toolbar when the Project Navigator window is displayed on the screen i e when a project is open NOTE 2 Enter a name f
78. s 2000 Professional with ServicePack 2 or higher O Microsoft Windows XP Professional up to ServicePack 3 O Microsoft Windows XP Home Edition up to ServicePack 3 O Microsoft Windows Vista 32 Bit up to ServicePack 1 Versions of Microsoft Windows which are based on double byte character sets e g Japanese are not supported Copyright WARNING This software is protected by copyright By opening the distribution disks package you automatically accept the terms and conditions of the License Agreement You are only permitted to make one single copy of the original distribution CD ROM for your own backup and archiving purposes GX IEC Developer Beginner s Manual 4 1 Installing GX IEC Developer Installation 4 3 4 3 1 4 3 2 4 3 3 Installing GX IEC Developer During the installation procedure the setup program will create a directory on your hard disk to copy all the GX IEC Developer files into Installing GX IEC Developer on your hard disk 1 Make sure that the correct Microsoft Windows version is properly installed on your computer For information on using Microsoft Windows please refer to the Windows User s Guide 2 Start Microsoft Windows 3 Insert the installation CD ROM in the CD ROM drive The GX IEC Developer installation program starts automatically if not execute the file SETUP EXE on the installation CD ROM Follow the instructions that appear on the screen Enter the user name c
79. ses the setup operation maintenance and other instructions are explained with numbered procedures The individual steps of these procedures are numbered in ascending order with black numbers in a white circle and they must be performed in the exact order shown O Text Text 3 Text Footnotes in tables Footnote characters in tables are printed in superscript and the corresponding footnotes shown beneath the table are identified by the same characters also in superscript If a table contains more than one footnote they are all listed below the table and numbered in ascending order with black numbers in a white circle like this O Text Text Text Character formatting and orientation aids Menu names menu commands submenu commands and dialog box options are printed in boldface type Examples The menu item New in the menu Project or the options PLC inter face and Computer Link in the dialog box Transfer Setup Please keep this manual in a place where it is always available for the users 1 1 1 2 1 3 1 4 1 5 1 6 2 1 22 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 Contents Contents Introduction PCa Sc Pe ee ee ee i ee ee ee ee ee ee ee ee A 1 1 THE helerence Manuales aurora dans ar had pda ale ea he Bee wad Brae ww hea da 1 1 If you are not yet familiar with MS Windows 0 0 00 0 eee ee eee eee 1 1 If you are not yet familiar with the IEC 61131 3 standard 20 0
80. t edit ing change Please refer to the Reference Manual for details on configuration of the read write access parameters afa MITSUBISHI ELECTRIC Getting Started Step 9 Compiling Projects 6 10 Step 9 Compiling Projects When you compile a project the system translates the program code into executable form to prepare it for downloading to the controller CPU How to compile a project Select Rebuild all in the Project menu The progress of the compilation process and any errors found are documented in a status window Fig 6 77 Errors A armings Errors are displayed and Used Retentive Timers 0 of 0 explained in the Used Counters O of 100 eed Labels 0af 32 Compile Check Messages Used Interrupt Labels 0 of 32 box O errors W Minimize Dialog after show Show Stop WARNING Compilation does not download the program code to the CPU this must be done separately Always perform a syntax check on the entire project before attempting to compile it Step 7 GX IEC Developer Beginner s Manual 6 39 Step 10 Communications Port Setup Getting Started 6 11 Step 10 Communications Port Setup Before you can download a project to the PLC you must first configure the communications port you are going to use for this purpose NOTE Before you begin make sure that you know precisely which physical interface on your personal computer is going to be used for transferring the data to the PLC system
81. t s New in GX IEC Developer 2 Getting to Know GX IEC Developer 2 1 What s New in GX IEC Developer GX IEC Developer is a Windows program GX IEC Developer uses the graphical user interface of MS Windows for fast intuitive operation This means that instead of laboriously searching through a labyrinth of program structures you can implement your controller applications quickly and efficiently GX IEC Developer increases your productivity The modular architecture of GX IEC Developer brings big advantages for complex program ming projects Frequently needed program blocks and functions only need to be created once Thanks to the building block system you can then insert them again and again wherever and whenever required This significantly reduces your programming overheads enabling you to make major changes to your programs with just a few simple operations GX IEC Developer is a multi language system GX IEC Developer supports programming in different languages Several graphical and text based editors help you to write tailor made programs quickly and easily choosing the lan guage that best suits the problem GX IEC Developer is your link to the IEC world GX IEC Developer supports the new IEC 61131 3 standard for PLC programmable controller programming This standard lays down the specifications for standardized PLC control pro grams GX IEC Developer Beginner s Manual 2 1 Introduction to the IEC 61131 3 Standard Gett
82. t them with one another using inter connect lines NOTE In Chapter 6 Step 6 you will learn how to use the different editors 96 afa MITSUBISHI ELECTRIC Getting Started 6 Getting Started This chapter contains an introductory outline of all the steps required to create a new project with GX IEC Developer with clear instructions on the procedures necessary in each step Steps Page Step 1 Creating New Projects 6 2 Step 2 Creating Tasks 6 4 Step 3 Declaring Global Variables 6 5 Step 4 Creating Program Organisation Units 6 7 Step 5 Programming POU Headers 6 8 Step 6 Programming POU Bodies 6 9 Programming examples Inputs and outputs in LD Sum function in FBD e O signal configuration parameters e Timers in LD FBD IL e Sequential Function Chart language Step 7 Checking PLC Programs syntax check 6 36 Step 8 Configuring Tasks 6 37 Step 9 Compiling Projects 6 39 Step 10 Communications Port Setup 6 40 Step 11 Downloading Programs to the PLC 6 41 Step 12 Monitoring Programs 6 42 Step 13 Uploading Data from the PLC 6 43 GX IEC Developer Beginner s Manual 6 1 Step 1 Creating New Projects Getting Started 6 1 Step 1 Creating New Projects How to create a new project Select New in the Project menu 2 This displays the Select PLC Type dialogue box Select your PLC in the PLC Type field and confirm your selection with OK Select PLC Type ES Fig 6 1 CET CPU type selection E Cancel PUE ex Pz
83. tasks are grouped together to form the actual PLC program POU 1 POU 6 POU n 1 Instructions Instructions Instructions Functions Functions Functions Function blocks Function blocks Function blocks POU 3 POU 7 POU n Instructions Instructions Instructions Functions Functions Functions Function blocks Function blocks Function blocks POU 4 Instructions Functions Function blocks GX IEC Developer Beginner s Manual 2 3 Introduction to the IEC 61131 3 Standard Getting to Know GX IEC Developer The Sequential Function Chart language SFC is also an aid for writing structured PLC programs It is particularly well suited for programming sequential operations Fig 2 4 An SFC sequence consists of a series Initial step of steps and transitions transition or continuos conditions Transition Transition Transition Transition Transition Programming Languages The actual PLC program code contained in the program organisation units POUs and the steps and transitions of an SFC sequence can be written in any of the available programming languages The language used will depend on the nature and size of the programming task The Text Editors Instruction List IL Structured Text ST O The Graphical Editors Ladder Diagram LD Function Block Diagram FBD Sequential Function Chart
84. ter CarPark as the project name in step 4 7 3 Create the tasks Step 2 in Chapter 6 Create the Main and Door_Operate tasks 7 2 e MITSUBISHI ELECTRIC Sample Program CarPark Declare the global variables Step 3 in Chapter 6 7 4 Declare the global variables Step 3 in Chapter 6 Declare the global variables shown in the table below The entries in the Comment column are optional cole Lihulal Y antadiles Last ldandifiar MIT A EC Addr Y _ Ini Comment oor Open ad TOL ENCIMA ALSE Upper door limi wtth 1 VAR GLOBAL Decor Closed xl fk BOOL ILSE Lower door limit patch 2 VAR GLOBAL fe Time Control Wii Shi 1 Tee ISE Inmama l relay for ihe choca 3 VAR LOCAL Molor Ap O TAA BOUL FALSE Molor rolls car park door WAR GLOBAL Motor Down ri max BOOL ALSE Malor rolls Gar park door SWAR GLOBAL Sj enter Up A AD BOUL l SE Key svalch door open for BWAR GLOBAL Exe Up X3 Wg BOOL SE Key swich door open for YAH Gl DAAL Ent Car Gone piel ii EXCH i SE Phabaalacime haih la 8 VAR_GLOSAL Em Car Gons x Wis BOL FALSE Photoelecine bamer foe q VAR GLOBAL Max Time_Lp_C 0 4550 BOL ALSE Timer coil When the lime 10 WAR G HEAL Maz Time Up_S Tan LAA RLU ALSE Tumor Comact When tha 1 WW VAR_GLOBAL Main_Switch E WOS BOOL E Main ewttch Car park doc 2 VAR_GLOBA He ip Alan MF pe Ro J SE Alem wiih IJ VAR G LOBAL e CO2_ Alem OG BOL Col sensor 14 VAR GLOSAL miCPark k TAOD D EXI SE i signal Car park door 15
85. that the predefined group called Silo can be used with the elements defined as required for each silo thus reducing design time and allowing re use of the DUT afa MITSUBISHI ELECTRIC Basic Terms Used in IEC 61131 3 Programming Languages 3 8 3 8 1 NOTE 3 8 2 Programming Languages GX IEC Developer supports five programming languages Two text languages two graphical languages and one structuring language O Text language Instruction List language IL IEC IL and MELSEC IL Structured Text ST O Graphical languages Ladder Diagram language LD Function Block Diagram language FBD O Structuring language Sequential Function Chart language SFC WARNING You cannot change the programming language once you have selected it Even though it is physically possible to switch to another language you will lose the entire contents of the unit s body if you attempt to do so Networks In all the editors with the exception of the SFC editor and ST editor your PLC program is divided into anumber of program sections referred to as networks Each network is assigned a name the network label which can be used as a destination for jump goto instructions Each network can contain no more than one contiguous circuit unit The Text Editors The following text editors are supported O MELSEC Instruction List O IEC Instruction List O Structured Text The structure of all Instruction List types is identical Each
86. the control menu button The step will now be displayed with a grey fill colour Initial Fig 6 73 Fill colour indicates assigned actions or om Boolean variables to the steps _ 6 8 Step 7 Checking PLC Programs syntax check How to check your program for syntax errors Select the object to be checked in the Project Navigator window Select Check in the Object menu or Click on the Syntax Check tool icon in the toolbar If the syntax check program finds any errors they are displayed and explained in the Compile Check Messages box Compile Check Messages Al ES Fig 6 74 Errorsw amings Errors are displayed and explained in the Compile Check Messages box Error C5060 Function block instance not alowed as inout parar Process PRG Procezs PAG Header Process PAG Action error W Minimize Dialog after show Show Stop 3 Youcan display the source of any errors found automatically Double click on the correspon ding error message in the Errors Warnings list or select the message and click on the Show button This calls the object containing the error with the source of the error highlighted in red NOTE You can perform syntax checks both on individual objects and the entire project as a whole You can also perform separate checks on the header and body of a single POU Simply selectthe objectto be checked in the Project Navigator to check the entire project selectthe
87. ut Fig 6 39 The Process program Program execution When the PLC is switched to RUN mode Output1 is set The transition TRAN_1 performs a TRUE FALSE poll of Input1 If Input1 is set Step_1 and Step_1_a are both activated Output2 blinks and Output3 is switched on continuously The transition Input2 polls Input2 If the latter is set Step_2 is executed and Output4 is set In the subsequent branches to Input3 Input4 and Input5 a variety of program sequences then execute in parallel If Input3 is set this activates Step_3 Input5 activates the jump exit point Jump which leads to the jump entry point Jump and also activates Step_3 Step_3 sets Output5 If Input4 is set this triggers Step_4 which then switches Output6 Input6 and Input7 lead to the end of the program GX IEC Developer Beginner s Manual 6 21 Programming Examples Getting Started Creating the program Perform steps 1 through 8 in the order described Step 1 Create the POU Create a new POU called Process Select PRG program as the class and Sequenti al Function Chart as the programming language see Step 4 ag Process PRG Fig 6 40 The new Process POU is displayed in the Project Navigator sty Body SFC Fa A Action Pool In addition to the header and the body each POU written in SFC language also has an action pool entry in which the actions assigned to the
88. ve When Inputi is set the 100 ms timer Timer1 must start to count and continue until it reaches a value of 100 We want Output1 to be set when Input2 is set and we want Output to be reset again when the set point value of 100 is reached Algorithm Input2 and the timer contact Timer1S TS are responsible for switching Output1 This function will be performed by the user programmed function block SET_RST Input1 activates the timer i e it controls the switching of the timer coil Timer1C TC The set point value TValue is 100 The timer function will be implemented by using the manufacturer function TIMER_M GX IEC Developer Beginner s Manual 6 15 Programming Examples Getting Started Creating the program Step 1 Program the function block SET_RST Create a POU called SET_RST and define it as a function block to be programmed in ladder diagram language see Step 4 2 Enter the following three variables in the header SET RST and Q 3 Insert two network circuit blocks in the body 331 SET_RST FB Header OD VARLINPUT SET Input COCA VAR INPUT FIRST Input SIVAR OUTPUT Fig 6 30 SET and RST are input variables VAR_INPUT Q is an output variable VAR_OUTPUT Q is set when SET is active and Q is reset when RST is set You can configure the S set and R reset parameters by double clicking on the coil symbol 4 Save the header and the body Object Save Selectthe
89. when actions are associated Your current position in the sequence is indicated by a block cursor displayed as a black rectangle around the elements that can be moved around at will in the editing window with the mouse or cursor keys The tool icons activated in the toolbar change depending on the current position of this cursor you cannot use all the tools at all positions in a program Step 4 Create the sequence Select the TRUE transition with the block cursor Fig 6 43 Selecting the TRUE transition 2 Click on the tool icon Inserts a new step and transition pair initial A aie Inserted new step and transition pair 3 Select the step you have just inserted a Fig 6 45 ae Selected new step GX IEC Developer Beginner s Manual 6 23 Programming Examples Getting Started 4 Click on the tool icon Inserts a right divergence and a new step Fig 6 46 Inserted new right divergence and step Select the TRUE transition Initi Fig 6 47 nitial 7 Selected TRUE transition on the tool icon Click Inserts a right convergence Fig 6 48 Inserted new right convergence 6 24 afa MITSUBISHI ELECTRIC Getting Started Programming Examples D Select the TRUE transition Fig 6 49 Selected TRUE transition on the tool icon Click El Inserts a new step and transition pair Fig 6 50 Inserted new step and transition pair 9
Download Pdf Manuals
Related Search
Related Contents
Muli Pro - ACO Haustechnik Kenroy Home 20140AW Installation Guide Une nouvelle exigence de conformité imposée aux vendeurs JVC VN-C655 User's Manual P8H61-M LX R2.0 Serie P-1 Panasonic CF-VZSU53AW rechargeable battery Sony MZ-R30 User's Manual Copyright © All rights reserved.
Failed to retrieve file