MELSEC-Q/L/F StructuredProgramming Manual (Fundamentals)
A-8 MANUALSThe manuals related to this product are listed below.Please place an order as needed.(1) Structured programming(2) Operation of GX Works2O
5-185.2 Structured Ladder/FBD5.2.4 Ladder branches and compilation results(2) When multiple contacts are used, or a function/function block is used up
5.2 Structured Ladder/FBD5.2.5 Precautions on creating programs with structured ladder/FBD5-195WRITING PROGRAMS5.2.5 Precautions on creating programs
5-20MEMO
A App-11OVERVIEW2STRUCTURED DESIGN OF SEQUENCE PROGRAMS3PROCEDURE FOR CREATING PROGRAMS4PROGRAM CONFIGURATION5WRITING PROGRAMSAAPPENDICESIINDEXAPPEND
App-2Appendix 1 Correspondence between Generic Data Types and Devices Appendix 1 Correspondence between Generic Data Types and DevicesThe following t
Appendix 1 Correspondence between Generic Data Types and Devices App-3AAPPENDICESGeneric data typeANYANYANY_SIMPLEArrayStructureANY_BITANY_NUMTime Str
App-4Appendix 1 Correspondence between Generic Data Types and Devices Link direct deviceBit deviceLink input Jn\XLink output Jn\YLink relay Jn\BLink s
Appendix 1 Correspondence between Generic Data Types and Devices App-5AAPPENDICES*1 *1 *1 *1 *1 *1*1 *1 *1 *1 *1 *1*1 *1 *1 *1 *1 *1*1 *1 *1 *1 *1 *1*
App-6Appendix 2 Character Strings that cannot be Used in Label Names and Data Names Appendix 2 Character Strings that cannot be Used in Label Names a
Appendix 2 Character Strings that cannot be Used in Label Names and Data Names App-7AAPPENDICESTable App. 2-1 Character strings that cannot be used f
1OVERVIEW2STRUCTURED DESIGN OF SEQUENCE PROGRAMS3PROCEDURE FOR CREATING PROGRAMS4PROGRAM CONFIGURATION5WRITING PROGRAMSAAPPENDICESIINDEX1 1-1OVERVIEW
App-8Appendix 2 Character Strings that cannot be Used in Label Names and Data Names Table App. 2-1 Character strings that cannot be used for label na
Appendix 3 Recreating Ladder ProgramsAppendix 3.1 Procedure for creating a structured programApp-9AAPPENDICESAppendix 3 Recreating Ladder ProgramsThi
App-10Appendix 3 Recreating Ladder ProgramsAppendix 3.2 Example of creating a structured programAppendix 3.2 Example of creating a structured program
Appendix 3 Recreating Ladder ProgramsAppendix 3.2 Example of creating a structured programApp-11AAPPENDICES(2) Setting labelsSet global labels and loc
App-12Appendix 3 Recreating Ladder ProgramsAppendix 3.2 Example of creating a structured program(3) Creating a structured programThe following example
Appendix 3 Recreating Ladder ProgramsAppendix 3.2 Example of creating a structured programApp-13AAPPENDICES • Original program (Programming language:
App-14MEMO
1OVERVIEW2STRUCTURED DESIGN OF SEQUENCE PROGRAMS3PROCEDURE FOR CREATING PROGRAMS4PROGRAM CONFIGURATION5WRITING PROGRAMSAAPPENDICESIINDEXI Index-1INDE
Index-2 [Numeric character]32-bit index setting ... 4-45[A]address ...
WARRANTYPlease confirm the following product warranty details before using this product.1. Gratis Warranty Term and Gratis Warranty RangeIf any faults
1-21.1 Overview 1.1 OverviewThis manual describes program configurations and content for creating sequence programs using a structured programming me
Mcrosoft, Windows, Windows Vista, Windows NT, Windows XP, Windows Server, Visio, Excel, PowerPoint, Visual Basic, Visual C++, and Access are either re
SH-080782ENG-M(1307)KWIXMODEL: Q/FX-KP-KI-EMODEL CODE: 13JW06Specifications subject to change without notice.When exported from Japan, this manual doe
1.2 Purpose of This Manual 1-31OVERVIEW(2) Operations in each programming languageFor details of instructions used in each programming language, refer
1-41.2 Purpose of This Manual (3) Details of instructions in each programming language (for QCPU (Q mode)/LCPU)PurposeMELSEC-Q/L/F Structured Programm
1.2 Purpose of This Manual 1-51OVERVIEW(4) Details of instructions in each programming language (for FXCPU)PurposeMELSEC-Q/L/F Structured Programming
1-61.3 Terms 1.3 TermsThis manual uses the generic terms and abbreviations listed in the following table to discuss the software packages and program
1.4 Features of Structured Programs 1-71OVERVIEW1.4 Features of Structured ProgramsThis section explains the features of structured programs.(1) Stru
1-81.5 Applicable CPU Modules 1.5 Applicable CPU ModulesThe following table shows the applicable CPU modules for programs in the Structured project.T
1OVERVIEW2STRUCTURED DESIGN OF SEQUENCE PROGRAMS3PROCEDURE FOR CREATING PROGRAMS4PROGRAM CONFIGURATION5WRITING PROGRAMSAAPPENDICESIINDEX2 2-1STRUCTUR
2-22.1 What is a Hierarchical Sequence Program? 2.1 What is a Hierarchical Sequence Program? The hierarchy is to create a sequence program by dividin
2.2 What is a Structured Sequence Program? 2-32STRUCTURED DESIGN OF SEQUENCE PROGRAMS2.2 What is a Structured Sequence Program?A structured program i
2-4MEMO
1OVERVIEW2STRUCTURED DESIGN OF SEQUENCE PROGRAMS3PROCEDURE FOR CREATING PROGRAMS4PROGRAM CONFIGURATION5WRITING PROGRAMSAAPPENDICESIINDEX3 3-1PROCEDUR
3-23.1 Procedure for Creating Sequence Programs in Structured Project 3.1 Procedure for Creating Sequence Programs in Structured ProjectThis section
1OVERVIEW2STRUCTURED DESIGN OF SEQUENCE PROGRAMS3PROCEDURE FOR CREATING PROGRAMS4PROGRAM CONFIGURATION5WRITING PROGRAMSAAPPENDICESIINDEX4 4-1PROGRAM
4-24.1 Overview of Program Configuration 4.1 Overview of Program ConfigurationA sequence program created in the Structured project is composed of pro
4.1 Overview of Program Configuration4.1.1 Project4-34PROGRAM CONFIGURATION4.1.1 ProjectA project is a generic term for data (such as programs and pa
4-44.1 Overview of Program Configuration4.1.3 Tasks4.1.3 TasksA task is an element that contains multiple POUs, and it is registered to a program fil
4.2 POUs4.2.1 Types of POU4-54PROGRAM CONFIGURATION4.2 POUsA POU (abbreviation for Program Organization Unit) is a program component defined by each
A-1SAFETY PRECAUTIONS(Read these precautions before using this product.)Before using MELSEC-Q, -L, or -F series programmable controllers, please rea
4-64.2 POUs4.2.2 Program4.2.2 ProgramA program is an element that is stated at the highest level of POU.Functions, function blocks, and operators are
4.2 POUs4.2.4 Function blocks4-74PROGRAM CONFIGURATION4.2.4 Function blocksFunctions, function blocks, and operators are used to edit function blocks
4-84.2 POUs4.2.6 Ladder blocks4.2.6 Ladder blocksIn the structured ladder/FBD language, a program is divided into units of ladder blocks.In the ST la
4.2 POUs4.2.7 Programming languages for POUs4-94PROGRAM CONFIGURATION4.2.7 Programming languages for POUs Two types of programming language are avail
4-104.2 POUs4.2.8 Functions, function blocks, and operators4.2.8 Functions, function blocks, and operatorsThe following table shows differences among
4.2 POUs4.2.8 Functions, function blocks, and operators4-114PROGRAM CONFIGURATION(2) Internal variablesA function does not use internal variables. It
4-124.2 POUs4.2.8 Functions, function blocks, and operators(3) Creating instancesWhen using function blocks, create instances to reserve internal vari
4.2 POUs4.2.9 EN and ENO4-134PROGRAM CONFIGURATION4.2.9 EN and ENOAn EN (enable input) and ENO (enable output) can be appended to a function and func
4-144.2 POUs4.2.9 EN and ENO● Usage example of EN and ENONo Control description➀When the EN input is directly connected from the left power rail, the
4.3 Labels4.3.1 Global labels4-154PROGRAM CONFIGURATION4.3 LabelsLabels include global labels and local labels.4.3.1 Global labelsThe global labels
A-2 CONDITIONS OF USE FOR THE PRODUCT(1) Mitsubishi programmable controller ("the PRODUCT") shall be used in conditions;i) where any proble
4-164.3 Labels4.3.3 Label classes4.3.3 Label classesThe label class indicates from which POU and how a label can be used. Different classes can be se
4.3 Labels4.3.4 Setting labels4-174PROGRAM CONFIGURATION4.3.4 Setting labelsLabels used in a program require setting of either global label or local
4-184.3 Labels4.3.5 Data types4.3.5 Data typesLabels are classified into several data types according to the bit length, processing method, or value
4.3 Labels4.3.5 Data types4-194PROGRAM CONFIGURATION(2) Generic data typesGeneric data type is the data type of labels summarizing some elementary dat
4-204.3 Labels4.3.6 Expressing methods of constants4.3.6 Expressing methods of constantsThe following table shows the expressing method for setting a
4.4 Method for Specifying Data 4-214PROGRAM CONFIGURATION4.4 Method for Specifying DataThe following shows the six types of data that can be used for
4-224.4 Method for Specifying Data4.4.1 Bit data4.4.1 Bit dataBit data are data handled in units of 1 bit, such as contacts and coils.'Bit devic
4.4 Method for Specifying Data4.4.2 Word (16 bits) data4-234PROGRAM CONFIGURATION4.4.2 Word (16 bits) dataWord data are 16-bit numeric value data use
4-244.4 Method for Specifying Data4.4.2 Word (16 bits) data(b) The following table shows the numeric values that can be used as source data when digit
4.4 Method for Specifying Data4.4.2 Word (16 bits) data4-254PROGRAM CONFIGURATION(2) Using word devicesA word device is specified in unit of one point
A-3REVISIONSThe manual number is written at the bottom left of the back cover.Print date Manual number RevisionJul., 2008 SH(NA)-080782ENG-A First e
4-264.4 Method for Specifying Data4.4.3 Double word (32 bits) data4.4.3 Double word (32 bits) dataDouble word data are 32-bit numeric value data used
4.4 Method for Specifying Data4.4.3 Double word (32 bits) data4-274PROGRAM CONFIGURATION(b) The following table shows the numeric values that can be u
4-284.4 Method for Specifying Data4.4.3 Double word (32 bits) data1. When performing the process with digit specification, a desired value can be used
4.4 Method for Specifying Data4.4.4 Single-precision real/double-precision real data4-294PROGRAM CONFIGURATION4.4.4 Single-precision real/double-prec
4-304.4 Method for Specifying Data4.4.4 Single-precision real/double-precision real dataRemark1) Floating-point data are represented by four word devi
4.4 Method for Specifying Data4.4.4 Single-precision real/double-precision real data4-314PROGRAM CONFIGURATION(3) Precautions for when setting input v
4-324.4 Method for Specifying Data4.4.4 Single-precision real/double-precision real data1. Floating-point data in a CPU module can be monitored by the
4.4 Method for Specifying Data4.4.5 String data4-334PROGRAM CONFIGURATION4.4.5 String dataString data are character data used in basic instructions a
4-344.4 Method for Specifying Data4.4.6 Time data4.4.6 Time dataTime data are used in time type operation instructions of application functions.Speci
4.4 Method for Specifying Data4.4.7 Arrays4-354PROGRAM CONFIGURATION4.4.7 ArraysAn array represents a consecutive aggregation of same data type label
A-4 Japanese manual version SH-080735-R 2008 MITSUBISHI ELECTRIC CORPORATIONJul., 2011 SH(NA)-080782ENG-JL02CPU-P, L26CPU-PBTSection 5.2.5Section 1.
4-364.4 Method for Specifying Data4.4.7 Arrays[Structured ladder/FBD][ST]FOR Index1:=0 TO 4 BY 1 DO INC(TRUE,Var_D0[Index1]);END_
4.4 Method for Specifying Data4.4.8 Structures4-374PROGRAM CONFIGURATION4.4.8 StructuresA structure is an aggregation of different data type labels.S
4-384.5 Device and Address4.5.1 Device4.5 Device and AddressThis section explains the method for expressing programmable controller CPU devices. The
4.5 Device and Address4.5.2 Address4-394PROGRAM CONFIGURATION4.5.2 AddressAddress is a format defined in IEC61131-3.The following table shows details
4-404.5 Device and Address4.5.3 Correspondence between devices and addresses4.5.3 Correspondence between devices and addressesThis section explains t
4.5 Device and Address4.5.3 Correspondence between devices and addresses4-414PROGRAM CONFIGURATIONTable 4.5.3-1 Correspondence between devices and ad
4-424.5 Device and Address4.5.3 Correspondence between devices and addresses(2) Digit specification of bit devicesThe following table shows the corres
4.6 Index Setting 4-434PROGRAM CONFIGURATION4.6 Index Setting(1) Overview of the index setting(a) The index setting is an indirect setting that uses
4-444.6 Index Setting 2) Devices with restrictions on index registers(c) Devices that can be used for the index setting (for FXCPU)The following table
4.6 Index Setting 4-454PROGRAM CONFIGURATION(d) The following figure shows the examples of index setting and their actual processing devices.(With the
A-5INTRODUCTIONThank you for purchasing the Mitsubishi MELSEC-Q, -L, or -F series programmable controllers.Before using this product, please read th
4-464.6 Index Setting (a) Specifying a range of index registers used for a 32-bit index setting1) Values from 2147483648 to 2147483647 can be set to
4.6 Index Setting 4-474PROGRAM CONFIGURATION4) Usage range of index registersThe following table lists the usage range of index registers when setting
4-484.6 Index Setting (b) Specifying a 32-bit index setting using 'ZZ'1) A 32-bit index can be specified to the index register by specifying
4.6 Index Setting 4-494PROGRAM CONFIGURATION5) The following figure shows the examples of 32-bit index setting using 'ZZ' and their actual p
4-504.6 Index Setting (4) Applying index settings to extended data registers (D) and extended link registers (W) (for Universal model QCPU (excluding
4.6 Index Setting 4-514PROGRAM CONFIGURATION2) Index settings that cross file registers (ZR), extended data registers (D), and extended link registers
4-524.6 Index Setting (b) An index setting is applicable to both start I/O numbers of the intelligent function module and buffer memory addresses for
4.6 Index Setting 4-534PROGRAM CONFIGURATION(6) Precautions(a) Using the index setting for arguments of instruction/application function/function/func
4-544.6 Index Setting (c) Applying the index setting in the CALL instructionThe pulse can be output by using edge relays (V) with the CALL instruction
4.7 Libraries 4-554PROGRAM CONFIGURATION4.7 LibrariesA library is an aggregation of data including POUs, global labels, and structures organized in a
A-6 4.2.9 EN and ENO ...
4-564.7 Libraries4.7.1 User libraries4.7.1 User librariesA user library is a library for storing created structures, global labels, POUs, and other d
4.8 Precautions on Assigning a Name 4-574PROGRAM CONFIGURATION4.8 Precautions on Assigning a NameThis section explains the conditions for assigning a
4-58MEMO
1OVERVIEW2STRUCTURED DESIGN OF SEQUENCE PROGRAMS3PROCEDURE FOR CREATING PROGRAMS4PROGRAM CONFIGURATION5WRITING PROGRAMSAAPPENDICESIINDEX5 5-1WRITING
5-25.1 ST5.1.1 Standard format5.1 STThe ST language is a text language with a similar grammatical structure to the C language.Controls such as condit
5.1 ST5.1.2 Operators in ST language5-35WRITING PROGRAMS5.1.2 Operators in ST languageThe following table shows the operators used in the ST program
5-45.1 ST5.1.3 Syntax in ST language5.1.3 Syntax in ST languageThe following table shows the syntax that can be used in the ST program.Table 5.1.3-1
5.1 ST5.1.3 Syntax in ST language5-55WRITING PROGRAMS(2) IF THEN conditional syntax(a) Format(b) DescriptionThe syntax is executed when the value of B
5-65.1 ST5.1.3 Syntax in ST language(4) IF ...ELSIF conditional syntax(a) Format(b) DescriptionSyntax 1 is executed when the value of Boolean expressi
5.1 ST5.1.3 Syntax in ST language5-75WRITING PROGRAMS(6) FOR...DO syntax(a) Format(b) DescriptionThe FOR...DO syntax repeats the execution of several
A-7APPENDICES App - 1 to App - 14Appendix 1Correspondence between Generic Data Types and Devices App - 2Appendix 2Character Strings that cannot be U
5-85.1 ST5.1.3 Syntax in ST language(8) REPEAT...UNTIL syntax(a) Format(b) DescriptionThe REPEAT...UNTIL syntax executes one or more syntax while the
5.1 ST5.1.4 Calling functions in ST language5-95WRITING PROGRAMS(10) EXIT syntax(a) Format(b) DescriptionThe EXIT syntax is used only in iteration syn
5-105.1 ST5.1.5 Calling function blocks in ST language5.1.5 Calling function blocks in ST languageThe following description is used to call a functio
5.1 ST5.1.6 Precautions when using conditional syntax and iteration syntax5-115WRITING PROGRAMS5.1.6 Precautions when using conditional syntax and it
5-125.1 ST5.1.6 Precautions when using conditional syntax and iteration syntax(2) When Q00UCPU, Q00UJCPU or, Q01UCPU is used, and the string type is a
5.2 Structured Ladder/FBD5.2.1 Standard format5-135WRITING PROGRAMS5.2 Structured Ladder/FBD The structured ladder/FBD is a graphic language for writ
5-145.2 Structured Ladder/FBD5.2.2 Ladder symbols in structured ladder/FBD language5.2.2 Ladder symbols in structured ladder/FBD languageThe followin
5.2 Structured Ladder/FBD5.2.2 Ladder symbols in structured ladder/FBD language5-155WRITING PROGRAMSTable 5.2.2-1 Ladder symbols in the structured la
5-165.2 Structured Ladder/FBD5.2.3 Executing order5.2.3 Executing orderThe following figures explain the program executing order.The operation order
5.2 Structured Ladder/FBD5.2.4 Ladder branches and compilation results5-175WRITING PROGRAMS5.2.4 Ladder branches and compilation resultsWhen the ladd
Comments to this Manuals