Home

GX Developer Version 8 Operating Manual

image

Contents

1. PLUS W f 0200 Seen Ad Connect a data register for inputting numerical information from the outside to the input variable INT In this example the numerical information of D100 is da medi stator oU stored into PLUS1 9 putting information from the output variable INT to the outside In this example PLUS2 stores the numerical information into D200 The display specifications of the input and output ladder sections are as follows a Display width of the input ladder section Equal to the widths of four contacts Display width of the output ladder section Equal to the widths of three contacts one coil Return connection cannot be made in the input and output ladder sections Therefore when a ladder cannot be created in the above display width use an internal relay or like to continue the ladder in the other ladder block 3 26 3 26 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 4 The input variable output variable of the FB does not result in an error if it is not connected from the input ladder section output ladder section After conversion of the sequence program the unconnected input variables output variables are displayed in the form that they are connected to the FB by horizontal lines from the left bus in
2. se es M M oe Note that the NCAUTION level may lead to serious consequences according to the circumstances Always follow the precautions of both levels because they are important for personal safety Please save this manual to make it accessible when required and always forward it to the end user Design Precautions N WARNING e When data change program change or status control is performed from a personal computer to a running programmable controller create an interlock circuit outside the programmable controller to ensure that the whole system always operates safely Furthermore for the online operations performed from a personal computer to a programmable controller CPU the corrective actions against a communication error due to such as a cable connection fault should be predetermined as a system Startup Maintenance Precautions N CAUTION e The online operations performed from a personal computer to a running programmable controller CPU program change when a programmable controller CPU is RUN forced I O operation operating status change such as RUN STOP switching and remote control operation have to be executed after the manual has been carefully read and the safety has been ensured When changing a program while a programmable controller CPU is RUN Online program change it may cause a program
3. 3 E r 38 0 300ms RUN MAIN The following dialog box appears if the FB definition window or FB variable setting window has already been displayed MELSOFT series GX Developer This will close the Function Block definition window and will display the Function Block window Are you sure Clicking the button closes the FB definition window or FB variable setting window and displays the FB window 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 11 2 Testing the sequence program Device test Setting Purpose Forcibly turn ON OFF the bit device of the programmable controller CPU or change the current value of the word device to check the created sequence program The FB pasted to the sequence program can be device tested like the contacts and coils The program in the FB can also be device tested like the sequence program Operation Procedure Choose Online Debug Device test or click Alt 1 Dialog Box Word device buffer memory amp Device PO C Buffermemory Module start l O Hex Address z ic E Setting value DEC 16 bitinteger Set Setting Procedure The following example explains the device test conducted on the FB pasted to the sequence program 1 Choose the target label of the FB to be device tested PLS SET N10 PLS RST N10 INGP D100 0 144 0200 K999 10 1
4. 3 28 Replace Instruction 3 28 Replace statement note type 3 28 5 Search Cross reference list 3 28 Find character string 3 28 Find comment 2 2 3 28 FING CONLACE OF COll ciate nines tect 3 28 FIN GOS VIC 3 28 Find instruction sseseuuuse 3 28 FING SUSD 3 28 List of used device 3 28 Sequence program window 1 3 3 28 Statement ss oov Poenis 3 30 Index 1 V Variable 3 11 W WME TO PEG 3 37 Index 2 Index 2 Microsoft Windows Windows NT Windows Vista are registered trademarks of Microsoft Corporation in the United States and other countries Pentium is a trademark of Intel Corporation in the United States and other countries All other company names and product names used in this manual are trademarks or registered trademarks of their respective companies SPREAD Copyright C 1998 FarPoint Technologies Inc SH NA 080376E L GX Developer Version 8 Operating Manual Function Block GXDEV8 O FB E SH NA 080376E L 1001 MEE MITSUBISHI ELECTRIC CORPORATION HEAD OFFICE TOKYO BUILDING
5. Compile Completed Local label is re allocated Write the program to PLC or Compare with the program in PLC before execute RUN write functian and change TC variable for PLC The comment of label will overwrite on device comment All right Compile error All programs Program name Error step 5 Illegal device type 1 14 Illegal device type RA2 23 Illegal device type RAT 32 Illegal device type 2 FBADD 3l 2 FB ADD_2 L 2 3 2 ADD 2 P ADD 3 P Compile error All programs appears if errors occurred over multiple programs Compile error Detail appears if errors occurred in one program only 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 2 If not converted compiled the sequence program is provided with in the window title Not yet compiled No marking Already compiled i MELSOFT series GX Developer C4MELSECXGPPWAqcpu 2 LD Editmode MAIN 72 Step 3 The program executed after Convert Compile is not displayed on GX Developer In the converted compiled sequence program devices are assigned to labels in accordance with the Auto device setting The Auto device setting defaults to the following device ranges 1 Word device D6144 to D12287 2 Bit device M4096 to M8191 3 Timer T64 to T2047 4 Counter C512 to C1023 The devices assigned to the labels are used in order starting with the last numbers D12287
6. 4 Specify new module start I O address for the lowest module start I O address set in the FB definition The batch of module start I O addresses will be changed as shown below Before FB definition body change I START 2 VN EL MOV H6 G GETE U4 V CTRL DATAl READ DAT V COMPl ON ZP CSET Ug Kl V CTRL DAT 2 V DUMMY COMP2 RST 0 END The lowest module start I O address in the FB definition is displayed Module start address setting FBName Cancel E arlier module start address H New module start address HEX 20 It changes the module start address of Function Black definition Device sy Abos rr IL After FB definition body change I START X35N tia N MOV 5144 477 06 V CTRL D T I READ _COMP1 77 ZP CSET FDA Kl V 2 V DUMMY _COMP2 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT The module start I O addresses I O devices on the active FB definition screen will be changed The active FB definition screen can be confirmed by checking the title bar or module start I O address setting screen of GX Developer 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 Creating the Sequence Program 3 1 Editing the sequence program Setting Purpose Create an input ladder section and an output ladder section for the FB pasted to the sequence
7. Eg qcpu_the Function B Window Ladder program 18 18 x P MELSOFT series GX Developer C MELSEC Gppw qcpu_fb FBLD Edit mode ADD 1 72 Step Project Edit Find Replace Convert View Online Diagnostics Tools Window Help S selel eee eel lal a ft ei ee s e E mial zz pz Ls aeaa sra 6 y PLUS1 PLUS2 gt PLUSI 500 IN2 RA1 INT lt PLUSI K499 Kt PLUS1 PLUS2 2 E qcpu fb B fe Function Block ADD_1 Project FB Body Q02 H Host station lovrwrte Num 3 CREATING NEW SEQUENCE PROGRAM USING FB Mili Be ST Nis 25 212 x mc Convert View Online Diagnostics Tools Window Help 81 818 sls eal alel Global vari al E sr Tr xj 1 4 PIA 1 4 i T 4 j 8 cho vir F7 GE rs PLU BPLUS 3 Kl D123 OUT MONL M0 2 D100 IN1 2 OR INZ BKCMP GE M INl F PLU IN1 BPLUS 3 M INl Kl10 2 OUT 0 OUTL AND NOT IN2 OUT2 NOT AND IN2 Ready 025 Host station row 15col 1 Insert NUM Program Creation MELSOFT 1 To create an FB definitio
8. Refer to GX Developer Operating Manual Structured Text Refer to GX Developer Operating Manual Structured Text Refer to GX Developer Operating Manual Structured Text Refer to GX Developer Operating Manual Structured Text Each operation can be performed in any order independently of the above procedure MELSOFT 2 GENERAL PROCEDURES FOR EDITING THE FB MELSOFT MEMO 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 CREATING NEW SEQUENCE PROGRAM USING FB The following explains the operations to be performed to create a new sequence program using the FB This chapter is designed to create the following FB definition program body FB variables and sequence program 1 FB definition program Hi PLUS E500 ki PLUS PLUS He Rat IH amp PLUS 1 499 10 PLUS 1 PLUS H2 RAZ 2 Constant Device type La fing BO 2 VAR INUT v IN2 pon rj xu o NT 011 oS f fp LS mE N10 5 L N10 NP 0100 The sample project fb of the sequence program described in this chapter is contained in the CD ROM of this product After installing GX Developer choose Project Dpen project to open the sample project 3 1 3 1 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT Handle the FB as described below 1 Create
9. 8 2 Printing the FB Definition Setting Purpose Print the FB definition program and or FB variables of the FB definition Operation Procedure Choose Project Print or click Ctr P Dialog Box X Structure parameters Redundant parameters Network parameters Device comment Device memory Device init Cross reference list List of Used device setting Project contents list Product information list Tile MELSAP23 MELSAPL Ladder Instructionlist ST Label FB Global variables Local variables selection Local variables MAIN Spei lear selection MAIN 1 ADD 1 Select Clear 2 ADD 2 selection 6 Ladder Instruction list ADD 1 Ladder contacts Indication the same 3 Additional information Device Comments Sug Jia Statement nate Speci the number of Ies of the device comment Printer setup Page setup Multiple printing Prnt Print preview Description 1 Header Turning on the check box prints the FB variables 2 Body Turning on the check box prints the FB definition program Choose the program format from Ladder or List It defaults to Ladder 3 Additional information Select whether the FB definition program to be printed is annotated with device comments and or statements notes Select the corresponding check box to annotate the program The number of device comment lines to be print
10. M0 END IF FBl 0 TEST 0 2 TEST 0 FB2 0 TEST 0 IF 5 LBL TRUE THEN FB NEW INL M0 M0 PLUS1 D10 PLUS2 D100 0UT1L 0 00 M0 END IF Inputs the external numerical information Outputs the numerical information from the to the input variable word output variable word to the outside 3 The other FB cannot be used in the FB definition program 4 For the FB definition do not create the program that jumps to outside the FB definition Example CALL instruction that jumps to a subroutine program 5 Create a program on the FB definition window starting with step O The FB definition program does not have an END instruction Entry of an END instruction will display an error 6 After program creation is complete convert the program Make program conversion in any of the following three operations a key b Convert Convert Compile c Right click on the FB definition window and then choose Convert Compile for ladder only 7 On the FB definition window the window title is provided with to indicate that the program is not compiled 5 series GX Developer C MELSEC GPPW qcpu_fb2 FBLD Edit mode ADD_1 34 Step Not yet compiled o No marking Already compiled 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 8 Note the following when creating the FB definition program with labels a Index qualification cannot
11. 4 Since the numerical device that may be handled by an input variable is up to a double word the instruction exceeding three words in input count cannot be input from the outside To input three or more words from the outside use an actual device as the device for storing an input value or create the input instructions by the number of necessary times 5 Since the numerical device that may be handled by an output variable is up to a double word the instruction whose result will be three or more words cannot be output to the outside To output three or more words to the outside use an actual device as the device for storing the result 1 OVERVIEW MELSOFT 2 For creation of sequence program including FB a Specifications Specifications Language of sequence Ladder ST program that can be created Already compiled FB Pastable FB If you attempt to paste the FB not yet compiled GX Developer displays an error message 1 pc Number of FBs that may The output from the FB cannot be connected directly to the input of be pasted to one ladder the other FB If you want to connect the FBs receive the output block from the FB with a coil once and then connect the contact of that coil to the input of the other FB b Precautions 1 A return connection cannot be used with an input ladder section and an output ladder section Return connection cannot be programmed DEG_1 FB1 0200 0100 0 gt
12. M8191 T2047 C1023 The following is the example of a program executed after convert compile a Sequence program This ladder example stores 100 into D400 when XO turns on as the value of D400 exceeds 4000 UIRDCFET H 0400 FB definition program ini iz TETTE in 1 4 kH P E100 out io Assigned Device M8191 D12287 D12286 IS J Ama 12287 aD 131 2 8191 iz Diz227 HA 1 we E100 012287 sn 12287 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT The contact X1 in the input ladder section and the devices D400 in the input and output ladder sections cannot be replaced directly by the labels in1 in2 and out10 in the FB definition program The contact X1 is connected to the coil of the device M8191 assigned to in1 The device D400 in the input ladder section always transfers data to the device 012287 assigned to in2 The device D12286 assigned to out11 always transfers data to the device D400 in the output ladder section Since D12286 D 12287 in this executed program are undefined at the startup of the programmable controller CPU D400 changes to an indefinite value in the output ladder section if D400 in the input ladder section is less than 4000 To avoid such a state connect the same labels and set the variable type as I O variables Setting the variable type as the
13. 2 gt 1 4 SOCUOLDL eit e 1 4 FS lab m mM etapa HE 1 2 3 16 1 FB variable setting window 1 3 FB WING OW 1 4 I variables iss 3 8 3 11 Input ladder section 3 21 Input variable 3 8 3 11 Insert button eeeeeeeeennn 3 12 L EADE Mean 3 11 eh eee enced 3 38 NOTE ei eee 3 30 Online program correction 3 44 Output ladder section 3 21 Output variable 3 8 3 11 P Printing Printing the FB definition 8 6 Printing the sequence program 8 1 Prograr DOO 1 2 mire neers ener a ONES 3 3 8 5161 Gl gt D 1 4 R REA from PEG 5 2 3 36 Replace Change module start address 3 28 Change open close contact 3 28 Replace character string 3 28 Replace device
14. 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 Trade and Industry for service transaction permission Specifications subject to change without notice
15. FB definition is to be executed the following message appears to indicate that conversion has been stopped if the sequence program that includes the FB definition FB to be deleted is not yet converted MELSOFT series GX Developer A Execution is not possible because program containing Function Block is not changed Before executing delete convert the sequence program or delete the ladder block that includes the FB first from the sequence program 6 COMBINING MULTIPLE PROGRAMS INTO ONE MELSOFT 6 COMBINING MULTIPLE PROGRAMS INTO ONE 6 1 Combining Sequence Programs into One Setting Purpose When multiple sequence programs including FBs exist combine the sequence programs into one Setting Procedure The sequence programs including FBs cannot be combined into one by the operation performed using Merge data in the Tools menu Hence perform copy and paste operation between the sequence programs in the same project to combine them into one The procedure will be described using the following two programs as an example a Copy destination program MAIN END 57 PLUS 4 0201 131 1 Select and copy the area from step 0 to the necessary step of the copy source sequence program H 2 5 1182 100 ADD 2 FB1 D200 131 END 6 COMBINING MULTIPLE PROGRAMS INTO ONE MELSOFT 2 Paste the copied sequence program to the step of the c
16. Help S e e ele Ie Gere If ae ca Al 18 x 18 x OR IN2 BKCMP GE M INl PLUSl D200 D100 INl1 BPLUS 3 M INl Kl D123 PLUS2 OUT 1 0 Function Block ADD ST1 Header OR INZ Body BKCMP GE M INl PLUSI D100 D100 INl ADD1 BPLUS 3 M INLl Kl10 PLUS4 PLUS2 OUT M INl MO OUTL AND NOT INZ FB definition DUT2 NOT AND IN2 FB variables Program body Project FB Ready Host station 15co 1 inset FB definition program 2 Window used to create FB definition labels variables FB variable setting window This window is used to define the labels used for the FB definition ji MELSOFT series GX Developer CAMELSECXGPPWAqcpu fb FB variable setting ADD 1 Project Edit Find Replace Convert View Online Diagnostics Tools Window Help 7 18 TETESET 2188 ale sie JF x Fs ees Fe eee Fla 7 7 a m rs o el IE 4 age amp Edit operation gt fb 2 58 Function Block Register Insert Add 2 28 ADD_1 Close Delete amp H Header B
17. Operating Manual of oss SH 080373E Explains operation methods such as creating printing monitoring and debugging programs using GX 13JU41 Developer Sold separately GX Developer Version 8 Operating Manual Structured Text SH 080367E Describes operation methods such as creating and printing structured text ST programs using GX 13JU37 Developer Sold separately MELSEC Q L Programming Manual Structured Text Explains the programming methods in structured text language SH 080366E 13JF68 Sold separately Structured Text ST Programming Guide Book Intended for beginners i e those who will create structured text ST programs for the first time SH 080368E Explains basic operation methods and functions through sample programs 13JF69 Sold separately The Operating Manuals and Structured Text ST Programming Guide Book are included on the CD ROM of the software package in a PDF file format Manuals in printed form are sold separately for single purchase Order a manual by quoting the manual number model code listed in the table above Abbreviations and Generic Terms in This Manual This manual uses the generic terms and abbreviations listed in the following table to discuss the software packages and programmable controller CPUs Corresponding module models are also listed if needed Generic terms and abbreviations eipevsiansr Generic product name of product types SW8D5C GPPW E SW8D
18. THE PRODUG iU A 2 Riz Ael nere A 3 INTRODUC TION C 4 CONTENT ee A A 4 ees rie eee ea 6 Abbreviations and Generic Terms in This 0004200000 A 7 ETW Mats Function BOCK 1 1 Mea TT Md 1 2 1 3 Layouts and Names of Windows for Creating 1 2 1 4 What You Should Understand Before Using the 1 5 E 1 5 COMpalIDIG CPUS 1 5 1 5 2 Specifications of and precautions for the nnne nnns 1 6 2 GENERAL PROCEDURES FOR EDITING THE FB 2 1to2 2 3 CREATING NEW SEQUENCE PROGRAM USING FB 3 1 to 3 44 SNO rule NCW IP TOF IB 3 3 3 2 Adding New FB Definition to the Created 3 5 39 Creaund FB Dennom Progra E 3 7 OA Creating FB Variables siti
19. USING FB MELSOFT 3 4 Creating FB Variables Setting Purpose Set the variable types constant values device types and comments to the labels variables used in the FB definition program The FB variables must be paired with the FB definition program body Operation Procedure Double click Function block on the lt lt FB gt gt tab and double click Header or double click Header individually z EB fb amp Function Block a qcpu fb 2 58 Function Block Window 6 Edit operation Register Insert Add jt Close Inut Oupu Label Constant Device type Comment 1 Oa rj 2 vak INPUT iN2 E 3 s La e 3 5 vanourur vou 6 vgourur Csel ae gt gt 1 2 3 Description 1 Input Output Choose the label type There are the following four different types VAR INPUT Variable input from the FB outside VAR OUTPUT Variable output to the FB outside VAR IN OUT Variable having the functions of both the input and output Blank Variable used in the FB inside 2 Label Set the label variable used in the FB definition program 3 Constant oet a constant value when you want to set a constant to the label where Blank has been selected for the variable
20. reo oaa 3 13 3 5 Converting the FB Definition Convert 3 16 3 6 Pasting the Converted FB to Sequence Program FB 3 18 3 6 1 Pasting the FB definition to sequence program 44 440008889 nnne 3 18 3 6 2 Changing the name FB name of the pasted FB FB name changing 3 21 3 6 3 Changing the module start I O addresses of the FB 3 23 3 7 Creating Sequence Program x23 aote eed 3 25 3 7 1 Editing the sequence nennen nnns enhn rnnt reas insana sanari 3 25 3 7 2 Confirming the data of the pasted 3 28 3 7 3 Searching replacing the sequence program 3 30 3 7 4 Creating displaying the comments statements or notes Sentence creation 3 32 3 8 Converting the Sequence Program into Program to Be Executed on the Programmable Controller CPU Convert 3 33 3 9 Reading the Sequence Program from the Programmable Controller CPU Read from PLC 3 36 3 10 Writing the Sequence Program to the Programmable Controlle
21. the input ladder section or from the right bus in the output ladder section In this case the input variables are indefinite and the output variables are not output to the outside 5 Edit the sequence program that includes the FB as described below a Cut copy can be made in one ladder block including the FB Cut copy cannot be made only in any ladder section of the input ladder section FB and output ladder section Since the copied FB is judged as the FB different from the copy source FB the FB name changes automatically from FB1 to FB2 to FB3 b A row can be inserted in one ladder block including the FB c row can be deleted in one ladder block including the FB d A column cannot be inserted where a ladder return occurs e A column can be deleted in the input ladder section output ladder section f Macro registration utilization cannot be performed in the ladder block that includes the FB 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 2 Confirming the data of the pasted FB Setting Purpose In the pasted status the data of the FB pasted to the sequence program are hidden to simplify the display of the sequence program Perform this operation when you want to confirm the data of the FB during creation of the sequence program Operation Procedure 1 Double click the corresponding FB 107 3 8 fb 89 Global variables x Program 9 8 Device
22. type Enter a constant value with K H E for ease of identifying that it is a decimal hexadecimal real number or character string constant 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 4 Device type For the input output and variables choose any of Bit Word Double word Real number and Character string The contents of the devices are as follows 1 BOOL Data represented by ON OFF 2 INT Data represented by 16 bits 3 DINT Data represented by 32 bits 4 REAL Floating point data represented by 32 bits 5 STRING Character string data represented by JIS8 code For the internal variable choose any of ARRAY TIMER COUNTER STORED TIMER and POINTER 6 Array Specify the number of data to be handled when multiple data such as the BMOV or FMOV instruction are handled Selecting STRING or ARRAY displays the corresponding one of the following dialog boxes Number of letters The input range is 1 to 50 characters Number of elements e The input range is 1 to 255 5 Comment Set a comment within 64 AREE peo sequence program is characters displayed with comments The comment set in this field m ADD_1 FB1 appears under the label within the FB when the sequence program is displayed with comments Um For the ST Program choose Comment set on FB variable window View Label information and 2 OUTPUT then put the cursor on ST Program to display commen
23. 3 6 3 Aug 2005 SH NA 080376E F Section 3 13 Dec 2005 SH NA 080376E G Section 1 5 1 Section 1 5 2 Section 3 3 Mar 2006 SH NA 080376E H Section 1 1 Section 3 9 Section 3 10 Oct 2006 SH NA 080376E I Section 8 1 Section 8 2 Jul 2007 SH NA 080376E J Abbreviations and Generic Terms in This Manual Section 3 7 3 Dec 2008 SH 080376 Abbreviations and Generic Terms in This Manual Section 1 5 1 Section 1 5 2 Jan 2010 SH NA 080376E L Addition CONDITIONS OF USE FOR THE PRODUCT SAFETY PRECAUTIONS About Manuals Abbreviations and Generic Terms in This Manual Section 1 5 1 Chapter 2 Section 3 1 Section 3 6 1 Section 3 10 This manual confers no industrial property rights or any rights of any other kind nor does it confer any patent Japanese Manual Version SH 080359 M licenses Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual 2003 MITSUBISHI ELECTRIC CORPORATION INTRODUCTION Thank you for choosing the Mitsubishi MELSOFT series Integrated FA software Read this manual and make sure you understand the functions and performance of MELSOFT series programmable controller thoroughly in advance to ensure correct use CONTENTS SAFETY PRECAVTON teinte testem ee oe e o UND eee ne ae A 1 CONDITIONS OF USE FOR
24. 3UDHCPU Q13UDEHCPU Q20UDHCPU Q20UDEHCPU Q25HCPU Q25PHCPU Q25PRHCPU Q26UDHCPU Q26UDEHCPU LCPU LO2CPU L26CPU BT LO2CPU L26CPU BT _ S Q2ACPU Q2ACPU S1 Q3ACPU Q4ACPU Q4ARCPU The FB is not available for the ACPU QCPU A mode FXCPU and motion controller of the PLC series either QCPU Q mode 1 OVERVIEW MELSOFT 1 5 2 Specifications of and precautions for the FB The following are the specifications of the FB and precautions for use of the FB 1 For creation of FB definition program a Specifications Specifications Program capacity 2048 steps For ST Program FB Definition Convert maximum 2048 steps Number of labels usable 500 pcs e Input variables I O variables 24 pcs e Output variables I O variables 24 pcs At least one input variable and one output variable are needed e Labels other than the input output and I O variables are used as internal variables Programming language Ladder list ST b Precautions 1 The FB cannot be used within the FB 2 Index qualification is not available for labels To make index qualification use an actual device as the target device 3 If an internal variable is used as the result of a division instruction its remainder cannot be used for control since a label cannot be assigned to the remainder of division To use the remainder of a division instruction for control use an actual device as the device for storing the division result
25. 48 END 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 2 If you choose Device test the device name ADD 1 IN1 selected in the Device field has already been entered Selected label is entered It indicates FB name name Word device buffer memory Device D C Buffermemory Module start l O Hex Address M x Setting value DEC 16 bitinteger v Set Program Label reference program MAIN When the device type of the selected label is the bit the label is entered into the Device field of Bit device When the device type is the INT DINT REAL the label is entered into the Device field of Word device buffer memory 3 Conduct the device test on the selected label Perform device test on selected label Buffer memory Module starti O Hex Address 4 Setting value DEC 16 bitinteger Y set Program Label reference program MAIN E 4 The device test of the label is completed 5 When device testing another label enter the label directly into the Device field Type FB name Label name in the Device field Holding down the Shift key and double clicking the label of the FB in the sequence program enables forced ON OFF if the device type of the target label is the bit The device test dialog box appears if the device type of the target label is the INT DINT REAL 3 CREATING NEW SEQUENCE PROGRAM
26. 5C GPPW EA V SW8D5C GPPW EV and SW8D5C GPPW EVA BE Abbreviation of the function block FB ST Abbreviation of a structured text Generic term for Q00J Q00UJ Q00 000 001 0010 Q02 H Q02PH QOAU QCPU Q mode QOS3UD Q0O3UDE QOAUDH QO4UDEH Q06H Q06PH QO6UDH QOGUDEH Q10UDH Q10UDEH Q12H Q12PH Q12PRH Q13UDH Q13UDEH Q20UDH Q20UDEH Q25H Q25PH Q25PRH Q26UDH and Q26UDEHCPU LCPU Generic term for LO2CPU and L26CPU BT QnACPU ACPU Generic term for the MELSEC A series programmable controller CPUs It includes the QCPUs A mode and motion controllers SCPU QCPU A mode Generic term for the QO2 H CPU A QO6HCPU A Generic term for the MELSEC FX series programmable controller CPUs The target programmable controllers the FXo FXos FXon FX4 FXu FXoc FXis FXon and FXCPU MEMO A 8 1 OVERVIEW MELSOFT 1 OVERVIEW This manual describes the operations of editing the function block hereafter abbreviated to the FB of the GX Developer Version 8 software package hereafter abbreviated to GX Developer For the explanation of the functions other than the FB refer to the corresponding manuals given in the Related Manuals 1 1 What Is Function Block FB The FB is a function designed to convert a ladder block which is used in a sequence program repeatedly into a component FB to utilize it in the sequence program This not only increases the efficienc
27. D 1 E 3 Changed Data name Description 1 Data type Choose Function block When you choose the object FB definition and open the Rename dialog box Function block has already been selected from the beginning 2 Data name before changing oet the data name FB definition name you want to change When you choose the object FB definition and open the Rename dialog box the data name has already been set from the beginning Alternatively as the list box displays the FB definition names already created choose the object FB definition name from that list 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM MELSOFT 3 Change Data name oet a new data name FB definition name The list box displays the FB definition names already created You can set the data name by choosing the FB definition name from that list and correct part of that name Set the data name within eight characters Usable characters Alphanumeric characters tilde amp apostrophe Single quotation Unusable characters Any of lt gt will result in an error 4 Title Set the title to be set to the project within 32 characters 5 button Click this button when the setting is finished 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM MELSOFT 4 4 Correcting the Program Body or FB Variables of the Utilized FB Definition Setting Purpose Correct th
28. GX Developer Version 8 MITSUBISHI Function Block wu 2 rogramming IM intenance MELSOFT Integrated FA Software d SW8D5C GPPW E e SAFETY PRECAUTIONS e Always read these instructions before using this product Before using this product thoroughly read this manual and the relevant manuals introduced in this manual and pay careful attention to safety and handle the products properly The precautions given in this manual are concerned with this product For the safety precautions of the programmable controller system refer to the User s Manual for the CPU module In this manual the safety precautions are ranked as AN WARNING and RAN CAUTION ws A N WARNING Indicates that incorrect handling may cause hazardous conditions resulting in death or severe injury CAUTION Indicates that incorrect handling may cause hazardous conditions resulting in minor or moderate injury or property damage mm M M M M A M M M a
29. I O variables connects the same devices to the input and output ladder sections The following is the program example where the above remedy has been taken a Sequence program BIT _WORDCFB1 in nut1 H Dan al FB definition program in EAD in auti HA E100 inout b Program executed after compile Assigned Device m 51 j 1 MBf9l SH J Aaa 00 12287 aL 3 8191 iz 4000 01228 H k we E100 012287 skani SS gw 12287 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 9 Reading the Sequence Program from the Programmable Controller CPU Read from PLC Setting Purpose Read the sequence program from the programmable controller CPU Operation Procedure Choose Online Read from PLC or click 7 amp This manual does not detail the operations for reading from programmable controller For details of the operations for reading from programmable controller refer to the GX Developer Version 8 Operating Manual given in the related manuals Setting Procedure 1 Set the access target in Transfer setup 2 Display the Read from PLC dialog box 3 Turn on and choose the check box of the data name which will be read from the programmable controller To select the parameters and all programs of the project click the button 4 Click the button When the label program is to be read from the programmable controller read from PLC is
30. ICES MELSOFT The strings which can not be used in label programming S SB SCJ SD SEND SET SFCP SFCPEND SFT P SG SINT SINT TO _BOOL BYTE DINT DWORD INT REAL UDINT UINT USINT WORD SM SPD SREAD ST STEPC STEPD STEPG STEPI STEPID STEPIR STEPISC STEPISE STEPIST STEPN STEPR STEPSC STEPSE STEPST STMR STN STOP STRING STRING _TO_BYTE DINT DWORD INT REAL SINT TIME UDINT UINT USINT WORD SUB SW mn SWAP P SWRITE SZ T TIME TR TRANA TRANC TRANCA TRANCO TRANCOC TRANJ TRANL TRANO TRANOA TRANOC TRANOCA TRANOCJ TRANOJ TRUNC_ DINT INT SINT TTMR U UDCNT1 P UDCNT2 P UDINT UDINT_TO_BOOL BYTE DINT DWORD INT REAL SINT UINT USINT WORD UINT UINT_TO_BOOL BYTE DINT DWORD INT REAL SINT UDINT USINT WORD ULINT USINT USINT BOOL BYTE DINT DWORD INT REAL SINT UDINT UINT WORD V VAR VAR CONSTANT VAR EXT VAR EXTERNAL VAR EXTERNAL CONSTANT V VAR EXTERNAL FB VAR EXTERNAL PG VAR GLOBAL VAR GLOBAL CONSTANT VAR GLOBAL FB VAR GLOBAL PG VAR OUT VAR INPUT VAR OUTPUT VAR TEMP VD VOID W WORD WORD P WORD TO BOOL BYTE DINT DWORD INT REAL SINT UDINT UINT USINT WRITE WSTRING W BCD TO DINT INT SINT X XCH P XOR XORN Z ZCOM ZNRD ZNRF ZNTO ZNWR ZR MELSEC function group IEC function group group Precaution on label name 1 Can not use the space character 2 Can not use the numerals as the starting character 3 Can not use the following lt gt 8 1 E ess oly But in case of underscore chara
31. PROCEDURES FOR EDITING THE FB 2 GENERAL PROCEDURES FOR EDITING THE FB The following flowcharts give the general procedures from project creation to debugging for use of the FB 1 Creating new sequence program using FB Creation of new program Ladder Creation of project Refer to Section 3 1 Addition of new FB definition Refer to Section 3 2 Creation of program body Refer to Section Creation of FB variables Refer to Section 3 4 Compile of FB definition Refer to Section 3 5 Pasting of FB to sequence program Refer to Section 3 6 Creation of sequence program Refer to Section 3 7 Compile of sequence program Refer to Section 3 8 Write to PLC CPUWrite to PLC CPU Refer to Section 3 10 Monitor test of sequence program 5 Refer to Section 3 11 Correction of FB definition Refer to Section 3 12 Compile of sequence program Refer to Section 3 8 Write to PLC CPU Refer to Section 3 10 m 2 This general procedure is for reference ST Refer to Section 3 1 Refer to Section 3 2 Refer to Section 3 3 Refer to Section 3 4 Refer to Section 3 5 Refer to MELSEC Q L Programming Manual Structured Text Refer to GX Developer Operating Manual Structured Text Refer to GX Developer Operating Manual Structured Text Refer to GX Developer Operating Manual Structured Text
32. TOP Hid K K100 K1 Receive it with a coil once and then use the contact of that coil as the condition of the target instruction Xn DEG MINIS M H Dz00 T P H1 K K100 K1 2 A parallel connection cannot be used with an input ladder section and an output ladder section as it causes an error at the ladder conversion FB i 1 CFBTJ 3 The FB cannot be used in SFC and MELSAP L programs 1 OVERVIEW MELSOFT 4 If the device type of the FB differs from that of the input or output ladder section GX Developer displays an error message There are the following five FB device types e BOOL Data represented by ON OFF INT Data represented by 16 bits DINT Data represented by 32 bits e REAL Floating point data represented by 32 bits e STRING Character string data represented by JIS8 code For example connection of a contact to the input of the FB whose device type is a word will result in an error 5 The FB definition automatically assigns devices to the labels used in a program When creating a sequence program avoid automatically assigned devices Like local devices the automatically assigned devices are set in accordance with the automatically assigned device setting which defaults to the following device ranges e Word device D6144 to D12287 e Bit device M4096 to M8191 e imer T64 to T2047 e Counter C512 to C1023 1 OVERVIEW MELSOFT MEMO 2 GENERAL
33. USING FB MELSOFT 3 12 Correcting the FB Setting Purpose If the FB of the monitored tested sequence program does not operate as expected correct the program of the FB 1 The FB of the sequence program including the FB cannot be displayed if read from PLC is performed to read the program from the programmable controller CPU GX Developer displays the sequence program that has been compiled Hence carefully store the program that has not yet been compiled since it is needed to correct the FB 2 Correct the FB program on the FB definition window The program cannot be corrected on the FB window 3 Note that if multiple pieces of the same FB definition have been pasted to the sequence program correction to the FB definition program is reflected on all FBs Setting Procedure 1 On the FB tab double click and choose the FB definition to be corrected 2 As the FB definition window appears correct the program If the FB window has already been displayed the following dialog box appears MELSOFT series GX Developer Lx n _ This will close the Function Block definition window and will display the Function Block window Are you sure Clicking the button closes the FB window and displays the FB definition window or FB variable setting window 3 After completion of program correction compile the FB definition you do not execute compile the correction is not reflected on the FB pasted to the seque
34. a FB definition in the FB tab of the project 2 Create the program body and FB variables of the FB definition 3 Paste the FB definition registered to the FB tab to the sequence program 4 Create the ladder block including the FB after pasting the FB Creation of new FB definition Creation of program body and FB variables _ l Consent Deve type INPUT PBL L2 oar rea d n PLUS1 kag PLUS1 PLUS2 4 vAR OUTPUT OUTPUT amp PLUS1 ki PLUS1 PLUSZ Ne RAZ nur1 Project FB Structure Ready 025 Host station Registration of program body and FB variables Pasting of FB to sequence program Ei Unset project E3 f Function Block zc E RESP Ready Q25H Host station Creation of sequence program 100 ADD ST1 FB1 99 B INl IN1 B 7200 1 2 PLUS1 I D200 J 2209 I PLUS1 OUTL B MoV 1 I PLUSA DUT2 B PLUS2 1 D200 3 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 1 Crating New Project for FB Setting Purpose Set the PLC series PLC type and project name necessary to create a new project for the FB Operation Procedure Choose Project New project or clic
35. be used with labels An index qualified label is recognized as a new label Example When PLUS1Z1 is input to qualify the label PLUS1 with the index register Z1 the FB definition program is recognized as the label PLUS1Z1 Action Use an actual device as the device to be index qualified b Since the numerical device that may be handled by an input variable is up to a double word the instruction exceeding three words in input count cannot be input from the outside Example For the data write instruction TO to the intelligent function module up to two words can be input by an input variable Action To input three or more words from the outside use an actual device as the device for storing an input value or create the input instructions by the number of necessary times c Since the numerical device that may be handled by an output variable is up to a double word the instruction whose result will be three or more words cannot be output to the outside Example For the BIN 32 bit multiplication D the device for storing the multiplication result needs four words Action To output three or more words to the outside use an actual device as the device for storing the result This manual does not detail the operations for creating programs For details of the operations for creating programs refer to the GX Developer Version 8 Operating Manual given in the related manuals 3 CREATING NEW SEQUENCE PROGRAM
36. ce TE setting Project contents list Product information list 1 e Heaps Ladder Instruction list ST Label FB Program selection MAIN Ladder Print Item Print Ladder Print Ladder Device Additional information Device comment f 3 5 Statement note Alias 4 Alias 4 Device Contact user Print position Right Bottom Setup Frint range Al Specified ange E Coil UZET _ Setup Print range Al Specified range Print conditions Print NOPLF Renews page at each ladder block unit lear Select selector I Specified Step Step In case of blocks under conversion betore printing make sure that conversion 1 amp completed Prints the blank lines with no device comments Specify the number of lines AI 4 of the device comment mit extra lines of the contact user and specify the number of rows top bottom blank line of the coil user Print in the Macro Instruction format Ladder contacts Indication the same Printer setup Page setup Multiple printing Print Print preview Description 1 lt lt Ladder gt gt tab Click this tab to switch to the print detail setting screen 2 button Click this button to print the sequence program 8 PRINTING MELSOFT Setting Procedure 1 After setting
37. comment s Parameter Device memory 9 18 Device init 111 113 117 113 122 D100 W PLUSL PLUS2 WH D200 169 0200 K399 173 END For operation for an ST Program refer to the GX Developer Version 8 Operating Manual Structured Text 2 The FB window appears 51 K500 Ki PLUS1 PLUS2 EB qcpu_fb H E Global variables Rat ape Program Device comment PLUS 499 51 PLUS2 IN2 Parameter E Device memory x Bl Device init RAZ The following dialog box appears if the FB definition window or FB variable setting window has already been displayed 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT MELSOFT series GX Developer This will close the Function Block definition window and will display the Function Block window Are you sure Clicking the button closes the FB definition window or FB variable setting window and displays the FB window The FB window is used to read monitor and test an FB program Program correction cannot be made on this window When correcting the FB program open the FB definition window The FB window closes when the FB definition window opens 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 3 Searching replacing the sequence program Search replace Setting Purpose Perform this operation when searching for or replacing a device instru
38. corruption in some operating conditions Fully understand the precautions described in GX Developer Operating Manual before use e CONDITIONS OF USE FOR THE PRODUCT e 1 Mitsubishi programmable controller PRODUCT shall be used in conditions i where any problem fault or failure occurring in the PRODUCT if any shall not lead to any major serious accident and li where the backup and fail safe function are systematically or automatically provided outside of the PRODUCT for the case of any problem fault or failure occurring in the PRODUCT The PRODUCT has been designed and manufactured for the purpose of being used in general industries MITSUBISHI SHALL HAVE NO RESPONSIBILITY OR LIABILITY INCLUDING BUT NOT LIMITED TO ANY AND ALL RESPONSIBILITY OR LIABILITY BASED ON CONTRACT WARRANTY TORT PRODUCT LIABILITY FOR ANY INJURY OR DEATH TO PERSONS OR LOSS OR DAMAGE TO PROPERTY CAUSED BY the PRODUCT THAT ARE OPERATED OR USED IN APPLICATION NOT INTENDED OR EXCLUDED BY INSTRUCTIONS PRECAUTIONS OR WARNING CONTAINED IN MITSUBISHI S USER INSTRUCTION AND OR SAFETY MANUALS TECHNICAL BULLETINS AND GUIDELINES FOR the PRODUCT Prohibited Application Prohibited Applications include but not limited to the use of the PRODUCT in Nuclear Power Plants and any other power plants operated by Power companies and or any other cases in which the public could be affected if any problem or fault occurs in the PRODUCT Railway c
39. cter an error may occurred when it is present at the end or two or more underscore characters are used consecutively 4 A device name followed by any of to F also results in an error Examples XFFF M100 5 Do not use EnDm as a label name Example E001D9 n and m are any values If such a label name is used it may be recognized as a real number value and unavailable as a label name Appendix 2 Appendix 2 App INDEX A FOG DUTTON 3 12 Auto device 3 13 Automatic 3 13 C Command button esee 4 10 COImIImIeD bots 3 12 3 30 COM DIG 3 14 3 31 OMS TANG tient 3 8 3 11 D Delete button 3 12 DEVICE TOS 3 41 LY DC 3 12 BOOL M 3 12 B pM a 3 12 LEE 3 12 3 12 FRING 3 12 F m 1 1 FB change module address 3 23 FB COMMON 1 2 FB definition 1 4 FB definition program 1 2 FB definition window 1
40. ction or like in the created sequence program Operation Procedure Choose Find Replace Find device Find instruction Find step no Find character string Find contact or coil Find comment Replace device Replace instruction Replace device Replace instruction Change open close contact Replace character string Change module start address Replace statement note type Cross reference list List of used device This manual does not detail the search replace operations For details of the search replace operations refer to the GX Developer Version 8 Operating Manual given in the related manuals Item Explanation 1 Search replace differs in execution range as described below depending on the target window Target Window Senes Oda window The sequence program being displayed is the target of search replace However the iis pasted FB is not included in the target 1 FB definition window Only the FB definition program being displayed is the target of search replace Only the FB definition program being displayed is the target of search 2 Search replace is usable on the windows as indicated below Search Replace Item Sequence Program Window FB Definition Window FB Window Find device Find instruction Find step no Find character string Find contact or coil Find comment Replace device Replace instruction Change open close contact Replace character string Change modul
41. d the number of characters that can be used to designate a drive path project name or data name Number of characters The total number of characters used for designating both the project path and the project name 8 or more characters may be set is 150 lt Example gt C SW3D5GPPW ABCDEF GHIJKLMNOPQRSTUVWXYZ Characters not available in A QnA and FX series gt lt C and can be set for drive designation only Do not use a period or space at the end of the project name If there is a Space right after the project name the space is deleted automatically 8 Title Sets the title for the project in up to 32 characters 9 button Click this button to create a new project 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 2 Adding New FB Definition to the Created Project Setting Purpose Add a new FB definition for the new FB to the created project The FB definition consists of an FB Body and Header used to set the labels variables used in the program Operation Procedure e Choose Project Edit Data New Click the right button of the mouse on the project data list and choose New Dialog Box 1 Data type 4 Function Black Cancel Program type Ladder SFE ST 2 D ata name 3 Title gt Description 1 Data type Choose Function block 2 Program type When crea
42. dance with the FF automatically assigned device setting which ome ees defaults to the following device ranges po 1 Word device D6144 to D12287 su mp ms 2 Bitdevice M4096 to M8191 MS DDR 3 Timer T64 to T2047 m point 0 4 Counter C512 to C1023 When you want to change the device range choose Edit Auto device setting to display the Auto device setting dialog box and change the device range For details of the operations performed on the Auto device setting dialog box refer to Label Program in the GX Developer Version 8 Operating Manual 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 5 Converting the FB Definition Convert Compile Setting Purpose Convert the created FB definition so that it may be used in a sequence program Operation Procedure Choose Convert Convert Compile Operation Items 1 The following dialog box appears on normal completion of convert compile MELSOFT series GX Developer Click to write the label comments over the device comments 2 The following dialog box appears on detection of errors during execution of conv Choosing Contents of error and clicking the Jump button displays the error locations 14 Illegal device type RA2 23 Illegal device type RA1 32 Illegal device type RAZ 3 When errors are detected correct the error locations and then execute conv
43. e Converted FB to the Sequence Program FB 4 9 4 7 Creating the Sequence Program depot bad uui feet su epe sU EE 4 9 4 8 Converting the Sequence Program into the Program to Be Executed on the Programmable Controller CPU Convert 4 9 4 9 Writing the Converted Sequence Program to the Programmable Controller CPU Write to PLC 4 9 6 1 Combining Sequence Programs into One oos ba pd 6 1 6 2 Combining Comments into One Data Joint eee ccccccccceseseeeeeeeeeeesaeeeeeeeeeesseaseeeeeeeeessaeeeeeeeseeeeeaas 6 2 8 1 Printing the Sequence Program Including 8 1 SoZ Pining ne FE DEINO a terat ike 8 4 APPENDICES Appendix 1 to Appendix 2 Appendix 1 Character Strings Unusable as Labels and FB Names Appendix 1 INDEX Index 1 to Index 2 About Manuals The manuals related to this product are shown below Refer to the following table when ordering required manuals Related Manuals Mts Name Manual Number Model Code GX Developer Version 8 Operating Manual Startup TE SH 080372E Explains the system configuration installation method and start up procedure of GX Developer 13JU40 Sold separately GX Developer Version 8
44. e program is displayed on the monitor screen as described below a For input variable BOOL 1 When the condition is ON the label of the input variable is highlighted Condition is ON Label is highlighted 2 When the condition is OFF the label of the input variable is not highlighted Condition is OFF Label is not highlighted b For input variable INT DINT REAL The numeric value stored under the label is displayed Numeric value of storage source device Numeric value stored in input variable L 2 For output variable BOOL 1 When the output variable is ON the label is highlighted ON indication of output variable ear NOV 011 0 0 2 When the output variable is OFF the label is not highlighted OFF indication of output variable W110 For output variable INT DINT REAL The numeric value stored under the label is displayed Numeric value stored in output variable Stored numeric value 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 2 When monitoring the FB program double click the FB on the sequence program to display the FB window Then execute monitoring on the displayed FB window ES PLIS 1 PLUSZ 1 1 11 RA1 13 PLUS uda PLUS 1 1 11 IN RAZ 24 2 2
45. e start address Replace statement note type 521055 5 Can be executed Can be executed Can be executed List of used device 1 Only character string search can search the FB pasted to the sequence program for the FB definition name or FB name Can be executed Can be executed Can be executed Can be executed Can be executed Cannot be executed 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT When searching for the FB pasted to the sequence program you can find the object FB easily by specifying the FB definition name or FB name of the target FB in character string search 1 After typing the FB definition name or FB name click the Find Next button Type FB definition name or FB name Find character string Find direction From top to bottom From cursor to bottom From cursorto top 2 The cursor moves to the top left of the FB section Cursor moves to top left of object FB PLUS2 4 0200 K999 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 4 Creating displaying the comments statements or notes Sentence creation Setting Purpose Create comments statements or notes in the sequence program to improve the readability of the program The created comments statements or notes can be displayed by setting the display format Operation Procedure 1 Creation procedure Choose Edit Documentation Comment Statement or Note 2 Display
46. e utilized FB definition to be the program that meets its purpose Setting Procedure 1 Double click the utilized FB to display the FB definition window or FB variable setting window Input Output PLUS 1 pLusz RAI PLUS 1 PLUsz RAZ OUT 1 0 gt PLUS1 K500 PLUS1 PLUS2 N2 13 lt PLUS1 K499 K10 PLUS1 PLUS2 N2 RA2 3 When you have corrected added and or deleted the labels edit the labels on the FB variable setting window __ Input Output Label Constat Device type ee Oo OBa E EET INPUT IN3 BOOL int INT EB 2 6 OUTPUT OUT2 228 7 our BE Po fT 19 zm STRING ARRAY 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM MELSOFT 4 5 Converting the FB Definition Convert Compile Setting Purpose Convert the corrected FB definition for use in the sequence program Refer to Section 3 5 for the explanation of the operation procedure 4 6 Pasting the Converted FB to the Sequence Program FB Utilization Setting Purpose Paste the FB to the sequence program being created to enable the function block Refer to Section 3 6 for the explanation of the operation procedure 4 7 Creating the Sequence Program Setting Purpose Create an input ladder section and an output ladder section for the FB pasted
47. ed can be specified 4 button Click this button to print the sequence program 8 PRINTING MELSOFT Setting Procedure 1 Choose the FB definition to be printed Click and highlight the FB definition to be printed from the list of the FB definitions registered to the project and then click the Select button Click the button tc FB definitions registered to _ h the FB definit choose the efinition the project are listed 2 Select the item to be printed Header Body and click the Print button to start printing Print example FB variables Function block Header Punction block name ADD 1 Title Label Device Constant Device kind Input Output Comment EE MEIN Eu 1 Eos INI BOOL VAR INPUT IN BOOL VAR INPUT PLUS INT VAR INPUT OUTI BOOL VAR OUTPUT OUT2 BOOL VAR OUTPUT PLUS2 INT VAR OUTPUT RAI BOOL 7 RAZ BOOL Print example Program body Function brock PLUS 1 K500 PLUS PLUS2 PLUS K499 PLUS APPENDICES MELSOFT APPENDICES Appendix 1 Character Strings Unusable as Labels and FB Names The following character strings are unusable as labels and FB names for function block programming The string of device name sequence instruction SFC instruction application instruction can not be used as label An error may occurred during registering or at compile time when any of the follow
48. equence program We cannot recommend this as it may result in double coil The following program example is used to explain how to use labels a FB definition program using labels Ladder program 1 Input variables bit a PLUST 500 PLUS1 2 Input variable word 3 Output variables word PLUS k10 PLUS 4 Output variables bit 5 Internal variables bit 1 IN1 and IN2 are variables that turn ON OFF using external ON OFF information as conditions 2 PLUS is a variable that inputs external numerical information to the FB inside 3 PLUS2 is a variable that outputs the result calculated in the FB inside numerical information to the outside 4 OUT1 and OUT2 are variables that control external outputs with the results calculated in the FB inside ON OFF information 5 RA1 and RA2 are variables used in the FB inside only 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT lt ST Program gt 2 Input variable bit 4 Output variable word 1 I O variable bit 3 Input variable word OR INZ BECMP GE M IN1 PLUS1 D200 7100 IN1 BPLUS 3 M INl Kl Dl123 PLUJ2 OUT M INl MO UR INZ BECMP GE MiINl PLUSl Dy 0 DLO INl BPLUS 3 M IN1 K10 PLUS4 PLUS2 gt OUT M INl MO OUTIL 5 Output lt 4 OUT variables bit H AMD NOT 102 NOT Ral AND Rie s
49. ert compile again In the sequence program you can use only the FB definition that has completed convert compile 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 4 When you have created multiple FB definitions you can compile all FB definitions by performing compile operation once The dialog box shown in 2 appears on detection of errors during execution of compile Clicking shows the dialog box which allows you to confirm the number of errors in all programs Display example ADD_1 P Number of errors in FB definition ADD 1 FB ADD 93 L Number of errors in FB definition ADD 3 FB ADD 2 L Number of errors in FB definition ADD 2 E ADD 2 P Number of errors in FB definition ADD 2 ADD 9 P Number of errors in FB definition ADD 3 Choosing the program name and clicking displays the detailed dialog box of the selected item 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 6 Pasting the Converted FB to Sequence Program FB Utilization 3 6 1 Pasting the FB definition to sequence program Setting Purpose Paste the FB definition to the sequence program being created so that the FB may be used Setting Procedure Any of the following three different operations can be performed to utilize the FB 1 Method using drag and drop from the FB tab with the mouse 2 Method using the function block utilization dialog box 3 Method using the instruction dialog box The following
50. et the data name within eight characters Usable characters Alphanumeric characters _ tilde 96 amp apostrophe single quotation Unusable characters Any of lt gt will result in an error 4 Title Set the title to be set to the project within 32 characters 5 button Click this button when the setting is finished Setting Procedure 1 Clicking the button on the copy dialog box displays the following dialog box MELSOFT series GX Developer Click the button to start copy 2 If the FB definition name of the copy destination already exists the following dialog box appears to indicate that copy has been stopped MELSOFT series GX Developer Creation is nat possible because same Function Block is existing 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM MELSOFT 4 3 Changing the FB Definition Name Setting Purpose Set a new name when you want to change the name of the FB definition copied from another project Operation Procedure Click the right button of the mouse on the Function Block gt gt tab and choose gt Rename Choose Project Edit Data Rename e Click the right button of the mouse on the Project tab and choose gt Rename Dialog Box 1 Data type Functian Block gi Cancel 2 gt Data name before changing T AD
51. explains the procedures of the above operations 1 Method using drag and drop from the FB tab with the mouse a Display the sequence program where the FB definition will be pasted Select the target sequence program name from the Project tab to display the sequence program Set the mode to Ladder Write Td i cB fb 89 Global variables Ee Program 2 8 MAIN Header Body F Device comment uw Parameter E Device memory 81 Device init E E 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT Switch from the Project tab to the FB tab and drag and drop the FB definition from the FB tab onto the sequence program x L f R fb HEN TF 1 8 Function Block ADD 1 Project xl c The FB appears in the cursor specified place drop position on the sequence program qcpu fb 2 58 Function Block 2 58 ADD 1 Header JO cy Project FB 1 The position where the FB definition will be pasted is determined by the place specified by the cursor a When the paste position is a ladder block other than the FB In the insert overwrite mode It is inserted in the row above the ladder block of the paste position b When the paste position is a ladder block including the FB In the insert mode It is inserted in the row above the ladder block of t
52. he paste position In the overwrite mode It is written over the FB of the paste position 2 There are no restrictions on the number of FBs pasted to the sequence program 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 2 Method using the function block utilization dialog box a Display the sequence program where the FB definition will be pasted Select the target sequence program name from the Project tab to display the sequence program Set the mode to Ladder Write Perform the same operation as in 1 a b Choose Project Function Block Diversion to display the Function Block diversion dialog box BLUR alls Double click the FB definition name to be Function Block definition list utilized from the Function Block diversion dialog box Alternatively click and choose the FB definition name to be utilized and click the button Diverted Function Block definition ADD 1 omen c The FB appears in the cursor specified place drop position on the sequence program This is the same as in 1 c 3 Instruction list input dialog box a Display the sequence program where the FB definition will be pasted Select the target sequence program name from the Project tab to display the sequence program Set the mode to Ladder Write Perform the same operation as in 1 a b From the keyboard enter FB FB definition name in the sequence program This displays the Enter symbol
53. in the following sections 4 2 1 Utilizing the existing FB definition from another project Setting Purpose Copy the FB definition created in another project to utilize it Operation Procedure Choose Project Copy Dialog Box Copy r source Path name Project name IC MELSEC GPPW fe Browse PLCtype 225 El Program eO MAIN E amp Device comment 21 18 Parameter L PLC Network Remote password 21 18 Device initial value MAN Function Block 3 xe 4 Description 1 Drive Path name Project name From the button set the project having the FB definition you want to copy 2 PLC type The PLC type of the copy source project is displayed 3 Copy source FB definition Choose the FB definition you want to copy 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM MELSOFT 4 Execute button Click this button to execute copy When the program is to be copied from another project the following dialog box is displayed Copy option Would you copy global variables How to copy global variables a Copy all after delete all previous variables b Overste previous variables and add new variable c Keep previous variables and add new variables a Copy all after delete all previous variables The global label variable setting selected at the copy source is w
54. ing strings are used The strings which can not be used in label programming A ACJ ADD ANB AND ANDF ANDN ANDP ANI ANY ANY BIT ANY DATE ANY DERIVED ELEMENTARY ANY INT ANY MAGNITUDE ANY NUM ANY REAL ANY SIMPLE ANY STRING ARRAY B BCD P BEND BIN P BKBCD P BKBIN P BL BLOCK BMOV P BOOL BOOL_TO_BYTE DINT DWORD INT REAL SINT UDINT UINT USINT WORD BYTE DINT DWORD INT REAL SINT TIME UDINT UINT USINT WORD TO STRING BYTE_TO_BOOL DINT DWORD INT REAL SINT UDINT UINT USINT WORD B BCD TO_DINT INT SINT BXCH P BYTE C CAL CALC CALCN CJ CML P D DBCD P DBIN P DBL P DCML P DDEC P DEC P DELTA P DFLT P DGBIN P DGRY P DI DINC P DINT DINT P DINT_TO_BCD BOOL BYTE DWORD INT REAL SINT TIME UDINT UINT USINT WORD DIV DMOD DMOV P DNEG P DWORD DWORD_TO_BOOL BYTE DINT INT REAL SINT UDINT UINT USINT WORD DX DXCH P DY D_BCD_TO_DINT INT SINT E EGF EGP EI EMOV P END ENEG P EQ EQ GE GT LE LIMIT LT MAX MIN NE SEL STRING I IMASK INC P INT INT P INT_ TO _BOOL BYTE DINT DWORD REAL SINT UDINT UINT USINT WORD INV J JMP JMPC JMPCN L LD LDF LDI LDN LDP LE LED LEDA LEDB LEDC LEDR LINT LREAL LT LWORD M MC MCR MEF MEP MOD MOV P MPP MPS MRD MTR MUL H N NE NEG P NOP NOPLF NOT OR ORB ORF ORI ORN ORP OUT P PAGE PCHK PLF PLS PLSY PWM R RAMP RCJ READ REAL REAL_TO_BOOL BYTE DINT DWORD INT SINT UDINT UINT USINT WORD J RECV REQ RET RETC RETCN RFRP RFS ROTC RST RTOP Appendix 1 Appendix 1 APPEND
55. k D Ctr N Dialog Box Project X 1 series 9 OCPU Oma de Cancel 2 _ PPLE 25H 3 r Program type Label setting 4 Donat use label C Use label Select when using ST program FB and structures f Ladder SFE MELSAP L i ST Device memory data which is the same as program data s name is created Setup project name 5 Setup project name 6 D MELSEC GPP w 7 8 Browse Description 1 PLC Series As the PLC series choose the QCPU Q mode LCPU or QnACPU 2 PLC Type As the PLC type choose the CPU type to be used 3 Program Type As the Program type select Ladder program or ST program 4 Label setting As the Label setting select Use label 5 Setup project name Designate a project name to save the created data When designating a project name before creating a program check the checkbox The project name can be designated before and after program creation When designating the project name after data creation use the Save As menu 6 Drive Path Set the path where the project will be saved is saved Specifying only the project name without specifying the drive path blank automatically creates the default drive path and saves the project there 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 7 Project name Designates a project name The following shows the characters an
56. l 6 Internal variables bit 1 IN1 is a variable that turns ON OFF using external ON OFF information as a condition and outputs the result calculated in the FB inside ON OFF information to the outside 2 IN2 is a variable that turns ON OFF using external ON OFF information as a condition 3 PLUS1 is a variable that inputs external numerical information to the FB inside 4 PLUS2 is a variable that outputs the result calculated in the FB inside numerical information to the outside 5 OUT 1 and OUT2 are variables that control external outputs with the results calculated in the FB inside ON OFF information 6 RA1 and 2 are variables used in the FB inside only b Operation example of the sequence program using the created FB definition Ladder program The input variables turn ON OFF using the external ON OFF information as conditions Control external outputs using the ON OFF information of the output variables bit as conditions ADD 16FB13 PLUS2 N 0200 Inputs the external numerical information Outputs the numerical information to the input variable word from the output variable word to the outside 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT lt ST Program gt Controls an external output using the The input variable turns ON OFF using the ON OFF information of the output external ON OFF information as a condition variable bit as a condition IF 5 LBL TRUE THEN 1 TEST
57. n instructions 2 In the output ladder section create instructions that will provide outputs e g output and arithmetic operation instructions The output variable will be a condition for the output instruction When the device type is INT DINT REAL STRING 1 Connect a word device including a digit specified bit device or constant to the input ladder section The information of the word device is stored into the input variable 2 Connect a word device including a digit specified bit device to the output ladder section The information of the output variable is stored into the word device To create the ladder where the word device will be connected click the button or press the key to display the Enter symbol window and enter the device in the device instruction input field When the device type is a DINT REAL STRING consecutive devices starting with the entered device are occupied OK Exit Help The following is the example where the input and output ladder sections have been connected to the FB Connect a contact for the condition that turns ON OFF the input variable BOOL In this example IN1 turns ON when X100 turns ON output variables BOOL will be conditions that control the external outputs In this example Y110 turns ON when 1 turns ON When 2 turns ON MOV D10 D11 is executed ADD 1 ADD 1
58. n program perform the same operation as in creating a normal sequence program on the FB definition window The program can be created in the following specifications Program capacity Max 2048 steps For ST Program FB Definition Convert maximum CEE steps Language Ladder list ST Supported mode Write read Number of labels Max 500 pcs 2 Use labels variables to create the program The used labels define the following four different functions Use FB variables to define the labels Refer to Section 3 4 Up to 24 pcs including I O variables at least 1 pc Up to 24 pcs including I O variables at least 1 pc I O variable Variable having the functions of both the input and output Up to 24 pcs Internal variable Variable used only in the FB inside 500 input variables output variables I O variables pcs 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT Create a label within 16 characters Characters that cannot be used as a label are those of the reserved words and actual device names If the characters of the reserved word or actual device name are used re set the other label name as the The reserved word is used or Device name is used error message appears Refer to Appendix 1 for unusable character strings Though the FB definition allows a program to be created using actual devices e g X100 110 it will be difficult to use multiple pieces of the same FB definition in a s
59. nce program 4 Compile the sequence program where the corrected FB definition has been pasted If you do not execute compile the correction made to the FB is not reflected on the sequence program 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 13 Making Online Program Correction to the Sequence Program Setting Purpose Write the corrected sequence program to the programmable controller CPU that is in the RUN status Operation Procedure Choose Convert gt Convert Compile Online change or press Shift F4 For other precautions concerning online change refer to GX Developer Operating Manual If the FB definition to be online changed is utilized in multiple programs online change cannot be made The following message appears MELSOFT series GX Developer Cannot execute RUN write because Ehe program has not been converted Changing the option to not write PLC after conversion If the FB variable FB definition program of the program to be online changed is changed online change cannot be made The following message appears MELSOFT series GX Developer 1 Writing during RUM is nat possible because the Function Block definition is nat converted or not compiled Please write program to PLC after conversion compile of the Function Block definition is completed 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM MELSOFT 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM This cha
60. nction block When you choose the object FB and open the Delete dialog box Function block has already been selected from the beginning 2 Delete data name Set the data name FB definition name to be deleted When you choose the object FB and open the Delete dialog box the data name has already been set from the beginning Alternatively as the list box displays the FB definition names already created choose the object FB definition name from that list 3 button Click this button when the setting is finished Setting Procedure 1 Setting the object FB definition name and clicking the button displays the following message MELSOFT series GX Developer E Are vou sure vou want to delete 40D17 d When Ehe Function Block definition deleted the Following of the program including the Function Black will be deleted The circuit black including Ehe Function Block in Ehe ladder program Function Block name definition in the ST program Local variable setting 2 Click the button to delete the FB definition 5 DELETING UNNECESSARY FB DEFINITION FROM THE PROJECT MELSOFT 1 Deleting the FB definition also deletes the ladder block that includes the deleted FB definition FB from the sequence program Before executing delete it is recommended to confirm by making character string search that the FB definition to be deleted is not being used in the sequence program Refer to Section 3 7 3 2 When deletion of the
61. ody JVARINPUT 00 e Ei jeegwur s 1 vaRINPUT 7 4 vak output poo 5 jvncurur ror Boa 6 gt JA i L7 RAD Ls 2 17 Project FB Ready Q25H Host station 2 FB variable setting window 1 OVERVIEW MELSOFT 3 Window used to create a sequence program Sequence program window This window is used to edit a sequence program where the FB is pasted Create the sequence program in a ladder format A list format cannot be used ip MELSOFT series GX Developer C MELSEC GPPW sample_prg qcpu_fb LD Head mode 208 Step Project Edit Find Replace Convert View Online Diagnostics Tools Window Help Dag j F7 8 Fa zel 1 5151 e qcpu_fb Global variables 458 Program Device comment Parameter E Device memory E Device init 0200 K999 Output ladder section Function block FB Input ladder section Project data list x1 Sequence program window E 1 The step numbers of the sequence program which is not yet compiled are displayed with parentheses i e Step number After completion of com
62. ompanies or Public service purposes and or any other cases in which establishment of a special quality assurance system is required by the Purchaser or End User Aircraft or Aerospace Medical applications Train equipment transport equipment such as Elevator and Escalator Incineration and Fuel devices Vehicles Manned transportation Equipment for Recreation and Amusement and Safety devices handling of Nuclear or Hazardous Materials or Chemicals Mining and Drilling and or other applications where there is a significant risk of injury to the public or property Notwithstanding the above restrictions Mitsubishi may in its sole discretion authorize use of the PRODUCT in one or more of the Prohibited Applications provided that the usage of the PRODUCT is limited only for the specific applications agreed to by Mitsubishi and provided further that no special quality assurance or fail safe redundant or other safety features which exceed the general specifications of the PRODUCTs are required For details please contact the Mitsubishi representative in your region REVISIONS The manual number is given on the bottom left of the back cover Print Date Manual Number Feb 2003 SH NA 080376E A First edition Oct 2003 SH NA 080376E B Section 3 13 Section 5 Jun 2004 SH NA 080376E C Abbreviations and Generic Terms in This Manual Sep 2004 SH NA 080376E D Addition Section 3 6 3 Dec 2004 SH NA 080376E E Section
63. opy destination sequence program where you want to make insertion ADD 1 FB1 ADD 7 FA PLUSZ M 0201 Copy and paste operation cannot be performed between the sequence program of one project and that of the other project In this case perform the following operation 1 Choose Project Copy to copy the sequence program and FB definition of the other project At this time copy cannot be executed if the PLC type of the copy source project differs from that of the copy destination project In this case change the PLC type of the copy source project to that of the copy destination project and save it as another project 2 Perform copy and paste operation between the sequence programs of the same project 6 2 Combining Comments into One Data Joint Setting Purpose Combine the comments of multiple sequence programs into one Operation Procedure Choose Tools Merge data For details of the operation refer to Merge data of the GX Developer Version 8 Operating Manual Comments not saved in the personal computer cannot be combined Merge data cannot combine the sequence programs that include FBs 7 VERIFYING THE PROJECTS MELSOFT 7 VERIFYING THE PROJECTS Setting Purpose Verify data between the projects of the same PLC type Operation Procedure Choose Project Verify For details of the operation refer to Verifying Data in Projects of the GX Developer Version 8 O
64. perating Manual Executing project verify displays the verify results of the following items 1 Parameters 2 Label programs 3 Actual programs The following are the display examples of verify results a Verify results When the results are OK Project verify Label program Verify source Project name F XFB ENG Data name HAIN Uerify destination Project name F XFB EHG2 Data name HAIH lt Memory gt lt File gt Row number Text number Ho unmatched areas b Verify results When the results are not good Project verify Label program Uerify source Project name F XFB ENG3 Data name HAIN Uerify destination Project name F XFB ENG2 Data name HAIN lt Memory gt lt File gt Row number Text Row number Text 9 There is no corresponding row 11 IF S LBL TRUE THEN There is no corresponding row 12 FB3 IU 5 28 There is no corresponding row 13 END IF There is no corresponding row 15 FBA IO TEST H28 There is no corresponding row 17 IF S LBL FRLSE THEN There is no corresponding row H123 TRUE There is no corresponding row There is no corresponding row 26 END IF There is no corresponding row There is no corresponding row There is no corresponding row 11 items unmatched 7 VERIFYING THE PROJECTS MELSOFT 1 Verified data are as follows Parameters Sequence programs where FBs have been pasted Actual programs available b
65. pile the step numbers are displayed without parentheses When compile is complete the step numbers may be changed Window used to set FB variables o FB variable setting window Window used to set FB variables FB name Name of the FB pasted to the sequence program Different names are attached to the FBs that are pasted from the same FB definition FB window Window used to read or monitor the program in the FB pasted to the sequence program The FB window cannot be used to write a program Use the FB definition window to write a program 1 4 1 4 1 OVERVIEW MELSOFT 1 4 What You Should Understand Before Using the FB As in a normal sequence program the FB is used to create a program using labels a ladder or list format of a ladder program or in a ST program Before creating the FB therefore fully understand the way to create a sequence program using labels on GX Developer When you want to know any operation to create a sequence program on GX Developer refer to the GX Developer Version 8 Operating Manual given in the related manuals 1 5 Specifications 1 5 1 Compatible CPUs The following CPU models allow you to use the FB on GX Developer PLC Series Q00JCPU QOOUJCPU QOOUCPU Q01CPU QO1UCPU 2 2 Q02PHCPU 2 QO3UDCPU QO3UDECPU QO4UDHCPU QO4UDEHCPU QO6HCPU QO6UDHCPU QO6UDEHCPU Q10UDHCPU Q10UDEHCPU Q12HCPU Q12PHCPU Q12PRHCPU Q1
66. procedure Choose Edit Comment Statement or Note This manual does not detail the operations for creating comments statements and notes For details of the creating operations refer to the GX Developer Version 8 Operating Manual given in the related manuals Description 1 Comment Comments can be created for the devices in the input and output ladder sections of the ladder block that includes the FB 2 Statement Statements can be created in only the first ladder of the input ladder section in the ladder block that includes the FB They cannot be created in the output ladder section 3 Note Notes can be created in only the output ladder section of the ladder block that includes the FB They cannot be created in the input ladder section 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 8 Converting the Sequence Program into Program to Be Executed on the Programmable Controller CPU Convert Compile Setting Purpose The sequence program where the FB has been pasted cannot be executed as is on the programmable controller CPU Perform Convert Compile operation to convert it into an executable program Operation Procedure Choose Convert Convert Compile Convert Compile All programs being edited or Convert Compile All programs or Convert Compile Online change Description 1 The following dialog box appears on normal completion of compile MELSOFT series GX Developer
67. program Input ladder section Output ladder section Add other ladders to the FB where the input and output ladder sections have been created to complete the sequence program Program Creation 1 After the FB has been pasted the sequence program can be created by performing the same operation as in creating a normal ladder format sequence program This manual does not detail the operations for creating programs For details of the operations for creating programs refer to the GX Developer Version 8 Operating Manual given in the related manuals 2 In the pasted FB the labels of the input variables are displayed on the left side and those of the output variables on the right side The input side labels are shown as Device type Label name and the output side labels as Label name Device type The device types are indicated by the following alphabets Input side labels Output side labels _1 1 BOOL b INT W c DINT D d REAL E Device type Label name e STRING 9 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 Each label is connected with the input or output ladder section The ladder that can be connected to the input or output ladder section depends on the device type of the connected label a When the device type is BOOL 1 In the input ladder section create instructions that will be conditions for input variables e g contact association and comparison operatio
68. pter describes the operations for utilizing the created FB to create a sequence program The operation procedures in Section 4 1 1 and Sections 4 5 to 4 9 are the same as those In Section 3 1 and Sections 3 5 to 3 9 For explanations refer to the corresponding sections of Chapter 3 4 1 Creating Project for FB 4 1 1 Creating a new project Setting Purpose Set the PLC series PLC type and Project name necessary to create a new project for the FB Refer to Section 3 1 for the explanation of the operation procedure 4 1 2 Reading the existing project Setting Purpose Read the saved project to add the FB to the existing project Operation Procedure Choose Project Open project or click Ctrl Dialog Box Open project Project drive c M Drive Path CAMELSECAGPPW 2 1 oP ojectname fb Cancel Description 1 Project name Click the object project and set the project name 2 button After you finished the setting click this button to read the project 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM MELSOFT 4 2 Utilizing the Existing FB Definition Copy There are the following two ways to utilize the existing FB definition 1 Utilizing the existing FB definition from another project refer to Section 4 2 1 2 Utilizing the existing FB definition within the same project refer to Section 4 2 2 These utilization methods will be described
69. r CPU Write to PLC 3 37 4 4 3 11 Monitoring and Testing the Sequence nnne 3 38 3 11 T Monltoririg trie Sequence eus AVE RABAT DUE a eee oes tra ea oe ie d a 3 38 3 11 2 Testing the sequence program Device 3 41 COMO eicit 3 43 3 13 Making Online Program Correction to the Sequence 3 44 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM 4 1to 4 9 4 1 4 1 1 Creating a new Tm 4 1 4 1 2 Reading the existing PlOlOCl A 4 1 4 2 Utilizing the Existing FB Definition Copy eeeeesssesseeeseeeneeeeeennnn nnnm 4 2 4 2 1 Utilizing the existing FB definition from another 4 2 4 2 2 Utilizing the existing FB definition within the same 4 4 4 3 Changing the FB Definition 444 2044404 nnne nnn ananas 4 6 4 4 Correcting the Program Body or FB Variables of the Utilized FB Definition 4 8 4 5 Converting the FB Definition Convert Compile eeeeeeeeessseseeeeeernnnenennennn nnne 4 9 4 6 Pasting th
70. ritten over the copy destination b Overwrite previous variables and add new variable If the same global label exists at the copy source and copy destination the global label at the copy source is written over the copy destination The non overlapping global label is added to the global variable setting at the copy destination C Keep previous variables and add new variables If the same global label exists at the copy destination and copy source the global label at the copy source is not written over the copy destination The non overlapping global label is added to the global variable setting at the copy destination Setting Procedure 1 By clicking the button on the copy dialog box the FB definition having the same name as that of the copy source is created in the project 2 If the FB definition having the same name as that of the copy source already exists in the copy destination the following dialog box appears to indicate that copy has been stopped MELSOFT GX Developer To execute copy change the FB definition name of the copy destination to another name and execute copy again Changing the FB definition name also changes the FB definition name of the FB pasted to the sequence program Refer to Section 4 3 for changing the FB definition name 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM MELSOFT 4 2 2 Utilizing the existing FB definition within the same project Setting Purpo
71. se Copy the FB definition already created in the same project to utilize it Operation Procedure Click the right button of the mouse on the lt lt Function Block gt gt tab and choose Copy Choose Project Edit Data Copy Click the right button of the mouse on the lt lt Project gt gt tab and choose Copy Dialog Box Copy Function Block E Cancel 2 Copy source data name 1 gt Data OK 3 destination data ADD 2 4 Title Description 1 Data type Choose Function block When you choose the FB definition of the copy source and open the Copy dialog box Function block has already been selected from the beginning 2 Copy source data name Set the data name FB definition name you want to copy When you choose the FB definition of the copy source and open Copy dialog box the data name has already been set from the beginning Alternatively as the list box displays the FB definition names already created choose the object FB definition name from that list 4 UTILIZING THE EXISTING FB TO CREATE SEQUENCE PROGRAM MELSOFT 3 Copy destination data name Set the data name FB definition name of the copy destination The list box displays the FB definition names already created You can set the data name by choosing the FB definition name from that list and correct part of that name S
72. started after the project where Use label was selected in the label setting is created or read 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 10 Writing the Sequence Program to the Programmable Controller CPU Write to PLC Setting Purpose Write the converted sequence program to the programmable controller CPU Operation Procedure Choose Online Write to PLC or click Fal This manual does not detail the operations for writing to programmable controller For details of the operations for writing to programmable controller refer to the GX Developer Version 8 Operating Manual given in the related manuals Setting Procedure 1 Set the access target in Transfer setup 2 Display the Write to PLC dialog box 3 Turn on and choose the check box of the data name which will be written to the programmable controller To select the parameters and all programs of the project click the button 4 Click the button 1 When the label program is written to the programmable controller CPU peripheral statements are also written together like integrated statements 2 If the Label program ST FB structure check button was not checked for write to PLC the following error message is displayed When the button is selected only the execution program is written to the programmable controller and the label program cannot be read MELSOFT series GX Developer 2d Is it OK to execute PLC write CALITION Execu
73. te PLC write only execute program because label program has not been selected And cannot read label program ST FB Structure from PLC 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 11 Monitoring and Testing the Sequence Program 3 11 1 Monitoring the sequence program Setting Purpose Monitor the sequence program that has been written to the programmable controller CPU to check the operating status of the programmable controller CPU The FB pasted to the sequence program can be monitored like contacts and coils The program in the FB can also be monitored like the sequence program Operation Procedure e When monitoring Choose Online Monitor Monitor mode or click e When stopping monitoring Choose Online Monitor Stop monitor or click e When resuming monitoring Choose Online Monitor Start monitor or click a F3 Window The following explains the example where the FB pasted to the sequence program and the program in the FB are monitored 1 The sequence program is displayed on the following monitor window 82 is NO NO 88 5 N10 x0 x1 88 92 JT N10 0100 1 144 0200 K999 kee NO 11 148 END Monitor status 0 300ms RUN MAIN 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT The ladder block that includes the FB in the sequenc
74. the necessary information for printing click the Print button to start printing Print example Ladder program 1 100 PLUS1 PLUS2 WHD200 899 8 PRINTING 2 ST program PLC parameters Network parameters Device comment Device memory Device init TEL Cross reference list List of used device setting Project contents list Product information list 1 Description 1 lt lt ST gt gt tab Program selection MAIN MAINT Print range ie Al Specified e line MELSOFT x adder FistTUctior tis ST Label FB Structure Select Clear selection MAIN re Fage setup Multiple printing Print preview Close 2 Click this tab to switch to the window for setting the print details 2 Print button Click this button to print the ST program Setting Procedure 1 After setting the data necessary for printing click the Print button to execute printing Printing example ST Program 1 IF S LBL TRUE THEN 2 1 0 3 END 4 5 2 5 0 6 7 IF S LBL TRUE THEN 8 9 10 END IF 11 IF S LBL TRUE THEN 12 FB3 lIO_TEST M10 13 END_IF 14 15 FBA IO 5 20 16 17 IF S LBL FALSE THEN 18 M123 TRUE 19 20 END 8 PRINTING MELSOFT
75. ting the FB select Ladder program or ST program 3 Data name Set the data name FB definition name to be added newly set the data name within eight characters Usable characters Alphanumeric characters tilde 2 amp apostrophe single quotation Unusable characters Any of 5 M lt gt will result in an error If the other FB definition has already been created in the project displaying the New dialog box sets that FB definition name in the Data name field 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 4 Title Sets the title for the project in up to 32 characters 5 button Click this button to create the new FB definition 1 There are no restrictions on the number of FB definitions that can be created in a project It depends on the capacity of the project saving destination 2 If multiple FB definitions are created in one project we recommend you to create a title for ease of searching for the object FB definition 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 3 Creating FB Definition Program Setting Purpose Create an FB definition program using labels variables Operation Procedure Double click Function block on the lt lt FB gt gt tab and double click FB definition or double click Body individually 62 2 8 qcpu 62 Function Block Function Block ADD 1 eB Header
76. to the sequence program to complete the sequence program Refer to Section 3 7 for the explanation of the operation procedure 4 8 Converting the Sequence Program into the Program to Be Executed on the Programmable Controller CPU Convert Compile Setting Purpose The sequence program where the FB has been pasted cannot be executed as is on the programmable controller CPU Perform compile operation to convert it into the program to be executed Refer to Section 3 8 for the explanation of the operation procedure 4 9 Writing the Converted Sequence Program to the Programmable Controller CPU Write to PLC Setting Purpose Write the converted sequence program to the programmable controller CPU Refer to Section 3 10 for the explanation of the operation procedure 5 DELETING UNNECESSARY FB DEFINITION FROM THE PROJECT MELSOFT 5 DELETING UNNECESSARY FB DEFINITION FROM THE PROJECT Setting Purpose Delete the FB definition that has become unnecessary due to project modifications Operation Procedure Click the right button of the mouse on the lt lt FB gt gt tab and choose Delete Choose Project Edit Data Delete Click the right button of the mouse on the lt lt Project gt gt tab and choose Delete Dialog Box Delete 1 Data type OK Functio Blo ck Cancel 2 Delete data name 00 1 Description 1 Data type Choose Fu
77. ts in a tool tip format 6 Edit operation button Used to insert a blank row in the current cell position When you want to batch insert multiple rows choose the cells of the rows you want to insert Blank rows are inserted in the cell selected range button Used to add a blank row under the row of the current cell position When you want to batch add multiple rows choose the cells of the rows you want to add Rows are added starting with the row under the first one of the range selected cells button Used to delete the cell selected range 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 7 button Clicking the button registers the FB variables If any of the labels constant values and device types is set incorrectly the dialog box on the right appears to indicate that the variables cannot be registered Choosing Contents of error and clicking the Jump button displays the error location On the FB variable setting window the set data are sorted in label order constant order and device type order The sorting order is as follows 1 Symbols 2 Alphabets uppercase characters 3 Alphabets lowercase characters The FB definition automatically assigns eee devices to the labels used in the program cp fee When creating a sequence program avoid P zm a automatically assigned devices Like local devices the automatically assigned RE FS xj devices are set in accor
78. unction Block Data name before changing The FB name that be entered is within 16 characters The characters that cannot be used as the FB name are those of the reserved words and actual device names If you used the characters of the reserved word or actual device name the following error message will appear Therefore set the other label name Refer to Appendix 1 for the unusable character strings Illegal characters have been used for a data name Use legal characters 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 2 Click the OK button to display the new FB name in the FB When you have changed the FB name the display changes as shown below FB before change FB after change ADD 1 FB1 ADD 1 ADD 1 FB name changing can be executed in the write mode It cannot be executed in the read mode 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 6 3 Changing the module start I O addresses of the FB definition Setting Purpose Change the batch of module start I O addresses Un Un Gm I O devices X Y DX DY that are used in the FB definition Operation Procedure xj 1 Select the FB tab within the Project data list 2 Double click and select the program body of the FB definition that uses the module start I O address to be changed The FB definition body will appear Project Select Project Function Block FB change module address
79. utilization 3 Editing function of high operability The FB can be utilized easily in a Sequence program by drag and drop operation 1 3 Layouts and Names of Windows for Creating FB This section describes the layouts and names of the windows used to create the FB 1 Window used to create FB definition program FB definition window This window is used to edit an FB definition program which is created in a ladder or list format Labels define variable types device types and others on the FB variable setting window in 2 Ladder program x T Project Edit Find Replace Convert View Online Diagnostics Tools Window Help 18 a selel Aale sll ele Global variables gfe Ei REI 4b afee t F5 srF5 F6 F8 F9 srFo cr9 crio 8 aF5 esF5 csrio F10 aF9 I eft een gi E ra Ce peed ESCH DES F7 sro Fo F6 Fa sF9 of 22 cd ca e5 a5 aro FB definition FB variables Program body FB definition program Q02 H Host station Function Block tab FB tab FB definition window 1 OVERVIEW MELSOFT lt ST Program gt iP MELSOFT series GX Developer Unset project FB ST ADD ST1 17Row 56 Step T Project Edit Find Replace Convert View Online Diagnostics Tools Window
80. window and writes it in the device instruction input field Example FB ADD 1 FBADD_1 Clicking the button displays the FB in the cursor specified place on the sequence program This is the same as in 1 c REFERENCE For FB utilization in an ST Program refer to the MELSEC Q L Programming Manual Structured Text 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 6 2 Changing the name FB name of the pasted FB FB name changing This operation is optional Perform this operation as necessary Setting Purpose Change the FB name of the pasted FB The name FB1 of the FB pasted to the sequence program is displayed within parentheses right after the FB definition name FB definition name If multiple pieces of the same FB or the other FBs are pasted to a sequence program the FBs are automatically assigned the specific FB names that increase in number consecutively e g FB1 FB2 Perform this operation when you want to make multiple FBs pasted to a sequence program more easily identifiable Operation Procedure Choose Project Function Block Rename FB Setting Procedure 1 Type the old data name and new data name in the Rename Function Block dialog box You can select the old data name from the list box If you reselect the FB whose name will be changed the FB name has already been entered in the Data name before changing field Rename F
81. y compiling the above sequence programs programs written to the programmable controller CPU FB definitions program bodies FB variables are not verified 2 If sequence programs not yet compiled are verified the following message appears to indicate that verify has been stopped MELSOFT series GX Developer ras d Failed to compare with the real program because the selected label program has not been compiled 3 Multiple data can be selected as shown below for the verify source and verify destination Verify is performed between the data of the same name Verhy source 1 r wer dest EHE Program Elf Program MAIN PLE Network Choose the data names by turn on their check boxes 8 PRINTING MELSOFT 8 PRINTING This chapter describes the operation methods for printing the sequence program including FB and printing the FB definition For other printing methods refer to the GX Developer Version 8 Operating Manual given in the related manuals 8 1 Printing the Sequence Program Including FB Setting Purpose Print the sequence program that includes the FB Operation Procedure Choose Project Print or click Ctr P Dialog Box 1 Ladder program Print Structure PLC parameters Redundant parameters Network parameters Device comment Device memory Device init TEL Cross reference list List of used devi
82. y of program development but also reduces programming mistakes to improve program quality Definition of FB Definition of FB definition program and FB variables Constant ADD 1 ADD 1 FB variables FB definition program Utilization of FB Pasting of FB to sequence program XJ Creation of sequence program OUT1 b PLS 0 Debugging Come x1 GX Developer performs write to PLC to write the compiled sequence program to the programmable controller CPU When writing the program to a programmable controller with Label program ST FB Structure selected the FB can be restored using Read from PLC 1 OVERVIEW MELSOFT 1 2 Features The FB has the following features 1 Conversion of program into component Displaying a standard program as a single block improves the reuse and readability of the program facilitating editing and debugging This ensures ease of configuring a large scale program 2 Uniform program quality Reusing the components of a standard program provides uniform program quality which is independent of the technological level of a program developer It also prevents programming mistakes during

Download Pdf Manuals

image

Related Search

Related Contents

User manual - Smartphone  Samsung LA32D450G1W manual de utilizador  MotionDrape LED User Manual Rev. 8  Method and software for precluding unsolicited email messages  User Manual - DiscountRamps.com  La Génération Y  EndNote X7 User Manual - Charles Sturt University  LevelOne WAP-6012  (スカイシャトル)  Hahnemühle FineArt Baryta 43,2 cm x 12 m  

Copyright © All rights reserved.
Failed to retrieve file