Home

GX Developer Version8 Operating Manual

image

Contents

1. seb rs 3 eer FB definition FB variables Program body FB definition program 7 Q02 H Host station Owwte Nm Function Block tab FB tab FB definition window 1 OVERVIEW MELSOFT ST Program iP MELSOFT series GX Developer Unset project FB ST ADD ST1 17Row 56 Step E alxi Tl Project Edit FindfReplace Convert Yiew Online Diagnostics Tools Window Help 181 x Diesel al I lel 1 I alale lt la ala Sle Global variables zl Lum eal al Unset project B f Function Block EHE ADD STI EB Header INI INL OR IN2 E Body BKCMP GE M 1 D100 D100 1N1 ER ADDI BPLUS 3 M INI K10 PLUS4 PLUS2 E Header i Body OUT M INl NO OUTl INl AND NOT IN2 OUTZ NOT INl AND IN2 FB definition FB variables Program body Projet Fg Ready Q2sH Host station kow 15cd 1 imet D Nf 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 ZETE BEE Z Project Edit Find Replace Convert View Online Diagnostics Tools Window Help 8 xl eielaj a alele aieiai ele alal sjel S qcpu fb amp E Function Block o ADD 1 EE Header Body Constant IN2
2. seen 3 16 3 6 Pasting the Converted FB to Sequence Program FB Utilization i 3 18 3 6 1 Pasting the FB definition to sequence program sse 3 18 3 6 2 Changing the name FB name of the pasted FB FB name changing i 3 21 3 7 Creating the Sequence Program 3 23 3 7 1 Editing the sequence program ii 3 23 3 7 2 Confirming the data of the pasted FB enne 3 26 3 7 3 Searching replacing the sequence program Search replace i 3 28 3 7 4 Creating displaying the comments statements or notes Sentence creation n 3 30 3 8 Converting the Sequence Program into Program to Be Executed on the PEC CPU Convert Compile enitn aaan rt it eae A i e c a ER mas 3 31 3 9 Reading the Sequence Program from the PLC CPU Read from PLC 3 34 3 10 Writing the Sequence Program to the PLC CPU Write to PLC 3 35 3 11 Monitoring and Testing the Sequence Program ccecceceeseeeeeeeeeseececeeeeaecaeseeeeaesaesaeseeeeansaesaeseeeeaaeas 3 36 3 11 1 Monitoring the sequence program i 3 36 3 11 2 Testing the sequence program Device test nennen 3 39 A 3 A 3 3 12 Correcting the EB tina ioni MEUS Ends Anson ET 3 41 3 13 Making Online Program Correction to the Sequence Program 3 42 4 1 Greating Project for EB iin i e c ia a a ii 4 1 4 311 Creating a Mw projetar i ceret tre
3. 3 21 Input variable 3 8 3 11 Insert button xu e 3 12 L Label 5 end 3 11 Index 1 M Quen op 3 36 N NOlG 5 ed aree terrere rre ets 3 28 O Online program correction 3 42 Output ladder section 3 21 Output variable 3 8 3 11 P Printing Printing the sequence program 8 1 Printing the FB definition 8 6 Program bOdY sse 1 2 Projects anni nia arl ria 3 3 Project tab OE Rp 1 4 R Read from PEG iir here Ree 3 34 Replace Change module start address 3 26 Change open close contact 3 26 Replace character string 3 26 Replace device esses 3 26 Replace Instruction ssssss 3 26 Replace statement note type 3 26 S Search Cross reference list suus 3 26 Find character string 3 26 Find contact or coll 3 26 Find device sss 3 26 Find instruction i 3 26 Find step NO 3 26 List of used device 3 26 Sequence program window 1 3 3 26 Statement dde audi 3 28 Index 1 V Variable Typo 3 11 IW Write to PIG iuit 3 35 I
4. Setting Purpose Print the FB definition program and or FB variables of the FB definition Operation Procedure Choose Project Print or click 8 Ctr P Dialog Box Device comment List of used device Device memory Device init PLC parameters Network parameters Cross reference list Project contents list EL Product information list Tile MELSAP23 MELSAPL Ladder Instruciioniist Lebel FB TCseting TT Global variables Local variables selection Local variables MAIN MAIN FB selection 1 F Header ADD 1 m 2 V Body ADD 2 Ladder Instruction list ADD 1 3 p Ladder contacts indicationthe same v Additional information T Device Comments Coya Ju j Statement note Printer setup Page setup Multiple printing Print Print preview 4 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 Turn on the corresponding check box to annotate the program 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 highlig
5. Write the program to PLC or Compare with the program in PLC before execute RUN write function and change TC variable for PLC The comment of label will overwrite on device comment All right The following dialog box appears on detection of errors Compile error Detail All programs Compil Program name Eora Program name Al programs FB ADD_1 P Program name Error tems Error step Error detail ADD_1P 2l FB ADD 30 FBADD 2i 2 ADD 2 P 3 ADD 3 P 2 Hi a 3 do 32 Ilegal device type PA2 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 CAMELSECAGPPWAqcpu fb2 LD Edit mode MAIN 72 Step 3l 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
6. e Click the right button of the mouse on the Function Block tab and choose gt Rename e Choose Project gt Edit Data Rename e Click the right button of the mouse on the Project tab and choose gt Rename Dialog Box Rename S 9 Function Block M Cancel 2 Data name before changing ADD_1 3 gt Changed Data name ADD 2 4 h Title 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 Set 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 Set 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
7. 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 CINES ee xl _ o Function Block Program type Ladder C SFE 7 MELSAPL CST 2 Data name 3 Title Cancel Description 1 Data type Choose Function block 2 Program type When creating 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 95 amp apostrophe single quotation Unusable characters Any of 2 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
8. fe Program 5 Eg MAIN EE Header Body fF Device comment s Parameter E Device memory E Device init 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT b Switch from the Project tab to the FB tab and drag and drop the FB definition from the FB tab onto the sequence program a qcpu fb2 ERE Function Block a f ADD 1 Heade io Project FB c The FB appears in the cursor specified place drop position on the sequence program ce qcpu fb2 S F Function Block o ADD 1 EE Header zai jody Project FB POINT 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 the 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 t
9. FB inside 4 PLUS2 is a variable that outputs the result calculated in the FB inside numerical information to the outside 5 OUT1 and OUT2 are variables that control external outputs with the results calculated in the FB inside ON OFF information 6 RA1 and RA 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 Control external outputs using the ON OFF ON OFF information as conditions information of the output variables bit as conditions ADD_1 FB1 i B IN1 DUT1 B f B IN2 QUT2 B H H wcpLust pLusz w Hozoo 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 ST Program 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 _LBL TRUE THEN FBl IO_TEST M0 END IF FBl O0 TEST HM0 FBZ IOU TEST MO0 FB2 0 TEST M0 IF 5 LBL TRUE THEN FB_NEW INl M0 IN2 MO PLUS1 D10 PLUS2 D100 0UT1 M0 0UT2 M0 END_IF Inputs the external numerical information Outputs the numerical information from the to the input variable word output variable word to the
10. 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 E qcpu fb2 E qepu_fb2 EH FE Function Block 84 qcpu fb2 c amp amp Function Block c amp amp Function Block 2 ENTUNDE amp f ADD 1 EH acted EX E Window Ladder program P MELSOFT series GX Developer C MELSEC Gppw qcpu_fb FBLD Edit mode ADD 1 72 Step igi xi Z Project Edt Find Replace Convert View Online Diagnostics Tools Window Help 18 x Pies s x sse exe sla alal lal Global variables gt z pf E EI irse ve petet zs ESSER Le xz ps F5 sF5 F6 sF6 F9 sr9 cF9 cFio sF7 sF8 3F7 3F8 do caF5 caf tari aF9 amp Fe 216 S mes 2 5 3 e eJ sse nal zae eeu e g 3 Eu Em TRE aliata ze c B
11. 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 b 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 F4 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 i MELSOFT series GX Developer CYMELSECAGPPWAqcpu fb2 FBLD Edit mode ADD 1 34 EE Not yet compiled zi 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 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
12. x Project pe Structure 3 y PLUST K500 J KI PLUST PLUS Ready QZH Fost station 4 5 RAI bi 6 E PLUSI Vasa 1 PLUS T PLUS 7 8 RR TE UTI E Registration of program body a and FB variables Li me A Pasting of FB to sequence program ADD STITFRI 8 Project re Structure Ready 2 Fest station 89 few Creation of sequence program T sli sal H ser ome sl 4 nc E lle ps m pes m MEE sh H Ed mi 200 des jn EE zl 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 click Dif Ctrl N Dialog Box x 1 M PLC series 9 QCPU Qmode Cancel 2 PLC Type 25H x 3 Program type Label setting 4 Ladder Do not use label C src I MELSAPL C Use label CST Select when using ST program FB and structures Device memory data which is the same as program data s name is created r Setup project name 5 krr Setup project name 6 Diive Path JD MELSEC GPPW 7 k Project name 8 h Tite Description 1 PLC Series As the PLC series choose the QCPU Q mode or Qn
13. 2 BOOL z VAR OUTPUT 7 OUT3 OOL 8 VAR OUTPUT PLUS2 9 TRA DP 10 v RA2 REAL STRING lapray sl 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 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 PLC CPU Convert Compile Setting Purpose The sequence program where the FB has been pasted cannot be executed as is on the PLC 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 PLC CPU Write to PLC Setting Purpose Write the converted sequence program to the PLC CPU Refer to Section 3 9 for the explanation
14. 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 POINT 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 FB3 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 Data name before changing FBI Cancel Changed Data name ADD_1 The FB name that may 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 unus
15. ACPU 2 PLC Type As the PLC type choose the CPU type to be used 3 Program Type When creating the FB select Ladder program or ST program 4 Label setting When setting the FB 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 and 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 CASW3D5GPPW ABCDEFGHIJKLMNOPQRSTUVWXYZ Characters not available in A QnA and FX series gt lt 75 2 5 Cand 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
16. AM 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 Label name FORCE ON FORCE OFF Toggle force Word device buffer memor y Device El Buffermemory Module startl O ex Address 7 FE Setting value 100 oec z fi bitinteger z Set Program Label reference program MAIN z Device Setting condition Program name ADD_I OUTI Force on ADD_1 PLUST 10000 ADD 1 INT Force off MAIN ADD 1 INT Force on MAIN T Jo Cer a When the device type of the selected label is the bit the label is entered into the Device field of Bit device b 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 Devi Perform device test on selected label FORCE OFF _ Toggle force Word device buffer memo y Device Buffermemory Module stertl O Hex Address z fh Device ADD_1 OUTI ADD 1 PLUST ADD TINI ADD TINI la 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
17. 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 F FD FEND FF FLT P FMOV P FX FY G GBIN P GE GOEND GRY P GT H I IMASK INC P INT INT P INT_TO_BOOL BYTE DINT DWORD REAL SINT UDINT UINT USINT WORD INV IRET J JMP JMPC JMPCN K 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 N NE NEG P NOP NOPLF NOT OR ORB ORF ORI ORN ORP OUT H P PAGE PCHK PLF PLS PLSY PWM O VIOIJZIl Ir x le Q D R RAMP RCJ READ REAL REAL_TO_BOOL BYTE DINT DWORD INT SINT UDINT UINT USINT WORD RECV REQ RET RETC RETCN RFRP RFS ROTC RST RTOP Appendix 1 Appendix 1 APPENDICES MELSOFT The strings which can not be us
18. Developer xj G 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 Verify source Verify dest Els Program dpe Program M MAIN M MAIN M MAINT M MAINT amp Parameter 2 4 Parameter M PLC Network M PLC Network A 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 7 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 amp 9 Ctr P Dialog Box 1 Ladder program CNN I xl PLC parameters Network parameters Device comment Device memory Device init TEL Cross reference list List of used device TC setting Project contents list Product information list 1 Fite MELSAP23 MELSAP P Ladder Instruction ist ST Label FB Structure Ladder Print Item r Program selection 4 IV Print Ladder Print Ladder Device r Additional information v Device
19. 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 PLC CPU Convert Compile Setting Purpose The sequence program where the FB has been pasted cannot be executed as is on the PLC 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 Compile Completed Local label is re allocated
20. G2 Data name MAIN Verify destination Project name F FB_ENG2 Data name MAIN lt Memory gt lt File gt Row number Text Row number Text No unmatched areas b Verify results When the results are not good Project verify Label program Verify source Project name F FB_ENG3 Data name MAIN Verify destination Project name F FB_ENG2 Data name MAIN 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 IO0 TEST H28 There is no corresponding rou 13 END IF There is no corresponding row 15 FBh IO TEST H28 There is no corresponding row 17 IF S_LBL FALSE THEN There is no corresponding row 18 M123 TRUE There is no corresponding row 19 There is no corresponding row 28 END IF There is no corresponding row 24 There is no corresponding row 25 There is no corresponding row 11 items unmatched 7 VERIFYING THE PROJECTS MELSOFT POINT 1 Verified data are as follows Parameters Sequence programs where FBs have been pasted Actual programs available by compiling the above sequence programs programs written to the PLC 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
21. GX Developer Version 8 MITSUBISHI IAN Function Block MELSOFT uw jr MELSOFT Integrated FA Software SW8D5C GPPW E e SAFETY PRECAUTIONS e Always read these instructions before using this equipment Before using this product please read this manual and the relevant manuals introduced in this manual carefully and pay full attention to safety to handle the product correctly The instructions given in this manual are concerned with this product For the safety instructions of the programmable controller system please read the CPU module user s manual In this manual the safety instructions are ranked as DANGER and CAUTION N Indicates that incorrect handling may cause hazardous conditions D DANGER resulting in death or severe injury CAUTION Indicates that incorrect handling may cause hazardous conditions resulting in medium or slight personal injury or physical damage Note that the NCAUTION level may lead to a serious consequence according to the circumstances Always follow the instructions of both levels because they are important to personal safety Please save this manual to make it accessible when required and always forward it to the end user Design Instructions 4 DANGER e For data change program change and status control made to the PLC which is running from a Personal computer configure the interlock circuit externally so that the system safety is ensured The a
22. LUSH K453 kid PLUSI 1 PLUSZ Ina Raz b 4 Output RAI RAZ pecu 3 variables Cri Mi bit RAI RA i i bur2 5 Internal variables bit 1 IN1 and IN2 are variables that turn ON OFF using external ON OFF information as conditions 2 PLUSI is a variable that inputs external numerical information to the FB inside 3 PLUS is a variable that outputs the result calculated in the FB inside numerical information to the outside 4 OUT1 and OUT 2 are variables that control external outputs with the results calculated in the FB inside ON OFF information 5 RA1 and RA are variables used in the FB inside only 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT ST Program 2 Input variable bit 4 Output variable word 1 VO variable bit 3 Input variable word INl INl OR IN2 BECMP_GE_M INl PLUS1 D200 BPLUS 3 M INl Kl D123 PLUS2 OUT M INl MO INl INl OR IN2 BKCMP GE M INl PLUSl Df00 DlD IN1 BPLUS 3 M INl Kl10 PLUS4 PLU 2 OUT M INl MO QUTl RAl AND NOT IN2 5 Output DUTZ NOT RAl AND R 2 variables bit El 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
23. USING FB MELSOFT 3 CREATING NEW SEQUENCE PROGRAM USING FB The following explains the operations to be performed to create a new sequence program uing the FB This chapter is designed to create the following FB definition program body FB variables and sequence program FB definition program INI t PLUS1 K500 k1 PLUS1 PLUS2 3 RAI INI A rag PLUS1 KA99 K10 PLUS1 PLUS2 J RAZ ADD 1 ADD 1Y B INI OUT1 8 110 A B IN2 UT2 B Nov Dio oti J W PLUST PLUS A H D200 J vin END The sample project qcpu fb of the sequence program described in this chapter is contained in the CD ROM of this product After installing GX Developer choose Project Open 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 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 of F Creation of program body and FB variables gt Input Output Label Constant Device type i VAR_INPUT INI BOOL M 2 VAR_INPUT IN2 BOOL
24. ab and double click Header or double click Header individually x x a qcpu fb2 a qcpu fb Spa Function Block 8 Function Block SENI 5 E ADD 1 E Header Body Window 7 6 l Edit Register Insert Add Close Delete ia Input Output Constant Device type Comment i VAR_INPUT BOOL 2 VAR_INPUT BOOL 3 VAR_INPUT INT 4 VAR_OUTPUT BOOL 5__ VAR_OUTPUT BOOL 6__ VAR_OUTPUT INT 7 BOOL 8 BOOL i a NN 1 3 4 5 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 e VAR IN OUT Variable having the functions of both the input and output e Blank Variable used in the FB inside 2 Label Set the label variable used in the FB definition program 3 Constant Set a constant value when you want to set a constant to the label where Blank has been selected for the variable type Enter a constant value with K H E or 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 I O 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 represente
25. able character strings i Illegal characters have been used for a data name Use legal characters 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 2 Click the LOK 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 7 Creating the Sequence Program 3 7 1 Editing the sequence program Setting Purpose Create an input ladder section and an output ladder section for the FB pasted to the sequence program n i tt na Do DI B IN2 D i ME 4Amnt s W PLUST 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 xo X j H JE PLS Ho NO H SET Mo Xo xt d PLS ut Wi H RST No mo 4 INGP 0100 x100 ADD T 4DD T RS in out 8 1110 l Do DI n 0UT2 8 4Nov D10 Di I 4 100 M PLUSI PLUS2 4 0200 P Es D200 K999 Yo END Program Creation 1 After the FB has been pasted the sequence program can be created by perfo
26. acter Strings Unusable as Labels and FB Names sss Appendix 1 INDEX Index 1 to Index 2 About Manuals The following manuals are also related to this product In necessary order them by quoting the details in the tables below Related Manuals Manual Name Manual Number Model Code GX Developer Version 8 Operating Manual Startup Describes the system configuration installation method and starting method of GX Developer Option IB 0800242E GX Developer Version 8 Operating Manual Explains the functions of the programming printout monitoring and debugging methods and so on GX Developer Option IB 0800243E GX Developer Version 8 Operating Manual Structured Text Describes the structured text ST program creation methods print out methods etc using GX IB 0800247E Developer QCPU QMode Programming Manual Structured Text SH 080366E 13JF68 Describes the structured text language programming methods Structured Text ST Programming Guide Book so SH 080368bE Written for those who will create structured text ST programs for the first time Describes the basic 13JF69 operation methods and functions through sample programs The above manuals are contained in the CD ROM together with the software package as a set If you want the manuals separately they are available optionally as printed matter When placing an order please indicate the manual numbers type c
27. 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 chapter 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 Cct LOJ Dialog Box Open project Project drive Ea B io qcpu fb SAMPLE SAMPLE Drive Peth C MELSECGPPW 2 1 Project name ete 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 ut
28. at iter eere ace p ere alia 4 1 4 1 2 Reading the existing project iii 4 1 4 2 Utilizing the Existing FB Definition Copy sess 4 2 4 2 1 Utilizing the existing FB definition from another projeCt i 4 2 4 2 2 Utilizing the existing FB definition within the same project 4 4 4 3 Changing the FB Definition Name i 4 6 4 4 Correcting the Program Body or FB Variables of the Utilized FB Definition i 4 8 4 5 Converting the FB Definition Convert Compile esssssesseeeeeneeeennnnn nnns 4 9 4 6 Pasting the Converted FB to the Sequence Program FB Utilization ii 4 9 4 7 Creating the Sequence Program 4 9 4 8 Converting the Sequence Program into the Program to Be Executed on the PEC CPU Convert Compile 2 clelia iaia al 4 9 4 9 Writing the Converted Sequence Program to the PLC CPU Write to PLC sss 4 9 5 DELETING UNNECESSARY FB DEFINITION FROM THE PROJECT 5 1105 2 le COMBINING MULTIPLE PROGRAMS INTO ONE 6 1t06 2 6 1 Combining Sequence Programs into ONE 6 1 6 2 Combining Comments into One Data Joint 6 2 7 VERIFYING THE PROJECTS 7 1t0 7 2 8 PRINTING 8 1t08 5 8 1 Printing the Sequence Program Including FB 8 1 8 2 Printing the FB Definition nennen ARAT AA ANATA A CREATA A aa 8 4 APPENDICES Appendix 1to Appendix 2 Appendix 1 Char
29. ation 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 Purpose Copy the FB definition already created in the same project to utilize it Operation Procedure e Click the right button of the mouse on the Function Block tab and choose Copy e Choose Project Edit Data Copy e Click the right button of the mouse on the lt lt Project gt gt tab and choose Copy Dialog Box 1 Data type Function Block 2 Copy source data name ADD 1 3 Copy destination data name AD D v 4 Title Cancel i 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 tha
30. cautions 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 500 steps For ST Program FB Definition Convert maximum 500 steps Label step Number of labels usable 500 pcs 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 Labels other than the input output and I O variables are used as internal variables Programming language Ladder list ST 1 OVERVIEW MELSOFT 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 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 nu
31. ch can search the FB pasted to the sequence program for the FB definition name or FB name Can be executed Can be executed Cannot be executed 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT POINT 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 Close Find direction amp From top to bottom C From cursorto bottom C From cursorto top 2 The cursor moves to the top left of the FB section Cursor moves to top left of object FB INGP D100 OUT B 110 Do Dt P__ E OUTZ B __N0Y DIO DI __ ______ oo gqu pusi pus 3 0200 K999 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 7 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 procedure Choose
32. comment 8 8 C 3 5 Statement note Alias Alias C Device name Alias v Contact user Print position Right Bottom Setup Printrange All Specified Coil user Printrange All Specified range r Print range All C Specified Print conditions a FW Prin NOPLF step din IV Renews page at each ladder block unit Setup range Prints the blank lines with no device comments In case of blocks under conversion before printing make sure that conversion is JV Print in the Macro Instruction format completed Ladder contacts Indication the same Printer setup Multiple printing Print Print preview Close 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 the necessary information for printing click the Print button to start printing Print example Ladder program xo xi mo 82 ME PLS Mo J AS 86 Bo 84 Mo mo 86 SET mo J AS zl 94 BI 93 X0 Xx Lil 88 44 di PLS Mi J Ms z l l amp o 90 m mo 92 RST mo J NS al 94 Bol 93 Mio D100 9 ince pio j sj 105 BOI 95 x100 ADD_1 00 97 B INI anb m o k DIA p Do DI 4e m ouT2 B w
33. ction to be taken for the system at the occurrence of communication errors caused by such as loose cable connection must be determined for online operation of PLC from Personal computers N CAUTION e Before performing online operations program change during PLC CPU RUN forced I O operation RUN STOP or similar operating condition change remote operation with the personal computer connected to the running PLC CPU read the manual carefully and ensure safety fully Note that program change during PLC CPU RUN online change may cause such problems as program corruption depending on the operation condition Use the equipment after fully understanding the precautions given in the GX Developer Operating Manual REVISIONS The manual number is given on the bottom left of the back cover Print Date Manual Number Feb 2003 IB NA 0800246E A First edition Oct 2003 IB NA 0800246E B Correction Section 3 13 Section 5 Japanese Manual Version SH 080359 B This manual confers no industrial property rights or any rights of any other kind nor does it confer any patent licenses Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property ights 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 ma
34. d 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 The input range is 1 to 255 Cancel Cancel 5 Comment MA When FB pasted to Set a comment within 64 sequence program is characters displayed with comments The comment set in this field appears under the label within the FB when the sequence program is displayed with comments For the ST Program choose View Label information and then put the cursor on ST Program to display comments in a tool tip format ADD 1 FB1 PLUS2 MEF DATA2 Label DUTI B OUTPUT1 Comment set on FB variable window W PLUST DUT2 B ATAI OUTPUT 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 batc
35. d output ladder sections The following is the program example where the above remedy has been taken a Sequence program BIT_WORDCFB1 in_out 124 H Daun x FB definition program ind e Kao in_out 1 KH HH mp K100 in out b Program executed after compile M8191 D12287 shan p ht non D12287 xO Pr wi181 E hi 131 e kagon pi2227 jH k mwe K100 D12287 Seton _ M MN D12287 Dann 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 9 Reading the Sequence Program from the PLC CPU Read from PLC Setting Purpose Read the sequence program from the PLC CPU Operation Procedure Choose Online Read from PLC or click amp This manual does not detail the operations for reading from PLC For details of the operations for reading from PLC 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 PLC To select the parameters and all programs of the project click the button 4 Click the button 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 10 Writing the Sequence Program to the PLC CPU Write to PLC Setting Purpose Write the converted sequence program to the PLC CPU Operation Procedure Choose On
36. de 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 A 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 7 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 EB qcpu fb H E Global variables e Program E Device comment 18 Parameter IE Device memory E Device init x100 QUT1 B 00 vu em ourz eior mo Dii o o prasa PLUS2 W r0200 p 16a f D200 k999 no For operation for an ST Pro
37. displayed Numeric value of storage source device Numeric value stored in input variable c For output variable BOOL 1 When the output variable is ON the label is highlighted ON indication of output variable END NOY D10 D11 i x 0 0 2 When the output variable is OFF the label is not highlighted OFF indication of output variable Y110 b For output variable INT DINT REAL The numeric value stored under the label is displayed Numeric value stored in output variable cu PLUS WA 0200 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 K500 PLUSI 1 1 PLUS1 PLUS2 i CRAT M PLUSI i98 M K10 PLUST Pus J 1 1 ti yra RA2 Ht COUT RA four2 DI Monitor status x 0300ms RUN Man zl The following dialog box appears if the FB definition window or FB variable setting window has already been displayed This will clase the Function Black 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 Setti
38. e 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 Y110 it will be difficult to use multiple pieces of the same FB definition in a sequence 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 2 Input variable word 3 Output i i sta i variables HH PH i PLUS K50D 3 K1 PLUS1 f pLuS2 i H Li bri word Paga i RAT A lt P
39. ed in label programming S SB SCJ SD SEND 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 SWAP P SWRITE SZ T TIME TR TRANA TRANC TRANCA TRANCO TRANCOC TRANJ TRANL TRANO TRANOA TRANOC T RANOCA 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 TO BOOL BYTE DINT DWORD INT REAL SINT UDINT UINT WORD V VAR VAR CONSTANT VAR EXT VAR EXTERNAL VAR EXTERNAL CONSTANT VAR EXTERNAL FB VAR EXTERNAL PG VAR GLOBAL VAR GLOBAL CONSTANT VAR GLOBAL FB VAR GLOBAL PG VAR IN 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 X XCH P W BCD TO DINT INT SINT XOR XORN Y Z ZCOM ZNRD ZNRF ZNTO ZNWR ZR Function MELSEC function group IEC function group group An error occurs if the character string used matches any of the above ones completely However the character strings are not case sensitive But the error may occurred when of device name contains the hexadecimal characters from 0 to F is after it Ex XFFF M100 Ot
40. elete all previous variables b 94 C verwrite previous variables and add new variable gt i 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 written 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 series GX Developer Ea Creation is not possible because same Function Block name is existing To execute copy change the FB definition name of the copy destin
41. ence program can be monitored like contacts and coils The program in the FB can also be monitored like the sequence program Operation Procedure When monitoring Choose Online Monitor Monitor mode or click F3 When stopping monitoring Choose Online Monitor Stop monitor or click Alt F3 When resuming monitoring Choose Online Monitor Start monitor or click 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 94 INGP D100 y x100 ADD 1 ADD 1 4 H Y110 A 97 B INT ou al f Do DI ERE m NOV D10 Dti y 0 0 0 0 D100 W PLUSI PLUSZ M 0200 1 1 11 144i D200 K999 C70 X 1 148 END J Monitor status 0 300ms RUN MAIN 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT The ladder block that includes the FB in the sequence 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
42. er for outputting numerical 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 b 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 24 3 24 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 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 xo x 88 F 1 ADD 1 FB2 92 B INT QUTI B B IN2 QUT2 8 WEPLUST PLUS2 5 Edit the sequence program that includes the FB as described below a Cut copy can be ma
43. gram refer to the GX Developer Version 8 Operating Manual Structured Text 2 The FB window appears PIS K500 7 qcpu fb EE Global variables Program Device comment Parameter Device memory Device init sm ics to w d PlUSI K493 k10 Pwsi PLUSZ haz eS 26 UTI 32 OUT2 38 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 x 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 7 3 Searching replacing the sequence program Search replace Setting Purpose Perform this operation when searching for or replacing a device instruction or like in the created sequence program Operation Procedure Choose Find Replace Find device Find instruction Find step no Find character str
44. h 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 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 devices to the labels used in the program eg fia pew 6144 When creating a sequence program avoid A em 3 a automatically assigned devices Like local devices the automatically assigned cw RE EX ax devices are set in accordance with the cg m fie a automatically assigned device setting which EAE defaults to the following device ranges T fer e 198 1 Word device D6144 to D12287 pa A EO EE 2 Bit device M4096 to M8191 m s 3 Timer T64 to T2047 When making an assigning point 0 4 Counter C512t0 C1023 a Lea When you want to change the device range choose Edit Auto device set
45. 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 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 t
46. he 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 unction Block diversion x eje EEEE Double click the FB definition name to be utilized from the Function Block diversion dialog box Alternatively click and choose the FB definition name to be utilized and click the OK button Diverted Function Block definition jADD 1 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 window and writes it in the device instruction input field Example FB ADD 1 Enter symbol Lx Ci l v FB ADD 1 c 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 QCPU Q mode Programming manual Structured Text 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT 3 6
47. her points to note regarding the label definition 1 Can not use the space character 2 Can not use the numerals as the starting character 3 Can not use the following m 2 8 3 96 LQ L 65s 72V But in case of underscore character an error may occurred when it is present at the end or two or more underscore characters are used consecutively App Appendix 2 Appendix 2 INDEX A Add DUON usu 3 12 Auto device setting seeen 3 13 Automatic assignment 3 13 C Command button esses 4 10 COMMENT 3 12 3 28 Compiles stucco 3 14 3 29 CONSTANTS sisi 3 8 3 11 D Delet button s iaia 3 12 Device test c anlem wal 3 39 Device type ssssseenen 3 12 BOOG xx eiue eet esed 3 12 EINE Tore reor rre seats 3 12 hier EE EE 3 12 REAL cei ettet 3 12 STRING aloe dial 3 12 D EB dae en e E 1 1 FB definition cce rte 1 2 FB definition name ssssse 1 4 FB definition program 1 2 FB definition window 1 2 EB riame skier ede eer esos 1 4 FB windOw esses 1 4 FB Section 5 nica elias 1 4 FB tab vive oa A ein bte 1 2 FB utilization ii 3 16 FBvariable cun 1 3 FB variable setting window 1 3 I l O variable iacet reris 3 8 3 11 Input ladder section
48. ht 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 gt choose Ihe FB definition the project are listed S 2 Select the item to be printed Header Body and click the Print button to start printing Print example FB variables Function block Header Function block name ADD_1 Title Label Device Constant Device kind Input outpat Comment INI B BOOL VAR INPUT IN BOOL VAR_ INPUT PLUSI INT VAR_INPUT OUTI BOOL VAR_OUTPUT our2 BOOL VAR OUTPUT PLUS2 INT VAR OUTPUT RAL BOOL a RA2 BOOL Print example Program body Function block ao 1 PLUS1 K500 K1 PLUSI PLUS2 RAI PLUS1 K499 K10 PLUS1 PLUS2 RA2 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 following 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 ANY ELEMENTARY ANY INT ANY MAGNITUDE ANY NUM
49. ilize 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 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 4 Dialog Box Copy Copy source Drive Path name Project name CAMELSECAGPPW qcpu fb Browse E i M PLCtype Q25H 8 Program MAIN amp Device comment _ COMMENT arameter C PLC Network Remote password Device initial value C MAIN rs Function Block amp 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 Jbutton Click this button to execute copy When the program is to be copied from another project the following dialog box is displayed Copy option X Would you copy global variables How to copy global variables a Copy all after d
50. ing Find contact or coil 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 Execution Range Sequence program The sequence program being displayed is the target of search replace window However the 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 the FB definition program being displayed is the target of search 2 Search replace is usable on the windows as indicated below Sequence Program FB Definition Search Replace Item FB Window Find device Find instruction Find step no Can be executed Can be executed Can be executed Find character string Find contact or coil Replace device Replace instruction Change open close contact Replace character string Change module start address Replace statement note type Cross reference list Can be executed Can be executed Can be executed List of used device 1 Only character string sear
51. line Write to PLC or click i This manual does not detail the operations for writing to PLC For details of the operations for writing to PLC 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 PLC To select the parameters and all programs of the project click the button 4 Click the button 1 For the Q or QnA integrated statements are written to the PLC CPU together with the programs Peripheral statements are not written to the PLC CPU In this case the statement note merge option has the function to merge statements notes with those in the personal computer when read from PLC is performed When the program has been read from the PLC CPU without use of this function be careful not to overwrite the old program accidentally to save a program having no statements notes 2 When writing a label program to the PLC execute write after choosing the Label program ST FB structure check button 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 PLC CPU to check the operating status of the PLC CPU The FB pasted to the sequ
52. mber 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 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 1 OVERVIEW MELSOFT b Precautions 1 A return connection cannot be used with an input ladder section and an output ladder section Return connection cannot be programmed x0 DEG 1 FB1 NINUSS M H D200 gt 0 TOP H10 K K100 K1 Receive it with a coil once and then use the contact of that coil as the condition of the target instruction x0 DEG 1 FB1 NINUSS M H D200 NO TOP H10 K K100 K1 2 The FB cannot be used in SFC and MELSAP L programs 3 If the device type of the FB differs from that of the input or output ladde
53. n b 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 Enter symbol x x Apr J p10o 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 Whois RI IN2tums ON The output variables BOOL will be conditions that control the external outputs In this example Y110 turns ON when OUT1 turns ON When OUT2 turns ON MOV D10 D11 is executed ADD 1 ADU 1 PLUS M f D200 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 A stored into PLUS1 Connect a data regist
54. nd 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 REMARK For details of the operation refer to Verifying Data in Projects of the GX Developer Version 7 Operating 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 FB_EN
55. ndex 2 Index 2 Microsoft Windows Microsoft Windows NT are registered trademarks of Microsoft Corporation in the United States and other countries Pentium is registered trademark of Intel Corporation in the United States and other countries Other company and product names herein are either trademarks or registered trademarks of their respective owners SPREAD Copyright C 1998 FarPoint Technologies Inc GX Developer Version 8 Operating Manual Function Block MODEL GXDEV8 O FB EL MODEL CODE IB NA 0800246E B 0310 MEE s MITSUBISHI ELECTRIC CORPORATION HEAD OFFICE 1 8 12 OFFICE TOWER Z 14F HARUMI CHUO KU 104 6212 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
56. ng Purpose Forcibly turn ON OFF the bit device of the PLC 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 Egi Att 1 Dialog Box FORCE ON FORCE OFF Toggle force Word device buffer memory Device Buffermemory Module start 1 0 z Hex Address EN 100 pec iebitinegr Set Program Label reference program MAIN Execution history Setting condition Program name ADD_I OUTI Force on MAIN ADD_I PLUSI 1000 MAIN dnex ADD 1INT Force off MAIN n ADD 1INT Force on MAIN gt Clear 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 x0 xt 92 1 H A PLS no J No 96 d H SET No J xo xt 88 Jr PLS Mi J Mi au HIRST Ho r N10 ut ice D100 3 x100 00 1 sj H Wd t11 0 M Do _ ot i _ a me DO DI J 0 D 0 o s 100 W PLUST PLUS2 M 0200 c OSO 0 9 10 10 i D200 K999 Yo 10 148 END 3 3 CREATING NEW SEQUENCE PROGR
57. nual and make sure you understand the functions and performance of MELSOFT series sequencer thoroughly in advance to ensure correct use CONTENTS Safety Precauti ns x5 n Hae EDU ipei He auper i ecc dup ir Pea ci aH eet dat A 1 REVISIONS RS A 2 CONTENTS o t e dete I lie rU E b pr E ian A 3 About Manuals m en Into rn rete ep NR OEA A 5 About the Generic Terms and Abbreviations nennen nnns A 6 1 OVERVIEW 1 110 1 7 1 1 What Is Function Block FB sessi nne tnnt innere nnne tenir 1 1 1 2 Features E i 1 2 1 3 Layouts and Names of Windows for Creating FB sse 1 2 1 4 What You Should Understand Before Using the FB i 1 5 1 5 SPeCiiGAllONS a4 vada rien alano nia 1 5 1 5sT Gompatible S PUS s vl illo Ont ia lito eil aset ants ets eise a ell 1 5 1 5 2 Specifications of and precautions for the FB sss 1 5 2 GENERAL PROCEDURES FOR EDITING THE FB 2 1t02 2 3 CREATING NEW SEQUENCE PROGRAM USING FB 3 1 to 3 42 3 1 Crating New Project for FB iter eet nent De en e as lele iii 3 3 3 2 Adding New FB Definition to the Created Project i 3 5 3 3 Creating FB Definition Program ui 3 7 3 4 Creating FB Vatiables 5 iaia ie eran i eiae ede eoe eae a oaa e en ad e deed ta dt e 3 13 3 5 Converting the FB Definition Convert Compile
58. ock 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 If you do not execute compile the correction is not reflected on the FB pasted to the sequence 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 PLC CPU that is in the RUN status Operation Procedure Choose Convert Convert Compile Online change or press F4 1 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 E x G Cannot execute RUN write because the program has not been converted Changing the option to Do not write PLC after conversion 2 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 X 1 Writing during RUN is not possible because the Function Block definition is not converted or not compiled Please write program to PLC
59. odes given in the above table About the Generic Terms and Abbreviations This manual uses the following generic names and abbreviations to represent the GX Developer software package and PLC CPU modules The module type is given when the corresponding type must be indicated clearly Generic Term Abbreviation Description Generic product name of product types SWnD5C GPPW SWnD5C GPPW A SWnD5C GPPW V and SWnD5C GPPW VA n indicates Version 8 or later GX Developer FB Abbreviation of the function block ST Abbreviation of a structured text QnACPU Generic name of the MELSEC QnA series PLC CPUs QCPU Q mode Generic name of the Q00 J CPU Q01CPU Q02 H CPU QO6HCPU Q12HCPU and Q25HCPU ACPU Generic name of the MELSEC A series PLC CPUs It includes the QCPUs A mode and motion controllers SCPU QCPU A mode Generic name of the Q02 H CPU A and Q06HCPU A Generic name of the MELSEC FX series PLC CPUs FXCPU The target PLCs are the FXo FXos FXoN FX1 FX2 FX2c FX1S FX1N FX2N and FX2NC QnA series When GX Developer is started on the QnACPU Q series When GX Developer is started on the QCPU Q mode 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 7 software package hereafter abbreviated to GX Developer For the explanation of the functions other
60. 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 the 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 Constant PLUS1 K500 PLUS1 PLUSE KA Rh 3 Inn lt PLUSI Kasa Kio PLUSI PLUS ine Raz 3 RAI Rag QUT dl RAI Rae Qura y 1 t 90 1 p PLUSI K500 Y KI PLUST PLUS IN2 RAT INI cagHt lt PLUSI kag K10 PLUSI PLUS ina E RA2 Ina UTI DI RAT RAZ C 9I t QUTI RAT RAZ t 32 Lf 4 lt 0UT2 38 3 When you have corrected added and or deleted the labels edit the labels on the FB variable setting window Edit operation Register Insert Add Close Delete Input Output Label Constant Device type i VAR_INPUT INI BOOL m 2 VAR INPUT IN2 BOOL 3__ VAR_INPUT 7 INS BOOL 4 VAR INPUT v PLUSI INT 5 j VAR OUTPUT OUTI BOOL 6 fpa 7JOUT
61. 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 e Click the right button of the mouse on the lt lt Project gt gt tab and choose Delete Dialog Box Mm Cancel Function Block 2 Delete data name ADD_1 Description 1 Data type Choose Function 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 xj 7 Are you sure you want to delete ADD1 y When the Function Block definition deleted the Following of the program incl
62. ov Dio Di J AS sal NS Di B D LI B D e mo JwPust PLUS2 W D200 Jh Mp D200 K999 vo y 148 m The following items cannot be printed when the FB was used to create the program MELSAP2 3 MELSAP L List printing 8 PRINTING MELSOFT 2 ST program Le xl PLC parameters Network parameters Device comment Device memory Device init TEL Cross reference list List of used device TC setting Project contents list Product information list 1 itte 7 i adder instruction tis T Label FB Structure r Program selection 4 MAIN Selec MAINI r Print range All C Specified line line Page setup Multiple printing Print preview Close Description 1 lt lt ST gt gt tab 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 FB1 IO TEST MO 3 END IF 4 5 FB2 IO_TEST MO 6 7 IF S LBL TRUE THEN 8 MO TRUE 9 10 END IF 11 IF S LBL TRUE THEN 12 FBS IO_TEST M10 13 END IF 14 15 FB4 IO_TEST M20 16 17 IF S LBL FALSE THEN 18 M123 TRUE 19 20 END IF 8 PRINTING MELSOFT 8 2 Printing the FB Definition
63. r section GX Developer displays an error message There are the following five FB device types BOOL Data represented by ON OFF INT Data represented by 16 bits DINT Data represented by 32 bits REAL Floating point data represented by 32 bits 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 4 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 Word device D6144 to D12287 e Bit device M4096 to M8191 Timer T64 to T2047 Counter C512 to C1023 2 GENERAL PROCEDURES FOR EDITING THE FB MELSOFT 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 y Creation of project v Addition of new FB definition ww Creation of program body ne e ar TA L Creation of FB variables eee t 1 ii bb Compile of FB definition ie e Pasting of FB to sequence program v Creation of sequence program Compile of
64. rming 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 ADD T FRI 1 QUTISB a BOOL B B IN2 l QUT2 8 b INT W l l i y WEPLUST PLUSZ M c DINT D press d REAL E Device type Label name e STRING S 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 operation 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 instructio
65. sequence program Write to PLC CPUWrite to PLC CPU y Monitor test of sequence program Correction of FB definition v Compile of sequence program Write to PLC CPU End This general procedure is for reference Ladder 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 Section 3 6 Refer to Section 3 7 Refer to Section 3 8 Refer to Section 3 10 Refer to Section 3 11 Refer to Section 3 12 Refer to Section 3 8 Refer to Section 3 10 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 QCPU Q mode 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 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 2 GENERAL PROCEDURES FOR EDITING THE FB MELSOFT MEMO 3 CREATING NEW SEQUENCE PROGRAM
66. shows the dialog box which allows you to confirm the number of errors in all programs Display example E ADD 1 P Number of errors in FB definition ADD 1 FB ADD 3 L Number of errors in FB definition ADD 3 omo FB ADD 2 L Number of errors in FB definition ADD 2 ADD 2 P Number of errors in FB definition ADD 2 ADD 3 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 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 x a gepu_tb2 E Global variables
67. t 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 Set the data name within eight characters Usable characters Alphanumeric characters _ tilde 95 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 x Al Are you sure to copy data from ADD_1 to ADD_2 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 Ea Creation is not possible because same Function Block name 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
68. 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 efficiency of program development but also reduces programming mistakes to improve program quality Definition of FB Definition of FB definition program and FB variables FB Input Output Label Constant Device type i VAR INPUT ivi BOOL ADD 1 ADD 1 2 VAR_INPUT IN2 poor 3 VAR_INPUT Puusi INT 4_ vaR_ouTPUT our Inno i s vaR_OUTPUT vour Hp w me pe A 6_ VAR_OUTPUT PLUS _ y f z Al gt 8 Raa Al 4 Ly FB variables wre FB definition program Utilization of FB Pasting of FB to sequence program ae JT fi A ud Compile J 9 Write to PLCX1 mer 0 0 m ome A Pe LER i Monitor status OOOO x O Gatomsf RUN fam 1 GX Developer performs write to PLC to write the compiled sequence program to the PLC CPU Hence the FB cannot be displayed if read from PLC is performed to read the sequence program from the PLC CPU Carefully store the sequence program
69. that is not yet compiled since it is needed to correct the FB 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 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 218 Z Project Edt Find Replace Convert View Online Diagnostics Tools Window Help lgl xi D as g S e ee isla eje lel Global variables 7 X afe Y E fici CELERE e SES P ed ene Pe om a afe 2 0 see ses gelo s e el 58 DI He bile HE i EEE i X
70. that represents the FB pasted to the sequence program Sequence program window Window used to edit the sequence program where the FB is pasted FB definition name Name of the FB definition displayed on the FB tab 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 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 in 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 Q02CPU Q02HCPU Q06HCPU Q12HCPU Q25HCPU QCPU Q mode Q12PHCPU Q25PHCPU Q2ACPU Q2ACPU S1 QBACPU Q4ACPU Q4ARCPU The FB is not available for the ACPU QCPU A mode FXCPU and motion controller of the PLC series either 1 5 2 Specifications of and pre
71. the Device field POINT 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 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 PLC 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 Ei This will close the Function Block definition window and will display the Function Bl
72. the labels are used in order starting with the last numbers D12287 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 BIT_WORDCFB1 out ioc Dann FB definition program inl Kann inz Pu K100 outi Assigned Device M8191 D12287 D12286 SAO J nao 012287 0 JAA rt i hi181 Kao pi2227 Pr Mw K100 D12287 SAO _ ____ 012287 Dann 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 e 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 D12287 assigned to in2 e The device D12286 assigned to out11 always transfers data to the device D400 in the output ladder section Since D12286 D12287 in this executed program are undefined at the startup of the PLC 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 I O variables connects the same devices to the input an
73. ting 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 15 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 A Compile Completed Click to write the label comments over the device comments 2 The following dialog box appears on detection of errors during execution of convert compile pera Choosing Contents of error and clicking the Jump button displays the error locations Program name 3 When errors are detected correct the error locations and then execute convert 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
74. ua a Li bs WwW r S 6 t S aa 9 LIC da PLUS Koo jte Ki PLUSI PLUS E E1 qcpu fb n rr na EE Header INI tm aH He Pws Kiss pets Pus RA RAI RAZ H ont RA RA SIA our 39 Project rg Structure si Body Roz Host station lowwte Num 3 CREATING NEW SEQUENCE PROGRAM USING FB MELSOFT Window ST Program ziei Z Project Edit Eind Replace Convert View Online Diagnostics Tools Window Help UE Dea amp e jeje 18 elel sal Globalvariables I z e 8 iru HJA tH usps ae pue prep Fe Fo ero Jaj e zE mal psp e e Fe s eet eden INI INI n BKCHP GE M PLUSl D200 D100 IN1 BPLUS 3 M INL Kl D123 PLUS2 OUT M INL N ze pepe gate E RE OR INL INI OR BKCHP GE M 100 D100 1N1 BPLUS_3_M IN1 K10 PLUS4 PLUS2 OUT_M IN1 MO IN AND NOT IN2 NOT INl AND IN2 Structure Ready o25H Host station fow 15co 1 Insert Num Project Fg Program Creation 1 To create an FB definition 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 500 steps For ST Program FB Definition Convert maximum 500 steps Label step Ladder list ST Supported mode Number of labels Max 500 pcs 2 Use labels variables to create th
75. uding the Function Block will be deleted The circuit block including the Function Block in the 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 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 x 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 b
76. v PLUSI yJOUT1 7 OUT2 PLUS2 v RAI v RA2 Q25H Hokt station FB variable setting window 1 3 1 3 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 1 MELSOFT series GX Developer C MELSEC GPPW sample_prg qcpu_fb LD Read mode MAIN 208 Step Of x Project Edit Find Replace Convert View Online Diagnostics Tools Window Help 281 xl olaju 2 e e e alae sll ele lel F5 I JA lO Fo sca cro a Global variables Eg Program A Device comment wf Parameter Device memory Device init Mio T R D100 Output ladder section Function block FB Input ladder section Project data list a 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 compile the step numbers are displayed without parentheses When compile is complete the step numbers may be changed Input ladder section Input ladder on the left side of the FB section Output ladder section Output ladder on the right side of the FB section FB section Square symbol
77. y 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 X040 82 L 3 H Yoco n ADD 1 FB1 B INN DOUT B lt Y10 X0A1 X042 SET yoo END ADD 2 FB1 B INI 0UT1 B B IN2 OUT2 B 0200 W PLUST PLUS2 M D201 1 Select and copy the area from step 0 to the necessary step of the copy source sequence program x181 AH INGP D10 d 131 6 COMBINING MULTIPLE PROGRAMS INTO ONE MELSOFT 2 Paste the copied sequence program to the step of the copy destination sequence program where you want to make insertion X00 0 E r060 3 xo ADD 1 FB1 1 H B INN 00u7 8 no 2 X041 X042 iaj H AF SET yoo y x180 x181 19 INGP DIO J x 182 by x100 ADD 2 FB2 UM 1 B IN1 QUT B 1 lt Y200 A X B IN2 OUT2 B 201 X 01 H 0200 W PLUSI PLUS2 M m 98 RN En J 3 Convert and save the sequence program 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 a

Download Pdf Manuals

image

Related Search

Related Contents

Gunblade NY - Arcade - Manual  Service d`alimentation de secours - Publications du gouvernement  Powermate PM0545008 User's Manual  膨脹式救命胴衣等の自己点検整備要領 - 社団法人・日本船舶品質管理  User Manual  Samsung BHM1100 用户手册  Kambrook CERAMIC KCE640 User's Manual  KLT  Pentax K-5 + 18-55 f/3.5-5.6 + 50-200mm f/4-5.6  METALIEN iAXE629 USB  

Copyright © All rights reserved.
Failed to retrieve file