Mitsubishi Electric MELSEC iQ-F Series Programming Manual

Mitsubishi Electric MELSEC iQ-F Series Programming Manual

Hide thumbs Also See for MELSEC iQ-F Series:

Advertisement

Quick Links

MELSEC iQ-F
FX5 Programming Manual (Program Design)

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi Electric MELSEC iQ-F Series

  • Page 1 MELSEC iQ-F FX5 Programming Manual (Program Design)
  • Page 3: Safety Precautions

    • Since the examples indicated by this manual, technical bulletin, catalog, etc. are used as a reference, please use it after confirming the function and safety of the equipment and system. Mitsubishi Electric will accept no responsibility for actual use of the product based on these illustrative examples.
  • Page 4: Table Of Contents

    CONTENTS SAFETY PRECAUTIONS ..............1 INTRODUCTION .
  • Page 5 Program Execution Order..............69 The order of executions of program units .
  • Page 6: Relevant Manuals

    RELEVANT MANUALS Manual name <manual number> Description MELSEC iQ-F FX5 User's Manual (Startup) Describes the performance specifications, procedures before operation, and <JY997D58201> troubleshooting of the FX5 CPU module. MELSEC iQ-F FX5UJ User's Manual (Hardware) Describes the details of hardware of the FX5UJ CPU module, including input/output <SH-082206ENG>...
  • Page 7: Terms

    Manual name <manual number> Description MELSEC iQ-F FX5 User's Manual (Temperature Control) Describes the temperature control module. <SH-081799ENG> MELSEC iQ-F FX5 User's Manual (Safety Control) Describes the safety extension modules. <SH-082078ENG> GX Works3 Operating Manual Describes the system configuration, parameter settings, and online operations of GX <SH-081215ENG>...
  • Page 8 Different name for FX3U-32BL Peripheral device Generic term for engineering tools and GOTs Generic term for Mitsubishi Electric Graphic Operation Terminal GOT1000 and GOT2000 series ■Software packages Engineering tool The product name of the software package for the MELSEC programmable controllers...
  • Page 9: Chapter 1 Outline

    OUTLINE This manual describes program configurations, content, and method for creating programs. For how to create, edit, or monitor programs using the engineering tool, refer to the following. GX Works3 Operating Manual Type of programming languages With the FX5 series, the optimal programming language can be selected according to the application. : Applicable : Inapplicable Programming language Description...
  • Page 10 ■FBD/LD language When using FBD/LD language, refer to the following. Page 62 FBD/LD LANGUAGE ■SFC program When using SFC program, refer to the following. Page 70 SFC PROGRAM • Ladder diagram and FBD/LD language are for customers who have knowledge or experience of sequence control and logic circuits.
  • Page 11: Chapter 2 Program Configuration

    PROGRAM CONFIGURATION Using the engineering tool, multiple programs and program organization units (POUs) can be created. Programs and POUs can be divided according to processing. This chapter describes the program configuration. Project Program file 1 Program file 2 FB file FUN file Program block Program block...
  • Page 12: Chapter 3 Program Organization Units

    PROGRAM ORGANIZATION UNITS There are three types of program organization units (POUs). • Program block • Function • Function block Processing can be described in the programming language that suits the control performed in each POU. Processing can be described in the ladder diagram, structured text language, or FBD/LD in a function or a function block. Functions and function blocks are called and executed by program blocks.
  • Page 13: Program Blocks

    Program Blocks A program block is a unit for making up a program. Multiple program blocks can be created in a program file and executed in the order specified in the program file setting. If the order is not specified in the program file setting, the program blocks are executed in ascending order of their names. By separating program blocks for individual functions and processing, the order of programs can be changed easily and programs can be exchanged easily.
  • Page 14 Create a program block as shown below. ProgPou1 ProgPou2 ProgPou3 Main routine program Subroutine program Interrupt program FEND IRET Execute the program according to the order of the execution of program file setting. Program file setting The order of the program blocks Actual program Main routine program ProgPou1...
  • Page 15: Functions (Fun)

    Functions (FUN) A function is a POU called and executed by program blocks, function blocks, and other functions. After the processing completes, a function passes a value to the calling source. This value is called a return value. A function always outputs the same return value, as the processing result, for the same input. By defining simple, independent algorithms that are frequently used, functions can be reused efficiently.
  • Page 16 Input variables and output variables Input and output variables can be defined in functions. Output data which is different from the return value can be assigned to the output variable. Ladder program FBD/LD program (1) Function name (2) Input variable (3) Output variable The return value of the function is not displayed.
  • Page 17 Creating programs The program of a function can be created by using the engineering tool. [Navigation window]  [FB/FUN]  Right-click  [Add New Data] Select "Function" for "Data Type" in "Basic Setting". The created program is stored in the FUN file. [CPU Parameter] ...
  • Page 18 Labels defined by a function The labels defined by a function are assigned in the temporary areas of the storage-target memory during execution of the function, and the areas are freed after the processing completes. When calling FUN1 and FUN2 from the main program, and calling FUN3 by FUN1 (...
  • Page 19 Number of steps To call a function, the number of steps is required not only for the program itself but also for the processing that passes the argument and return value and the processing that calls the program. ■Program The number of steps required for a function program is the total number of instruction steps plus a minimum of additional 13 steps occupied by the system.
  • Page 20: Function Blocks (Fb)

    • EN/ENO The following table lists the number of steps required for EN/ENO. Item Number of steps 4 to 7 (The number of steps differs depending on the details of the program such as the type and number of the device specified as the input source of EN.) 6 to 10 (The number of steps differs depending on the details of the program such as the type and number of the device specified as the...
  • Page 21 Operation overview ■Macro type function blocks The program of a macro type function block is loaded by a calling source program along the execution flow. At the time of program execution, the loaded program is executed in the same way as the main program. Use a macro type function block when giving a higher priority to the processing speed of the program.
  • Page 22 Input variables, output variables, and input/output variables Input variables, output variables, and input/output variables need to be defined in function blocks. A function block can output multiple operation results. It can also be set not to output operation results. (1) The operation result(s) is output. Instance Instance (2) No operation result is output.
  • Page 23 Instances ■Instances An instance is a label assigned to realize a function block definition. Multiple instances can be created from one function block definition. An instance consists of the following items. Item Description Local label area Used to assign the local label of the function block. Local latch label area Used to assign the latch attribute local label of the function block.
  • Page 24 Structure of instance for nested function block FB1 definition FB1 definition FB1 instance structure FB1 instance structure Ladder program (FB1) Local label area bLabel0 bLabel0 bLabel1 INCP wLabel0 bLabel2 wLabel1 bLabel1 Padding size 2 words wLabel1 bLabel2 bLabel1 wLabel0 bLabel0 Creating an instance based on wLabel1...
  • Page 25 ■Creating instances A function block needs to be instantiated to be used in programs. By creating instances, a function block can be called and executed by a program block or another function block. Declare instances with global labels or local labels. Label type Instance type Class...
  • Page 26 ■Capacity of instance The capacity of each data area of an instance should be calculated as follows. • Capacity of local label area Capacity of local label area of instance = Total capacity of data of local labels (except the ones with latch attribute) + Capacity of reserved area Item Description...
  • Page 27 EN and ENO In the same way as a function, EN (enable input) and ENO (enable output) can also be appended to a function block to control execution processing. Page 14 EN and ENO When the instance of a function to which EN/ENO has been appended is called, an actual argument must be assigned to EN. Creating programs The program of a function block can be created by using the engineering tool.
  • Page 28 ■Inherent property setting The following items can be set when a program of a function block is created. ( GX Works3 Operating Manual) Item Description Use MC/MCR to Control EN For "Yes", the MC/MCR instructions are used to control EN. For "No", the CJ instruction is used to control EN. Select "Yes"...
  • Page 29 Number of steps (Subroutine type function blocks) ■Calling source When calling a subroutine type function block, the calling source generates the processing that passes the argument before and after the call processing. (1) Passing the argument (input argument, input/output Program block 1 argument) (displayed) Program file...
  • Page 30: Precautions

    Precautions When a subroutine program or an interrupt program is used • Set subroutine programs and interrupt programs after the FEND instruction. When the subroutine program and interrupt program are set before the FEND instruction, an error occurs. Program file Execution order Because the subroutine...
  • Page 31 When a function block is used ■Global pointer/pointer type global labels The global pointer and pointer type global labels cannot be used as the labels indicating the number of program steps. ■When the index register is used When the index register is used in the function block program, ladder programs for saving and returning the index register values are required to protect the values.
  • Page 32 ■When a conversion error occurs in VAR_INPUT, VAR_OUTPUT, or VAR_IN_OUT in a macro type function block A program block that is the calling source of the function block or the function block may cause the error. In this case, check the inputs and outputs of the program block that is the calling source of the function block and the function block.
  • Page 33 Changing program capacity (FX5U/FX5UC CPU module only) When the program capacity setting parameter is changed to 128000 steps from 64000 steps, the operation changes as follows. • Signal flow area for FB is expanded from 16K bytes to 32K bytes. •...
  • Page 34: Chapter 4 Labels

    LABELS Labels are variables for I/O data or internal processing, specified by a character string. Users can create a program without considering devices or buffer memory size by using labels. Thus, a program, where labels are used, can be reused in a system with a different module configuration easily. When labels are used, there are some precautions on programming and functions used.
  • Page 35: Class

    Class The label class indicates how each label can be used from which POU. The selectable class varies depending on the POU. Global label Class Description Applicable POU Program Function Function block block    VAR_GLOBAL Common label that can be used in program blocks and function blocks ...
  • Page 36 Data type Description Value range length Time TIME Handles values as d (day), h (hour), m T#-24d20h31m23s648 ms to 32-bit (minute), s (second), or ms (millisecond) T#24d20h31m23s647 ms String(32) STRING Handles a character string (character) Up to 255 letters (half-width Variable character) Page 34 Data types of timers and counters...
  • Page 37 Generic data type (ANY) The generic data type indicates data type of a label which combines several basic data types. The data type name begins with "ANY". The generic data type is used when multiple data types are available in arguments or return values etc. of a function of a function block.
  • Page 38: Arrays

    Arrays An array represents a consecutive accumulation of the same data type labels, under the same name. Arrays can be defined by the elementary data types or structures. The maximum number of arrays differs depending on the data types. One-dimensional array Two-dimensional array Label name Indexes Label name...
  • Page 39 Precautions When a bit of a device/label (example: D0.0) is assigned to bit array in global label, labels and devices can not be used for the array index in programming (example: bLabel1[D0] cannot be programmed). • The data storage location becomes dynamic by specifying a label for the array index. This enables arrays to be used in a program that executes loop processing.
  • Page 40: Structures

    ■Array elements When accessing the element defined in an array, access it within the range of the number of elements. If a constant out of the range defined for the array index is specified, a compile error will occur. If the array index is specified with data other than a constant, a compile error will not occur. The processing will be performed by accessing another label area or latch label area.
  • Page 41 Arrays of structures Structures can also be used as arrays. Structure label [1] Structure label [2] Structure label [3] Structure label [4] Member (Label 1) Member (Label 1) Member (Label 1) Member (Label 1) Member (Label 2) Member (Label 2) Member (Label 2) Member (Label 2) Member (Label 3)
  • Page 42: Constant

    Constant Types of constants The following table shows the expressions for setting a constant to a label. Applicable data type Type Expression Example Boolean data Input "TRUE" or "FALSE". TRUE, FALSE Binary Append "2#" in front of a binary number. 2#0, 2#1 Octal Append "8#"...
  • Page 43: Precautions

    Precautions Functions with limitations In the following functions, there is a limitation on label use. Item Description Trigger of an event execution type program Labels cannot be used. Consider taking the following measures. • Use devices. • Define a label to be used as a global label and assign devices to the global label. Intelligent function module refresh setting Labels cannot be used.
  • Page 44 Precautions for creating programs When specifying a label as an operand used in instructions, match the data type of the label with that of the operand. In addition, when specifying a label as an operand used in instructions that control continuous data, specify the data range used in instructions within the data range of the label.
  • Page 45: Chapter 5 Ladder Diagram

    LADDER DIAGRAM Ladder diagram is a language that describes the sequence control by indicating logical operations consisting of "AND" or "OR" with combinations of series connections and parallel connections in a ladder consisting of contacts and coils. Configuration With the ladder diagram, the following ladder can be created. (1) A ladder consists of contacts and coils (2) A ladder connected in series (3) A ladder connected in parallel...
  • Page 46: Program Execution Order

    Element Symbol Description Function Executes a function. • How to create functions (GX Works3 Operating Manual) • Standard function (MELSEC iQ-F FX5 Programming Manual (Instructions, Standard Functions/Function Blocks)) Function block Executes a function block. • How to create function blocks (GX Works3 Operating Manual) •...
  • Page 47: Precautions For Using A Function Block In Ladder Diagram

    Precautions for using a function block in ladder diagram Precautions for directly connecting to an FB instance from the left rail When EN and input variables (bit type) are directly connected to the left rail in the input circuit of the FB instance, the on/off state does not change.
  • Page 48: Inline St

    Inline ST Inline ST is a function that creates, edits and monitors inline ST box that displays an ST program in a cell of an instruction that is equivalent to a coil in the ladder editor. Numerical operations or character string operations can be created easily in a ladder program. •...
  • Page 49: Statements And Notes

    Statements and Notes In a ladder program, statements and notes can be displayed. Statements By using statements, users can append comments to circuit blocks. Appending statements makes the processing flow easy to understand. Statements include line statements, P statements, and I statements. A line statement can be displayed on a tree view of the Navigation window.
  • Page 50: Chapter 6 St Language

    ST LANGUAGE The ST language is one of the languages supported by IEC 61131-3, the international standard that defines the description methods for logic. ST language is a text programming language with a grammatical structure similar to C language. ST language is suitable for programming some complicated processing that cannot be easily described using ladder diagram.
  • Page 51: Configuration

    Configuration Operators and syntaxes are used for programing in ST language. intV2 := ABS(intV1); Assignment statement THEN btn01 := TRUE; ELSE Conditional statement btn01 := FALSE; END_IF; Output_ENO := ENEG(btn01,Input1); Calling a function LadderFBInstance(Input1:=bool1,Input2:=bool2,Input3:=bool3); Calling a function block (* user function block *) A statement must end with ";"...
  • Page 52: Delimiter

    Delimiter The following delimiters are provided in ST language for clarifying the program structure. Symbol Description Parenthesized Specification of an array element . (period) Specification of members of the structure or function block , (comma) Separation of arguments : (colon) Device type specifier ;...
  • Page 53: Syntax

    Syntax The following table shows the types of statements that can be used in a ST program. Item Description Reference Page 51 Assignment statement Assignment statement Assignment statement Page 52 Sub-program control statement Sub-program control statement Function block call statement, function call statement RETURN statement Page 53 Conditional statement Conditional statement...
  • Page 54 To avoid the deletion of the data during type conversion, only conversion from smaller type to larger type is performed. Of the elementary data types, type conversion is performed only for the following data types among basic data types are the targets of a type conversion.
  • Page 55 ■Function call statement Format Description Function name(Variable1, Variable2, ...); Enclose an argument by "()" after the function name. When using multiple arguments, delimit them by "," (comma). Assigning to variables stores the execution result of the function. Function Example Calling a function with one input variable (Example: ABS) Outout1 := ABS(Input1);...
  • Page 56 Syntax Format Description Example ■CASE CASE <Integer expression> OF When the statement that has the integer selection value that CASE intV1 <Integer selection 1> : matches with the value of the integer expression (conditional <Statement 1⋅⋅⋅> ; expression) is executed, and if no integer selection value bool1:=TRUE;...
  • Page 57 Precautions ■When an assignment statement is used • The maximum number of character strings that can be assigned is 255. If 256 or more character strings are assigned, a conversion error occurs. • Contacts and coils of the timer type or counter type cannot be used for the left side of an assignment statement. •...
  • Page 58 ■Using the operator "-" for sign inversion in an arithmetic operation When the operator "-" is used to invert the sign of the minimum value of a data type, the minimum value evaluates to the same value. For example, -(-32768), where the operator "-" is used with the minimum value of INT type, evaluates to -32768. Thus, an unintended result may be produced if the operator "-"...
  • Page 59 ■When a timer function block or counter function block is used Boolean expression (conditional expression) in a conditional statement differs for the execution conditions of the timer function block or counter function block. When a timer function block is used Program before change bLabel1 THEN...
  • Page 60 ■When a rising execution instruction or a falling execution instruction is used Shown here is the operation when a rising execution instruction or an fall execution instruction is used in an IF statement or a CASE statement. Condition Result of operation Conditional Condition to Result of the ON/...
  • Page 61: Constant

    ■When a master control instruction is used Shown here is the operation when the master control is OFF. • The statement in a selection statement (an IF statement or a CASE statement) or in a iteration statement (a FOR statement, a WHILE statement, or a REPEAT statement) is not processed. •...
  • Page 62: Label And Device

    Label and device Specification method Labels and devices can be directly described in the ST program. Labels and devices can be used for the left or right side of an expression or as an argument or return value of a standard function/function block. For available labels, refer to the following.
  • Page 63: Comment

    Precautions • The pointer type can be used for ST programs. • When a value is assigned using nibble specification, use the same data type for the left side and right side of an operation. D0 := K5X0; In the above case, since K5X0 is the double word type and D0 is the word type, an error occurs in the program. •...
  • Page 64: Chapter 7 Fbd/Ld Language

    FBD/LD LANGUAGE This is a language that creates a program by wiring blocks for specific processing, variables, and constants along with the flows of data and signals. Configuration With the FBD/LD language, the following program can be created. (1) FBD unit (2) LD unit (3) Common unit (4) Connecting wire...
  • Page 65: Program Unit

    Program unit FBD unit Units constituting FBD/LD program are shown below. Unit Symbol Description Variable A variable is used to store each value (data). The data type of a variable should be a certain type. Only the value (data) of the data type is stored. You can specify a label or a device to a variable.
  • Page 66 ■The input/output point of a function • It is necessary that all the input points of a function should be connected to other FBD units over connecting wires. • The data types of the input variables and output variables of a function should be of certain types. It is necessary that the FBD units to be connected to the input point or output point should be of the same data types.
  • Page 67 LD unit Units of ladder diagram that can be used in a program of the FBD/LD language are shown below. Unit Symbol Description Left bus This is an unit to represent a bus. This is the starting point to create a ladder circuit. NO contact Turns on when a specified device or label is ON.
  • Page 68 Common unit This represents a common unit placed on the FBD/LD editor. Unit Symbol Description Jump The execution processing is jumped over from a jump unit to a jump label. The portion that is jumped over is not executed. Whether a jump is made or not is controlled depending on the ON/OFF information to the jump unit. ON: The execution processing is jumped over up to a jump label.
  • Page 69 ■The operation of a return unit A return unit operates differently depending on whether a program, function, and/or function block used there. Program unit to use Program The execution of the program unit is terminated. Function The function is terminated, and the step goes back to the one next to the instruction that has called the function. Function block The function block is terminated, and the step goes back to the one next to the instruction that has called the function block.
  • Page 70: Worksheet

    ■Inverting input and output points You can invert an input to an unit or an output from an unit by using a connecting point. The connecting point having been inverted is circled with a black circle. The data to be input or output is inverted (FALSE to TRUE or TRUE to FALSE).
  • Page 71: Program Execution Order

    Caution ■When using label • Labels whose name ends with "_" cannot be used as an array index. To use such a device or label as an array index, assign it to another device or label and specify that device or label as an index. •...
  • Page 72: Chapter 8 Sfc Program

    GX Works3 Operating Manual MELSEC iQ-F FX5 User's Manual (Application) Transition from MELSEC FX3G, FX3U, FX3UC Series to MELSEC iQ-F Series Handbook • Applicable only to FX5U/FX5UC CPU module. • Check the versions of the CPU module and the engineering tool before using the SFC program. For the versions of the CPU module and engineering tool, refer to Page 118 Added and Changed Functions.
  • Page 73 The SFC program consists of steps that represent units of operations in a series of machine operations. In each step, the actual detailed control is programmed. Machining operation flowchart SFC diagram Ladder diagram of the action or transition of each step Start Workpiece Conveyer...
  • Page 74 It is possible to assign the actual controls of the entire facility, mechanical devices of each station, and all machines to the steps in the blocks of the SFC program. Station 1 Station 2 Station 3 control unit control unit control unit Step transition Transfer machine...
  • Page 75: Specifications

    Specifications This section lists the performance specifications related to SFC Programs. Item Specifications Number of device points (SFC) Step relay (S) 4096 points SFC block device (BL) 32 points SFC transition device (TR) 0 points Number of executable SFC programs Number of blocks 32 blocks Number of SFC steps...
  • Page 76: Structure

    Structure Basic operation of SFC An SFC program starts at an initial step, executes the next step every time the relevant transition becomes TRUE, and ends a series of operations at an end step. (1) Initial step (2) Action (3) Transition (4) Normal step (5) Normal step (6) End step...
  • Page 77: Block

    Block A block is a unit showing a series of operation consisting of steps and transitions. Block0 Block1 Block2 For the maximum number of blocks that can be created in an SFC program, refer to the following. Page 73 Specifications A block begins with an initial step, a step and a transition are connected alternately, and ends with an end step or jump sequence.
  • Page 78: Step

    Step A step is the basic unit for comprising a block. (1) Step name (2) Step No. (3) Attribute (4) Attribute target Step0 For the maximum number of steps that can be created per block, refer to the following. Page 73 Specifications Steps have the following characteristics.
  • Page 79 Step types The following table lists the types of steps. Item Description Initial step A step that indicates the beginning of a block. While this type of step is active, the transition following the step is constantly checked, and when the transition becomes Initial Action0 TRUE, the next step becomes active.
  • Page 80 Normal step (without attribute) A basic step used to configure a block. While this type of step is active, the transition condition following the step is constantly checked, and when the transition becomes TRUE, the next step becomes active. The output status of the action of a step at a transition to the next step varies depending on the instruction used. Item Description Example...
  • Page 81 Initial step The initial step represents the beginning of each block. Only one initial step can be described in one block. (Page 73 Specifications) Execute the initial steps in the same way as executing other steps. ■Active steps at block START When multi-initial steps are used, the active steps change depending on the starting method as described below.
  • Page 82 Reset step [R] Reset step [R] is a step that deactivates the specified step. • The reset step [R] deactivates the specified step in the current block before executing the output of every scan. Except for resetting the specified step, the reset step is the same as a normal step (without step attributes). •...
  • Page 83 Block start step (without END check) [BS] Block start step (without END check) [BS] is a step that activates the specified block. When the transition becomes TRUE, the active state transitions to the next step. After this step starts block (BL1), only the transition (2) is checked and, when the transition becomes TRUE, execution proceeds to the next step without waiting for the start destination block to end.
  • Page 84 • The following shows how to restart the block once ended. Item Description Block 0 "Start Conditions Setting" is set to "Auto-start The initial step is automatically activated again and processing is executed repeatedly. block 0" in the SFC Setting of parameters. "Start Conditions Setting"...
  • Page 85 Assigning the step relay (S) areas to steps The step relay is a device corresponding to each step in the SFC program. It is on when the relevant step is active (even in the stop or hold state) and is off when the relevant step is inactive. Step relays are assigned as follows.
  • Page 86: Action

    Action An action is a program which is executed while a step is active. SM400 bLabel2 Step1 Action0 wLabel3 wLabel4 Transition1 Step2 N M20 N bLabel5 (1) Action name (2) Qualifier (3) Detailed expression of the action (4) Action label/device *1 N indicates that the action is executed while a step is active.
  • Page 87 Create a contact to be input condition of each instruction in the ladder of detailed expression. ■Restrictions The following table lists the restrictions on individual programming languages used to create an action. Language Description Ladder diagram Detailed expression A pointer and an interrupt pointer cannot be input in the pointer input area. ■Functions/function blocks that cannot be used •...
  • Page 88: Transition

    Transition A transition is the basic unit for comprising a block and transfers the active state to the next step when the condition becomes TRUE. Transition1 bLabel1 bLabel2 TRAN Step1 bLabel1 Step2 M100 (1) Transition name (2) Transition No. (3) Detailed expression of transition (Page 92 Detailed expression of transitions) (4) Direct expression of transitions (Page 93 Direct expression of transitions) (5) Transition label/device (Page 93 Transition label/device) Detailed expression of a transition can be created in ladder diagrams, ST language, or FBD/LD language.
  • Page 89 Transition types The following table lists the types of transition. Item Description Series sequence When the transition becomes TRUE, the active state transitions from the preceding step to the subsequent step. Selective sequence Divergence: A step branches to multiple transitions, and only the step in the line (divergence/convergence) where the transition becomes TRUE first is activated.
  • Page 90 Series sequence When the transition becomes TRUE, the active state transitions from the preceding step to the subsequent step. When the transition (2) becomes TRUE while the step (1) is active, the step (1) is deactivated and the step (3) is activated. Selective sequence (divergence/convergence) A step branches to multiple transitions, and only the step in the line where the transition becomes TRUE first is activated.
  • Page 91 • In a selective transition, a convergence can be omitted by a jump transition or end transition. When transition (2) becomes TRUE during action of step (1), step (3) and step (4) are sequentially executed. When the transition (5) becomes TRUE, a jump sequence to step (1) occurs.
  • Page 92 • The simultaneous sequence allows transitions to up to 32 steps. • If another block is started by the simultaneous sequence, the START source block and START destination block will be executed simultaneously. • A simultaneous convergence is always performed after a simultaneous branch. ■Precautions •...
  • Page 93 Example of jump sequence that cannot be specified in the simultaneous branch ■Jump sequence to another branch within a ■Jump sequence for exiting from a simultaneous ■Jump sequence to a simultaneous branch from simultaneous branch branch outside a simultaneous branch (1) A simultaneous convergence cannot be performed.
  • Page 94 Detailed expression of transitions Create detailed expression of transitions in the Zoom editor. The condition can be created in following programming languages. Type Description Ladder Detailed expression Used to create a transition program consisting of a contact circuit and the TRAN instruction (Creating a dummy diagram transition condition) in a single circuit block.
  • Page 95 Direct expression of transitions The transition which transfers an active state to the next step can be created directly on the SFC diagram. A contact of FBD/ LD element is connected to it. bLabel1 bLabel2 Coil, function block, function, jump, jump label, and return elements cannot be used. Select a transition and select [Edit] ...
  • Page 96: Sfc Control Instructions

    SFC Control Instructions SFC control instructions are used to check a block or step operation status (active/inactive), or to execute a forced start, end or others. If SFC control instructions are used, SFC programs can be controlled from the actions of sequence programs and SFC programs.
  • Page 97 Index modification The SFC control instructions can specify index-modified step relays (S) and SFC block devices (BL). However, instructions that control a step individually cannot specify index-modified devices. Device Index modification target part SZ Step relay BL\SZ Step of step relay with block specification BLZ\S...
  • Page 98: Sfc Setting

    SFC Setting Set start conditions and others of SFC program in CPU parameter or SFC block setting. CPU parameter The following table lists the SFC settings. Type Item Description SFC setting SFC program setting Set whether to use the SFC program. SFC program start mode setting Set whether to start the SFC program in the initial status (Initial Start) or to start it holding the previous execution status (Resume Start).
  • Page 99 SFC Program Start Mode Setting Set whether to start the SFC program in the initial status (Initial Start) or to start it holding the previous execution status (Resume Start). [CPU Parameter]  [SFC Setting]  [SFC Program Start Mode Setting] Window Displayed items Setting...
  • Page 100 ■Precautions • When setting the parameter to "Resume Start," install a battery in the CPU module. If a battery trouble, such as no battery or battery voltage drop, has occurred, the SFC program may start in the Initial Start mode when it is started first time after the CPU module power is switched from off to on.
  • Page 101 For the continuous transition, refer to Page 107 Continuous transition ON/OFF operation. For the replacement of the SFC program from FX3 to FX5, refer to the following. Transition from MELSEC FX3G, FX3U, FX3UC Series to MELSEC iQ-F Series Handbook 8 SFC PROGRAM...
  • Page 102: Sfc Block Setting

    SFC block setting Act at block Multi-Activated Set this item to stop the operation of the CPU module when a start request for an already active block is issued in the block start step (with end check) [BC] or block start step (without end check) [BS]. For the setting range, set the range of the block to be stopped.
  • Page 103: Sfc Program Execution Order

    SFC Program Execution Order Whole program processing Execution type that can be specified This section shows whether the execution type of SFC program can be specified. CPU module Type that can be specified as an SFC program Initial execution type program Execute only when required.
  • Page 104: Sfc Program Processing Sequence

    SFC program processing sequence Block execution sequence While the SFC program is running, the actions of each step are executed sequentially starting from the initial step of an active block. An SFC program containing multiple blocks checks the state (active/inactive) of the blocks in ascending order of block numbers (block 0 →...
  • Page 105 Step execution sequence In the SFC program, the actions of all active steps are processed within one scan. (1) All the active steps in the block are executed within a single scan. When the action of each step is finished, whether the transition to the next step becomes TRUE or not is checked. •...
  • Page 106 ■Transition operation The transition operation with/without continuous transition in the following SFC program is shown below. (Page 107 Continuous transition ON/OFF operation) Steps (1) to (4) are activated, and the actions (A) to (D) are executed. Although the transition (a) to (c) for Steps (1) to (3) become TRUE, the transition (d) for Step (4) becomes FALSE.
  • Page 107 • With continuous transition Scan 1 (1) Active (A) Execution in the contact ON status (A) Execution in the contact OFF status (a) TRUE (2) Active (B) Execution in the contact ON status (B) Execution in the contact OFF status (b) TRUE (3) Active (C) Execution in the...
  • Page 108 ■Precautions • If the transition for a step becomes TRUE at the first execution, the step starts/ends after one scan. When the step ends after one scan, the following operation is performed according to the transition condition. No continuous transition Continuous transition With continuous transition (operation compatible with FX3)
  • Page 109 Continuous transition ON/OFF operation The transition conditions for the SFC program include "With continuous transition," "With continuous transition (operation compatible with FX3)" and "Without continuous transition." The setting "With continuous transition" or "Without continuous transition" is determined by "FX3 Compatible Transition Operation Mode Setting"...
  • Page 110: Sfc Program Execution

    SFC Program Execution Starting and stopping the SFC program The SFC program can be started and stopped by either of the following methods. • Auto-start by the CPU parameter • Starting and stopping the program by the special relay (SM321) Auto-start by the CPU parameter Set "Start Conditions Setting"...
  • Page 111: Activating And Deactivating A Step

    Ending a block A block in the SFC program can be ended by either of the following methods. Item Method Remarks Reference End by the end step Execute the end step in a block. Processing is This method is effective to stop operation Page 81 End step stopped and the block becomes inactive.
  • Page 112: Behavior When An Active Step Is Activated

    Behavior when an active step is activated When an active step is activated, the step behaves as follows. Series sequence When the transition (2) becomes TRUE, the step (1) becomes inactive. The step (3) of the transition which is supposed to be multi- activated is activated.
  • Page 113: Operation When A Program Is Modified

    Operation when a program is modified To change an SFC program, use the following function. • Write to the programmable controller The following table shows the SFC program data that can be changed by the above method. Change type Write to the programmable controller STOP/PAUSE ...
  • Page 114: Checking Sfc Program Operation

    Checking SFC program operation The functions of the engineering tool that can be used to check the SFC program operation are shown below. • Monitor • Watch • Device/buffer memory batch monitor • Control SFC steps • SFC block list •...
  • Page 115: Appendix

    APPENDIX Appendix 1 Operations of when the MC/MCR instructions are used to control EN The following table lists operations of instructions, devices, and labels used in a function block when "Use MC/MCR to Control EN" is enabled in the inherent property setting of the function block. Instruction/device/label used in a function Operation of Instruction/device/label used in a function block block...
  • Page 116 Instructions executed at the rising/falling edge The following describes operations of instructions executed at the rising/falling edge. A subroutine-type FB using an instruction executed at the rising edge MOVP ■When "Yes" is selected for "Use MC/MCR to Control EN" When EN is turned on, the instruction is executed if the condition contact is TRUE ((1) in the following figure). ...
  • Page 117 Timer (low-speed timer/timer/high-speed timer) The following describes operations of the timer (low-speed timer/timer/high-speed timer). A subroutine-type FB using a low-speed timer SM400 ■When "Yes" is selected for "Use MC/MCR to Control EN" The count value becomes 0 ((1) in the following figure). The coil turns off ((2) in the following figure). ...
  • Page 118 Retentive timer (low-speed timer/timer/high-speed timer), counter, and long counter The following describes operations of the retentive timer (low-speed timer/timer/high-speed timer), counter, and long counter. A subroutine-type FB using a low-speed retentive timer SM400 ■When "Yes" is selected for "Use MC/MCR to Control EN" The current count value remain unchanged.
  • Page 119 Devices specified as the device part of the OUT instruction The following describes operations of devices specified as the device part of the OUT instruction. A subroutine-type FB using M0 for the device part of the OUT instruction. SM400 ■When "Yes" is selected for "Use MC/MCR to Control EN" M0 is forcibly turned off ((1) in the following figure).
  • Page 120: Appendix 2 Added And Changed Functions

    Appendix 2 Added and Changed Functions The functions added or changed with the CPU module and engineering tool, and the supported CPU modules' firmware version and engineering tool software version are given below. Firmware version can be checked through the module diagnostics (CPU diagnostics).
  • Page 121: Index

    INDEX Symbols ........50 ....... .25 FB file .
  • Page 122 ....... . . 50 ....... . .50 .
  • Page 123 MEMO...
  • Page 124: Revisions

    RELEVANT MANUALS, Chapter 1, Section 5.2, 6.1, 7.1, Chapter 8, Appendix 2 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 rights which may occur as a result of using the contents noted in this manual.
  • Page 125: Warranty

    WARRANTY Please confirm the following product warranty details before using this product. Gratis Warranty Term and Gratis Warranty 2. Onerous repair term after discontinuation of production Range If any faults or defects (hereinafter "Failure") found to Mitsubishi shall accept onerous product repairs for be the responsibility of Mitsubishi occurs during use of seven (7) years after production of the product is the product within the gratis warranty term, the...
  • Page 126: Trademarks

    TRADEMARKS Anywire and AnyWireASLINK are either registered trademarks or trademarks of Anywire Corporation. The company names, system names and product names mentioned in this manual are either registered trademarks or trademarks of their respective companies.   In some cases, trademark symbols such as ' ' or ' ' are not specified in this manual.
  • Page 128 Manual number: JY997D55701J Model: FX5-P-PS-E Model code: 09R538 When exported from Japan, this manual does not require application to the Ministry of Economy, Trade and Industry for service transaction permission. HEAD OFFICE: TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN Specifications are subject to change without notice.

This manual is also suitable for:

Melsec iq-f fx5

Table of Contents