Mitsubishi Q series Programming Manual

Mitsubishi Q series Programming Manual

Hide thumbs Also See for Q series:
Table of Contents

Advertisement

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi Q series

  • Page 3 • SAFETY CAUTIONS • (You must read these cautions before using the product.) When using the Mitsubishi Programmable Controller MELSEC-Q Series, thoroughly read the manual associated with the product and the related manuals introduced in the associated manual. Also pay due attention to safety and handle the module properly.
  • Page 4: Revisions

    REVISIONS * The manual number is given on the bottom left of the back cover. Print Date Manual Number Revision Feb., 2000 SH (NA) 080076-A First edition May, 2001 SH (NA) 080076-B Partial correction Chapter 1, Section 3.1, Section 5.1.1, Section 5.2.4, Appendix 1.2 deletion Appendix 2 Apr., 2002...
  • Page 5 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 6: Table Of Contents

    Before using the product, please read this manual carefully to develop full familiarity with the functions and performance of the Programmable Controller Q Series you have purchased, so as to ensure correct use. Please be sure to deliver this manual to the final user.
  • Page 7 4.2.10 End step............................4-19 4.2.11 Instructions that cannot be used with operation outputs ............... 4-21 4.3 Transition..............................4-22 4.3.1 Serial transition..........................4-23 4.3.2 Selection transition ..........................4-25 4.3.3 Parallel transition..........................4-28 4.3.4 Jump transition ..........................4-32 4.3.5 Precautions for creating operation output (step)/transition condition programs ......4-33 4.4 Controlling SFC Programs by Instructions (SFC Control Instructions) ..........
  • Page 8 5.3.1 SFC program execution ........................5- 8 5.3.2 Block execution sequence ........................ 5-10 5.3.3 Step execution sequence........................5-11 5.3.4 Continuous transition ON/OFF operation..................5-12 6. SFC PROGRAM EXECUTION 6- 1 to 6-17 6.1 SFC Program START And STOP ......................6- 1 6.1.1 SFC program resumptive START procedure...................
  • Page 9: About Manuals

    ABOUT MANUALS The manuals related to the Q/QnACPU are listed in the table below. Please order those you require. Related Manuals Manual Number Manual Name (Model Code) GX Developer Version 8 Operating Manual (SFC) Describes how to create SFC SH-080374E programs using the software package for creating SFC programs.
  • Page 10 1 GENERAL DESCRIPTION MELSEC-Q 1. GENERAL DESCRIPTION SFC, an abbreviation for "Sequential Function Chart", is a control specification description format in which a sequence of control operations is split into a series of steps to enable a clear expression of the program execution sequence and execution conditions. This manual describes the specifications, functions, instructions, programming procedures, etc.
  • Page 11 1 GENERAL DESCRIPTION MELSEC-Q (1) When created with MELSAP-L and ladders (a) MELSAP-L side (b) Sequence programs side The flow of operation is easy to understand by The area can be developed into a product by creating the SFC program related to the interlock creating interlock conditions irrelevant to the flow of conditions.
  • Page 12: Sfc Program

    1 GENERAL DESCRIPTION MELSEC-Q 1.1 SFC Program 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 by using a ladder circuit. Grouping steps into one block in process units allows to create an SFC program that is capable of tracking all the processes as well as structuring the operation flow in each process.
  • Page 13: Sfc (Melsap-L) Features

    1 GENERAL DESCRIPTION MELSEC-Q 1.2 SFC (MELSAP-L) Features (1) Easy to design and maintain systems It is possible to correspond the controls of the entire facility, mechanical devices of each station, and all machines to the blocks and steps of the SFC program on a one-to-one basis. Because of this capability, systems can be designed and maintained with ease even by those with relatively little knowledge of sequence programs.
  • Page 14 1 GENERAL DESCRIPTION MELSEC-Q (2) Program development efficiency is enhanced by dividing control into parts The machine control process can be divided into parts by describing the operation sequence and machine control separately. The MELSAP-L is used to describe the operation sequence for the machine, and a sequence program (circuit/list) is used to describe the machine control including individual interlock.
  • Page 15 1 GENERAL DESCRIPTION MELSEC-Q (3) Ease of division editing of blocks and steps according to control object • A total of 320 blocks 1 can be created in a whole SFC program. • Up to 512 steps 2 can be created in a single block. •...
  • Page 16 1 GENERAL DESCRIPTION MELSEC-Q (4) Creation of multiple initial steps is possible Multiple processes can easily be executed and combined. Initial steps are linked using a “selection coupling” format. When multiple initial steps (S0 to S3) are active, the step where the transition condition (t4 to t7) immediately prior to the selected coupling is satisfied becomes inactive, and a transition to the next step occurs.
  • Page 17 1 GENERAL DESCRIPTION MELSEC-Q (5) Program design is easy due to a wealth of step attributes A variety of step attributes can be assigned to each step. Used singly for a given control operation, or in combination, these attributes greatly simplify program design procedures. •...
  • Page 18 1 GENERAL DESCRIPTION MELSEC-Q • Reset step (Sn • When a HOLD status becomes unnecessary for machine control, or on selective branching to a manual ladder occurs after an error detection, etc., a reset request can be designated for the HOLD step, deactivating the step in question.
  • Page 19 1 GENERAL DESCRIPTION MELSEC-Q (6) A given function can be controlled in a variety of ways according to the application in question Block functions such as START, END, temporary stop, restart, and forced activation and ending of specified steps can be controlled by SFC diagram symbols, SFC control instructions, or by SFC information registers.
  • Page 20 2 SYSTEM CONFIGURATION MELSEC-Q 2. SYSTEM CONFIGURATION (1) Applicable CPUs MELSAP-L (SFC program) runs on the following CPU modules. CPU Type Model Name Restriction Product whose first five digits of serial No. Basic model QCPU Q00JCPU, Q00CPU, Q01CPU are 04122 or later is compatible.
  • Page 21 2 SYSTEM CONFIGURATION MELSEC-Q MEMO 2 - 2 2 - 2...
  • Page 22: Performance Specifications Related To Sfc Programs

    3 SPECIFICATIONS MELSEC-Q 3. SPECIFICATIONS This chapter explains the performance specifications of SFC programs. 3.1 Performance Specifications Related to SFC Programs 3.1.1 Performance specifications of Basic model QCPU (1) Table 3.1 indicates the performance specifications related to an SFC program. Table 3.1 Performance Specifications Related to SFC Program Item Q00JCPU...
  • Page 23 3 SPECIFICATIONS MELSEC-Q (2) Precautions for creating SFC program (a) Only one SFC program can be created. The created SFC program is a "scan execution type program". (b) The Basic model QCPU allows creation of a total of two program files: one SFC program and one sequence program.
  • Page 24: Performance Specifications Of High Performance Model Qcpu, Process Cpu Redundant Cpu And Universal Model Qcpu

    3 SPECIFICATIONS MELSEC-Q 3.1.2 Performance specifications of High Performance model QCPU, Process CPU, Redundant CPU and Universal model QCPU (1) Table 3.2 indicates the performance specifications related to SFC programs. Table 3.2 Performance Specifications Related to SFC Programs Q02CPU Q06HCPU Q12HCPU Q25HCPU Q02HCPU...
  • Page 25 3 SPECIFICATIONS MELSEC-Q 1: Refer to Section 5.2.3 for the program execution management SFC program. 2: The maximum number of sequence steps per block depends on an instruction used for operation output or a note editing setting. The number of steps (2k steps) indicated in the table applies when "Unite (United Note)"...
  • Page 26 3 SPECIFICATIONS MELSEC-Q (2) Precautions for creating SFC program (a) The SFC programs that can be created are "scan execution type program" and "stand- by type program". (b) Two SFC programs (one normal SFC program and one program execution management SFC program) can be set as a scan execution type program. (c) More than one SFC program can be set as a stand-by type program.
  • Page 27 3 SPECIFICATIONS MELSEC-Q REMARKS Use the PSCAN or POFF instruction to switch the execution type of the program. For details of the PSCAN and POFF instructions, refer to the QCPU (Q mode)/QnACPU Programming Manual (Common Instructions) 3 - 6 3 - 6...
  • Page 28: Device List

    3 SPECIFICATIONS MELSEC-Q 3.2 Device List 3.2.1 Device list of Basic model QCPU Table 3.3 indicates the devices that can be used for the transition conditions and operation outputs of an SFC program. Table 3.3 Device List User Classification Device Type Expression Remarks...
  • Page 29 3 SPECIFICATIONS MELSEC-Q User Classification Device Type Expression Remarks Assignment Link input \ X0 to J \ X01FFF Hexadecimal • Devices on the left Link output \ Y0 to J \ Y01FFF Hexadecimal exist in each link Link relay \ B0 to J \ B03FFF Hexadecimal Link direct...
  • Page 30: Device List Of High Performance Model Qcpu, Process Cpu, Redundant Cpu And Universal Model Qcpu

    3 SPECIFICATIONS MELSEC-Q 3.2.2 Device list of High Performance model QCPU, Process CPU, Redundant CPU and Universal model QCPU Table 3.4 indicates the devices that can be used for the transition conditions and operation outputs of SFC programs. Table 3.4 Device List User Classification Device...
  • Page 31 3 SPECIFICATIONS MELSEC-Q User Classification Device Type Expression Remarks Assignment Link input \ X0 to J \ X01FFF Hexadecimal Link output \ Y0 to J \ Y01FFF Hexadecimal \ B0 to J \ B03FFF • Devices on the left Link relay \ B0 to Hexadecimal exist in each link...
  • Page 32 3 SPECIFICATIONS MELSEC-Q User Classification Device Type Expression Remarks Assignment Decimal constant K-2147483648 to K2147483647 Hexadecimal H0 to H0FFFFFFFF constant Single-precision floating-point data: E 1.17550-38 to E 3.40282+38 Constant Real number Double-precision floating-point data *7: constant E 2.2250738585072014-308 to E 1.7976931348623157+308 Character string "ABC123", etc.
  • Page 33: Processing Time

    3 SPECIFICATIONS MELSEC-Q 3.3 Processing Time 3.3.1 Processing time for SFC program The time required to process the SFC program is discussed below. (1) Method for calculating the SFC program processing time Calculate the SFC program processing time with the following expression SFC program processing time (A) + (B) + (C) (a) "(A): Processing time of operation outputs in all blocks"...
  • Page 34 3 SPECIFICATIONS MELSEC-Q (2) System processing times for different CPU module models (a) When Basic model QCPU is used Item Q00JCPU Q00CPU Q01CPU Active block processing time coefficient 41.9µs 35.5µs 27.3µs Inactive block processing time coefficient 10.5µs 8.8µs 6.8µs Nonexistent block processing time coefficient 1.1µs 0.9µs 0.7µs...
  • Page 35 3 SPECIFICATIONS MELSEC-Q [SFC system processing time calculation example] Using the Q25HCPU as an example, the processing time for the SFC system is calculated as shown below, given the following conditions. • Designated at initial START • Number of active blocks: 30 (active blocks at SFC program) •...
  • Page 36 3 SPECIFICATIONS MELSEC-Q The following table indicates the number of active steps, number of active transitions, and number of transition condition-satisfied steps when Step 2 and Step 6 are active. Number of Whether Transition Presence/Absence Number of Active Number of Active Transition Conditions Are of Continuous...
  • Page 37: Processing Time For S(P).Sfcscomr Instruction And S(P).Sfctcomr Instruction

    3 SPECIFICATIONS MELSEC-Q 3.3.2 Processing time for S(P).SFCSCOMR instruction and S(P).SFCTCOMR instruction Processing time for S(P).SFCSCOMR instruction and S(P).SFCTCOMR instruction is shown below. [Condition] • The number of comments to be stored in the comment file: 1000 • Sequence steps in the SFC step in the SFC program: 1000 sequence steps •...
  • Page 38: Calculating The Sfc Program Capacity

    3 SPECIFICATIONS MELSEC-Q 3.4 Calculating the SFC Program Capacity In order to express the SFC diagram using instructions, the memory capacity shown below is required. The method for calculating the SFC program capacity and the number of steps when the SFC diagram is expressed by SFC dedicated instructions is described in this section.
  • Page 39 3 SPECIFICATIONS MELSEC-Q (2) Number of steps required for expressing the SFC diagram as SFC dedicated instructions The following table shows the number of steps required for expressing the SFC diagram as SFC dedicated instructions. Ladder Number of Name Description Required Number of Steps Expression Steps...
  • Page 40 4 SFC PROGRAM CONFIGURATION MELSEC-Q 4. SFC PROGRAM CONFIGURATION This chapter explains the SFC program symbols, SFC control instructions and SFC information devices that comprise an SFC program. (1) As shown below, an SFC program consists of an initial step, transition conditions, intermediate steps, and an END step.
  • Page 41: List Of Sfc Diagram Symbols

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.1 List of SFC Diagram Symbols The symbols used in the SFC program are listed below. SFC Diagram Class Name Remarks Symbol Initial step Dummy initial step Any of these steps in 1 block Coil HOLD initial step When step No.
  • Page 42 4 SFC PROGRAM CONFIGURATION MELSEC-Q Class Name SFC Diagram Symbol Remarks Serial transition Selection branching Selection coupling Selection coupling - parallel branching Parallel branching Parallel coupling Parallel coupling - parallel branching a, b = Transition condition No. Transition Parallel coupling - selection branching Selection branching - parallel branching Parallel coupling - selection coupling Selection branching - parallel branching...
  • Page 43: Steps

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.2 Steps Steps are the basic units for comprising a block, and each step consists of operation outputs. (1) The following table indicates the number of steps that can be used in one block. Maximum Number of Steps in Maximum Number of Steps in CPU Module Type One Block...
  • Page 44 4 SFC PROGRAM CONFIGURATION MELSEC-Q (b) When the SET, basic or application instruction is used If a transition to the next step occurs and the corresponding step becomes inactive, the device remains ON or the data stored in the device is held. To turn OFF the ON device or clear the data stored in the device, use the RST instruction, etc.
  • Page 45 4 SFC PROGRAM CONFIGURATION MELSEC-Q 3) When counter is reset When a transition to the next step occurs before the reset instruction of the counter is executed, the present value of the counter and the ON status of the contact, which is ON, are held if the corresponding step becomes inactive.
  • Page 46: Initial Step

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.2.2 Initial step The initial step represents the beginning of a block. Up to 32 initial steps per block can be designated. When there are more than one initial step, the coupling enabled is only a selective coupling. Execute the initial steps in the same way as executing the steps other than the initial step.
  • Page 47: Dummy Step

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.2.3 Dummy step A dummy step is a waiting step, etc., which contains no operation output program. (1) The transition condition following the corresponding step is always checked during execution of a dummy step, and execution proceeds to the next step when the transition condition is satisfied.
  • Page 48 4 SFC PROGRAM CONFIGURATION MELSEC-Q (3) When a coil ON status (at coil HOLD step) has been maintained to the next step, the coil will be switched OFF at any of the following times: (a) When the end step of the corresponding block is executed. (Except when SM327 is ON) (b) When an SFC control instruction (rBLm) designates a forced END at the block in question.
  • Page 49 4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.2.5 Operation HOLD step (without transition check) An operation HOLD step (without transition check) is a step where the operation output processing of the corresponding step continues after a transition to the next step. However, transition processing to the next step is not executed if the transition condition is satisfied again at the corresponding step.
  • Page 50 4 SFC PROGRAM CONFIGURATION MELSEC-Q (4) Block STOP processing The following processing is performed when a block STOP request is issued to the corresponding block using the STOP/RESTART bit of the SFC information devices or the block STOP instruction of the SFC control instructions. •...
  • Page 51: Operation Hold Step (With Transition Check) St

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.2.6 Operation HOLD step (with transition check) An operation HOLD step (with transition check) is a step where the operation output processing of the corresponding step continues after a transition to the next step. When the transition condition is satisfied again at the corresponding step, transition processing to the next step (reactivation) is executed.
  • Page 52 4 SFC PROGRAM CONFIGURATION MELSEC-Q (3) An operation HOLD step (with transition check) becomes inactive when any of the following occur: (a) When the end step of the corresponding block is executed. (Except when SM327 is ON) (b) When an SFC control instruction (rBLm) designates a forced END at the block in question. (c) When an SFC control instruction (rBLm\Sn, rSn) designates a reset at the block in question.
  • Page 53 4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.2.7 Reset step A reset step is a step which designates a forced deactivation of another specified step (operation output). The reset step deactivates the designated step in the current block before execution of the operation output every scan.
  • Page 54: Block Start Step (With End Check)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.2.8 Block START step (with END check) A block START step (with END check) is the step where the specified block is started, and when the START destination block is then deactivated, the check of the transition condition to the next step is started.
  • Page 55 4 SFC PROGRAM CONFIGURATION MELSEC-Q (4) The following table indicates the number of steps that can be executed simultaneously in all blocks and the maximum number of active steps in a single block. Number of Steps That Can Be Maximum Number of Active CPU Module Model name Executed Simultaneously in All Blocks Steps in Single Block...
  • Page 56: Block Start Step (Without End Check)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.2.9 Block START step (without END check) A block START step (without END check) is the step where the specified block is started, and if the START destination block is active, the check of the transition condition to the next step is performed.
  • Page 57 4 SFC PROGRAM CONFIGURATION MELSEC-Q POINTS The execution status of each block can be checked at another block using the block START/END bit (refer to Section 4.5.1) or the block activation check instruction (refer to Section 4.4.3) of the SFC control instructions. 4 - 18 4 - 18...
  • Page 58: End Step

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.2.10 End step An end step indicates that a series of processings in the corresponding block is all ended. (1) When the end step is reached, the following processing is performed to end the block. (a) All steps in the block are deactivated.
  • Page 59 4 SFC PROGRAM CONFIGURATION MELSEC-Q POINTS The following gives the precautions to be taken when SM328 is turned ON (1) When there is only the held step left at arrival at the end step, that held step is deactivated if SM328 is ON. When the user does not want to turn OFF the coil output of the held step suddenly, it can be prevented by turning ON SM327.
  • Page 60: Instructions That Cannot Be Used With Operation Outputs

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.2.11 Instructions that cannot be used with operation outputs Table 4.1 indicates the instructions that cannot be used with operation outputs. Table 4.1 Unusable Instruction List Class Instruction Symbol Symbol Function Remarks MC N No.1_D Master control set Master control MCR N...
  • Page 61: Transition

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.3 Transition A transition is the basic unit for comprising a block, and is used by specifying a transition condition. A transition condition is a condition for execution to proceed to the next step, and execution proceeds to the next step when the condition is satisfied.
  • Page 62: Serial Transition

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.3.1 Serial transition “Serial transition” is the transition format in which processing proceeds to the step immediately below the current step when the transition condition is satisfied. • When transition condition “b” becomes satisfied at step “n” Step “n”...
  • Page 63 4 SFC PROGRAM CONFIGURATION MELSEC-Q (2) Serial transition operation flowchart Operation status Initial step Transition condition “a” Initial step operation output executed. Step 1 Transition condition “b” Transition condition “a” satisfied? Step 2 Transition condition “c” Initial step operation output deactivated.
  • Page 64: Selection Transition

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.3.2 Selection transition A “selection transition” is the transition format in which several steps are coupled in a parallel manner, with processing occurring only at the step where the transition condition is satisfied first. • From step “n”, processing will proceed to either Step “n”...
  • Page 65 4 SFC PROGRAM CONFIGURATION MELSEC-Q (3) In a selection transition, a coupling can be omitted by a jump transition or end transition. When transition condition “b” is satisfied at the step “n” operation output, processing will Step n proceed in order through steps “n+1”, “n+2” and “n+3”.
  • Page 66 4 SFC PROGRAM CONFIGURATION MELSEC-Q (4) Selection transition operation flowchart Operation status Initial step Transition condition “a” Operation output of initial step 0 is executed. Step 1 Transition Transition Transition Is transition condition condition “e” condition “h” condition “b” a satisfied? Step 2 Step 4 Step 6...
  • Page 67: Parallel Transition

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.3.3 Parallel transition “Parallel transition” is the transition format in which several steps linked in parallel are processed simultaneously when the relevant transition condition is satisfied. Step “n” (operation output [A]) • From step “n”, processing will proceed Transition condition “b”...
  • Page 68 4 SFC PROGRAM CONFIGURATION MELSEC-Q (2) If another block is started by the parallel processing operation, the START source block and START destination block will be executed simultaneously. (In the example below, processing from step “n+1” will be executed simultaneously with block 1.) Block 0 Step “n”...
  • Page 69 4 SFC PROGRAM CONFIGURATION MELSEC-Q (4) Couplings must be provided when the parallel transition format is used. Program creation is impossible without couplings. Example: Program without couplings (Cannot be designated) Jump END step END step Each column ends Jump transition (see Section 4.3.4) at the END step.
  • Page 70 4 SFC PROGRAM CONFIGURATION MELSEC-Q (6) Parallel transition operation flowchart Operation status Initial step Transition condition “a” Initial step operation output Step 1 executed. Transition condition “b” Transition condition “a” satisfied? Step 2 Step 3 Step 4 Transition Transition Transition condition “c”...
  • Page 71: Jump Transition

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.3.4 Jump transition A “jump transition” is a jump to a specified step within the same block which occurs when the transition condition is satisfied. • When condition “b” is satisfied at step “n” execution, step “n” (operation output [A]) is Step “n”...
  • Page 72: Precautions For Creating Operation Output (Step)/Transition Condition Programs

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.3.5 Precautions for creating operation output (step)/transition condition programs This section explains the precautions for creating operation output (step) and transition condition programs. (1) Step program (a) Step program expression method Since a step program cannot use contacts and instructions equivalent to contacts, the operation output of an active step is executed when the transition condition is satisfied.
  • Page 73 4 SFC PROGRAM CONFIGURATION MELSEC-Q (2) MELSAP-L program description The MELSAP-L describes step programs in the following format: Example of MELSAP-L Instruction Example of list format Example of circuit symbol format Output (o) oY70 OUT Y70 H K100 High speed timer (h) hT0 K100 OUTH T0 K100 Set (s)
  • Page 74 4 SFC PROGRAM CONFIGURATION MELSEC-Q (4) Transition condition program (a) Transition condition program expression Transition condition programs can be used only for contact or contact-equivalent instructions. The transition condition program is expressed as the following ladder circuit: Condition [TRAN] is a dummy output TRAN Condition (b) Instructions used...
  • Page 75 4 SFC PROGRAM CONFIGURATION MELSEC-Q CPU Module Type High Performance Instruction Class Instruction expression Function Basic model Model QCPU, Universal Code QCPU Process CPU, model QCPU Redundant S1 S2 & S1 S2 BIN16 bit data comparison S1 S2 (=, <>, >, >=, <, <=) S1 S2 &...
  • Page 76: Controlling Sfc Programs By Instructions (Sfc Control Instructions)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.4 Controlling SFC Programs by Instructions (SFC Control Instructions) SFC control instructions can be used to check a block or step operation status (active/inactive), or to execute a forced START or END, etc. Using the SFC control instructions with an SFC program created with SFC program symbols, the SFC program can be usually controlled easily.
  • Page 77 4 SFC PROGRAM CONFIGURATION MELSEC-Q 1: In a sequence program, block 0 is the instruction execution target block. In an SFC program, the current block is the instruction execution target block. The instruction execution target block can be changed with the block switching instruction (BRSET).
  • Page 78 4 SFC PROGRAM CONFIGURATION MELSEC-Q POINT Beginning from Section 4.4.1 of this manual, the following table is used in the explanations of the various instructions. The table contents are explained below. Usable Devices Programs Using Instructions Execution Site Internal Device Link Direct Intelligent Data...
  • Page 79 4 SFC PROGRAM CONFIGURATION MELSEC-Q Internal Link Direct Intelligent File Device Index Expansion (System, User) Function Register Constant Other Class Module Word Word U \G FX, FY, A, VD, R, ZR BLm\Sn Decimal P, I, S, SM, SD, T, C, BLm\Trm hexadecimal J, U,...
  • Page 80: Step Operation Status Check Instructions (A, B, &A, &B, La, Lb)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU PLC CPU Process Redundant Applicable Basic Universal High Performance : First five digits of serial No. are 04122 or later. 4.4.1 Step operation status check instructions (a, b, &a, &b, la, lb) Usable Devices Programs Using Instructions Execution Site Internal Device...
  • Page 81 4 SFC PROGRAM CONFIGURATION MELSEC-Q (3) Specify the step as described below. (a) In the case of SFC program 1) Use "Sn" when specifying the step in the current block. 2) Use "BLm\Sn" when specifying the step in another block in the SFC program. (b) In the case of sequence program 1) Use "BLm\Sn"...
  • Page 82 4 SFC PROGRAM CONFIGURATION MELSEC-Q (2) The following program executes a step synchronously with another step of a parallel branch. aS20 & bX0 Related Instructions 1) SFC control instructions • Block switching instruction (BRSET) ......See Section 4.4.11. • Step control instruction (SCHG) ........See Section 4.4.10. •...
  • Page 83: Forced Transition Check Instruction (A, B, &A, &B, La, Lb)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU Applicable PLC CPU Process Redundant Basic Universal High Performance 4.4.2 Forced transition check instruction (a, b, &a, &b, la, lb) Usable Devices Programs Using Instructions Execution Site Internal Device Link Direct Intelligent Data File Expansion SFC Program (System, User)
  • Page 84 4 SFC PROGRAM CONFIGURATION MELSEC-Q (3) Specify the transition as described below. (a) In the case of SFC program 1) Use "Sn" when specifying the step in the current block. 2) Use "BLm\Sn" when specifying the step in another block in the SFC program. (b) In the case of sequence program 1) Use "BLm\Sn"...
  • Page 85: Block Operation Status Check Instruction (A, B, &A, &B, La, Lb)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU PLC CPU Process Redundant Applicable Basic Universal High Performance : First five digits of serial No. are 04122 or later. 4.4.3 Block operation status check instruction (a, b, &a, &b, la, lb) Usable Devices Programs Using Instructions Execution Site Internal Device...
  • Page 86 4 SFC PROGRAM CONFIGURATION MELSEC-Q [Program Examples] (1) The following program turns ON Y20 when block 3 is active. aBL3 oY20 Related Instructions a) SFC control instructions • Block START instruction (sBLm) and block END instruction (rBLm) ........See Section 4.4.6 b) SFC diagram symbols •...
  • Page 87: Active Step Batch Readout Instructions (Mov, Dmov)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU PLC CPU Process Redundant Applicable Basic Universal High Performance : First five digits of serial No. are 04122 or later. 4.4.4 Active step batch readout instructions (MOV, DMOV) Usable Devices Programs Using Instructions Execution Site Internal Device Link Direct Intelligent...
  • Page 88 4 SFC PROGRAM CONFIGURATION MELSEC-Q (4) When the block is not specified, specify the step number with which the read data range does not exceed the maximum step No. in the block. (a) If the maximum number of steps is exceeded, data will be undefined. For example, when the last step of the block to be read is step 10 (S10), data in b11 to 15 will be undefined.
  • Page 89 4 SFC PROGRAM CONFIGURATION MELSEC-Q [Program Examples] (1) The following program reads 32 active steps, starting from step 0 of block 3, to D0 and D1 when X0 turns ON. When step is designated by operation output of block 3 DMOVP K8S0 D0 When step is designated by operation output of other than block 3 DMOVP BL3\K8S0 D0...
  • Page 90: Active Step Batch Readout (Bmov)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU PLC CPU Process Redundant Applicable Basic Universal High Performance : First five digits of serial No. are 04122 or later. 4.4.5 Active step batch readout (BMOV) Usable Devices Programs Using Instructions Execution Site Internal Device Link Direct Intelligent Data...
  • Page 91 4 SFC PROGRAM CONFIGURATION MELSEC-Q (4) If the read data range exceeds the maximum step No. in the block, the data of the next block No. are read. When there are no blocks in and after the block to be read, "0" is stored into the remaining bits. Example: When "BMOV BL1\S2 D0 K2"...
  • Page 92 4 SFC PROGRAM CONFIGURATION MELSEC-Q [Program Examples] (1) The following program reads the active step status of 48 steps (3 words), starting from step 0 of block 3, to D0 - D2 when X0 turns ON. When step is designated by operation output of block 3 BMOVP K4S0 D0 K3 When step is designated by operation output of other than block 3 BMOVP BL3\S0 D0 K3...
  • Page 93: Block Start & End Instructions (S, R)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU PLC CPU Process Redundant Applicable Basic Universal High Performance : First five digits of serial No. are 04122 or later. 4.4.6 Block START & END instructions (s, r) Usable Devices Programs Using Instructions Execution Site Internal Device Link Direct Intelligent...
  • Page 94: Block Stop And Restart Instructions (Pause, Rstart)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU PLC CPU Process Redundant Applicable Basic Universal High Performance : First five digits of serial No. are 04122 or later. 4.4.7 Block STOP and RESTART instructions (PAUSE, RSTART) Usable Devices Programs Using Instructions Execution Site Internal Device Link Direct Intelligent...
  • Page 95 4 SFC PROGRAM CONFIGURATION MELSEC-Q POINTS The operation of SM325 differs depending on the CPU module. • For the Basic model QCPU, High Performance model QCPU, Process CPU, and QnACPU The SM325 turns ON/OFF at STOP RUN of the CPU module according to the output mode setting at block stop of parameters.
  • Page 96 4 SFC PROGRAM CONFIGURATION MELSEC-Q Related Instructions 1) SFC information device • Block STOP/RESTART bit ..........See Section 4.5.3. 4 - 57 4 - 57...
  • Page 97: Step Start And End Instructions (S, R)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU PLC CPU Process Redundant Applicable Basic Universal High Performance : First five digits of serial No. are 04122 or later. 4.4.8 Step START and END instructions (s, r) Usable Devices Programs Using Instructions Execution Site Internal Device Link Direct Intelligent...
  • Page 98 4 SFC PROGRAM CONFIGURATION MELSEC-Q 2) When the specified block is active: If the step is already active when the SET instruction is executed, the step will remain active and processing will continue, with another step being designated as active. (Multiple step activation, follow-up function.) Processing is performed as shown below when step 1 in block 1 is started in the sequence program.
  • Page 99 4 SFC PROGRAM CONFIGURATION MELSEC-Q (2) Step END instruction (r) (a) A specified step at a specified block is forcibly deactivated. “Coil HOLD” and “operation HOLD” steps are subject to this instruction. (b) When the number of active steps in the corresponding block reaches 0 due to the execution of this instruction, END step processing is performed and the block becomes inactive.
  • Page 100 4 SFC PROGRAM CONFIGURATION MELSEC-Q [Program Examples] (1) When X1 switches ON, the following program will select and start step 2 of block 1 which contains multiple initial steps. (Block 1) When step is designated by operation output of block 1 When step is designated by operation output of other than block 3 sBL1\S2...
  • Page 101: Forced Transition Execute & Cancel Instructions (S, R)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU Applicable PLC CPU Process Redundant Basic Universal High Performance 4.4.9 Forced transition EXECUTE & CANCEL instructions (s, r) Usable Devices Programs Using Instructions Execution Site Internal Device Link Direct Intelligent Data File Expansion SFC Program (System, User) Function Index...
  • Page 102 4 SFC PROGRAM CONFIGURATION MELSEC-Q [Operation Error] • When the specified transition condition does not exist or the SFC program is in a wait state ........................... Error No. 4631 [Program Examples] (1) When X1 switches ON, the following program executes a forced transition at transition condition 1 of block 1.
  • Page 103: Active Step Change Instruction (Schg)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU Applicable PLC CPU Process Redundant Basic Universal High Performance 4.4.10 Active step change instruction (SCHG) Usable Devices Programs Using Instructions Execution Site Internal Device Link Direct Intelligent Data File SFC Program (System, User) Function Index Expansion Sequence...
  • Page 104: Block Switching Instruction (Brset)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU Applicable PLC CPU Process Redundant Basic Universal High Performance 4.4.11 Block switching instruction (BRSET) Usable Devices Programs Using Instructions Execution Site Internal Device Link Direct Intelligent Data File SFC Program (System, User) Function Index Expansion Sequence Transition...
  • Page 105 4 SFC PROGRAM CONFIGURATION MELSEC-Q 2) If the BRSET instruction is executed at an SFC program, block switching will be effective only for the step currently being executed. Even if the step in question is the same step, the BRSET instruction must be executed at each block where the Sn and TRn instructions are used.
  • Page 106: Sfc Information Devices

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.5 SFC Information Devices This section explains the SFC information devices set in each block. Table 4.2 indicates the SFC information device types and usable devices. Table 4.3 SFC Information Device List SFC Information Usable Function Outline QCPU Device...
  • Page 107 4 SFC PROGRAM CONFIGURATION MELSEC-Q POINTS The following cannot be specified for the SFC information devices. • Indirect designation (@) • Digit designation (K) • Index qualification (Z) • Word device bit designation (.) 4 - 68 4 - 68...
  • Page 108: Block Start/End Bit

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.5.1 Block START/END bit The block START/END bit is used to confirm the active status of the specified block by a sequence program or the test operation of the peripheral device. It can also be used as a device to forcibly start or forcibly end the specified block. (1) Operation of block START/END bit (a) The block START/END bit turns ON when the corresponding block starts.
  • Page 109 4 SFC PROGRAM CONFIGURATION MELSEC-Q (4) A block which has been forcibly deactivated is restarted as shown below. Relevant Block Restart Status When the START condition of block 0 is Operation is restarted from the initial "Auto START ON" in the SFC setting of the step following END step processing.
  • Page 110: Step Transition Bit

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.5.2 Step transition bit The step transition bit is designed to check whether the transition condition of the step in execution has been satisfied or not. (1) After the operation output at each step is completed, the step transition bit automatically switches ON when the transition condition (for transition to the next step) is satisfied.
  • Page 111 4 SFC PROGRAM CONFIGURATION MELSEC-Q (4) At active parallel branch steps, the transition bit will switch ON when any of the transition conditions are satisfied. S(n+1) S(n+2) Transition Transition Transition “M1” condition condition condition unsatisfied satisfied unsatisfied 4 - 72 4 - 72...
  • Page 112: Block Stop/Restart Bit

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.5.3 Block STOP/RESTART bit The block STOP/RESTART bit is used to temporarily stop processing while the corresponding block is active. (1) When the designated block STOP/RESTART bit is switched ON by the sequence program or peripheral device, processing will be stopped at the current step of the block in question.
  • Page 113 4 SFC PROGRAM CONFIGURATION MELSEC-Q POINTS The operation of SM325 differs depending on the CPU module. • For the Basic model QCPU, High Performance model QCPU, Process CPU, and QnACPU The SM325 turns ON/OFF at STOP RUN of the CPU module according to the output mode setting at block stop of parameters.
  • Page 114 4 SFC PROGRAM CONFIGURATION MELSEC-Q (3) The execution of the corresponding block is restarted from the step where it had stopped when the "block STOP/RESTART bit" is turned OFF in the sequence program, SFC program or peripheral device. An “operation HOLD status” step (with transition check or without transition check) which has been stopped will be restarted with the operation HOLD status in effect.
  • Page 115: Block Stop Mode Bit

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.5.4 Block STOP mode bit The block STOP mode bit setting determines when the specified block is stopped after the block STOP/RESTART bit switches ON, or after a stop designation by the block STOP instruction (PAUSE BLm).
  • Page 116 4 SFC PROGRAM CONFIGURATION MELSEC-Q POINTS The operation of SM325 differs depending on the CPU module. • For the Basic model QCPU, High Performance model QCPU, Process CPU, and QnACPU The SM325 turns ON/OFF at STOP RUN of the CPU module according to the output mode setting at block stop of parameters.
  • Page 117 4 SFC PROGRAM CONFIGURATION MELSEC-Q Related Instructions 1) SFC information device • Block STOP/RESTART bit ..........See Section 4.5.3. 2) SFC control instruction • Block STOP instruction (PAUSE BLm) ......See Section 4.4.7. 4 - 78 4 - 78...
  • Page 118: Continuous Transition Bit

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.5.5 Continuous transition bit The continuous transition bit specifies whether the operation output of the next step will be executed in the same scan or not when the transition condition is satisfied. (1) There are two types of SFC program transition processing: "with continuous transition" and "without continuous transition".
  • Page 119 4 SFC PROGRAM CONFIGURATION MELSEC-Q (3) The continuous transition disable flag (SM324) is always ON (turned ON automatically by the system at SFC program execution) normally, but is OFF during continuous transition. Use of SM324 under the AND condition in a transition condition disables a continuous transition.
  • Page 120: Number Of Active Steps" Register

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.5.6 “Number of active steps” register The “number of active steps” value for a given block is stored at this register. (1) The “number of active steps” value for a given block is stored. Specified device Number of steps (2) The number of active steps applies to the following steps.
  • Page 121: Step Transition Watchdog Timer

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.6 Step Transition Watchdog Timer The step transition watchdog timers are timers that measure the time from the point when the relevant step is placed in the execution status until the point when a transition to the next step occurs.
  • Page 122 4 SFC PROGRAM CONFIGURATION MELSEC-Q (4) The method for using a step transition watch dog timer is shown below. Step where time MOVP H010A SD60, oSM90 Time setting...10 1s=10s check is performed Annunciator (F) No..F1 Transition condition a H010A 10 (s) F1 (annunciator) (a) When SM90 is turned ON in the operation output of the step that performs a time check as...
  • Page 123: Sfc Operation Mode Setting

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.7 SFC Operation Mode Setting The SFC operation mode setting is used to designate SFC program START conditions, or to designate the processing method at a double START. Some settings can be made in "SFC setting of PLC parameter dialog box" in the system common setting and the others can be made in "block parameter"...
  • Page 124: Sfc Program Start Mode

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.7.1 SFC program start mode The SFC program start mode setting determines whether an SFC program START (SM321 OFF ON) is executed by an “Initial start,” or by a Resume start from the preceding execution status. (1) Settings and corresponding operations Set whether "initial start"...
  • Page 125 4 SFC PROGRAM CONFIGURATION MELSEC-Q 4: A resume start may be made depending on the SFC program change. If a resume start is made as-is, a start is made from the old step number, leading to a malfunction of the mechanical system. When any SFC program change (SFC diagram correction such as step addition and deletion) has been made, make an initial start once and then return it to a resume start.
  • Page 126: Block 0 Start Condition

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.7.2 Block 0 START condition The block 0 START condition is designed to set whether block 0 will be automatically activated or not at SFC program START (when SM321 turns from OFF to ON). Use the block 0 START condition when it is desired to specify the START block at SFC program START according to the product type, etc.
  • Page 127: Output Mode At Block Stop

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.7.3 Output mode at block STOP The "output mode at block STOP" is designed to set whether the coil outputs turned ON by the OUT instruction will be held at the time of a stop (coil output held) or all coil outputs will be forcibly turned OFF (coil output OFF) when the corresponding block is stopped temporarily.
  • Page 128 4 SFC PROGRAM CONFIGURATION MELSEC-Q (a) Output mode at block STOP in PLC parameter dialog box Set the initial status of the output mode at block STOP when the PLC is powered ON or the CPU module is reset. (b) SM325 1)The operation of SM325 differs depending on the CPU module.
  • Page 129: Periodic Execution Block Setting

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.7.4 Periodic execution block setting The periodic execution block setting designates the execution of a given block at specified time intervals rather than at each scan. (1) Setting items Designate the first block number and the time of execution for the periodic execution blocks. When these settings are designated, the “first block”...
  • Page 130: Operation Mode At Double Block Start

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.7.5 Operation mode at double block START This mode setting designates the operation mode which is to be effective when a block START request occurs (by block START step ( m , m )) for a block which is already started. (1) Settings and corresponding operations Set the operation mode at block double START to either STOP or WAIT in the "block parameter"...
  • Page 131: Operation Mode At Transition To Active Step (Double Step Start)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.7.6 Operation mode at transition to active step (double step START) This mode setting designates the operation mode which is to be effective when a follow-up function such as an operation HOLD step (with transition check) is used to execute a transition to a step which is already active.
  • Page 132 4 SFC PROGRAM CONFIGURATION MELSEC-Q (3) Operation at double START (a) When transition destination is serial transition 1) When setting is "STOP" ..If the transition destination is active, an error occurs and the processing of the CPU module stops. Transition destination 2) When setting is "WAIT"...
  • Page 133 4 SFC PROGRAM CONFIGURATION MELSEC-Q (b) When transition destination is parallel branch 1) When setting is "STOP" ..If any one of the transition destinations of the parallel branch is active, an error occurs and the processing of the CPU module stops. Transition destination 2) When setting is "WAIT"...
  • Page 134: Sfc Comment Readout Instruction

    4 SFC PROGRAM CONFIGURATION MELSEC-Q 4.8 SFC Comment Readout Instruction SFC comment readout instruction can read comments of steps being activated in the specified blocks or those of the transition condition associated with active steps. The instructions to read SFC comment are listed below. Name Ladder Expression Function...
  • Page 135: Sfc Comment Readout Instruction (S(P). Sfcscomr)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU Applicable PLC CPU Process Redundant Basic Universal High Performance 1: First five digits of serial No. are 07012 or later. 2: First five digits of serial No. are 07032 or later. 4.8.1 SFC comment readout instruction (S(P). SFCSCOMR) Usable Devices Programs Using Instructions Execution Site...
  • Page 136 4 SFC PROGRAM CONFIGURATION MELSEC-Q 6: Comments to be read are stored as follows D1 +0 Total number of active steps Number of steps that have Order of comment to be stored D1 +1 read comments (N) Step No. D1 +2 b8 b7 Empty 2nd character ASCII code...
  • Page 137 4 SFC PROGRAM CONFIGURATION MELSEC-Q [Functions] (1) This function reads step comments being activated in the SFC block specified at n1, by the number of comment specified at n2, and stores those to the device number of after specified at SP.SFCSCOMR K1 D0 K2 K2 M0 [SFC program (block1)] Device specified at...
  • Page 138 4 SFC PROGRAM CONFIGURATION MELSEC-Q (7) Reading comment is performed at END processing for a scan that has executed S(P).SFCSCOMR instruction. With per END processing, this function reads the number of comments specified at the number of comments in a single scan (n3). Comments that are not read in per END processing are followed to the next scan.
  • Page 139 4 SFC PROGRAM CONFIGURATION MELSEC-Q (8) The operation when a command of S(P).SFCSCOMR instruction is in ON status at S(P).SFCSCOMR instruction execution completed is as follows. (a) S.SFCSCOMR instruction re-executes when a command for S.SFCSCOMR instruction is in ON status. S.SFCSCOMR S.SFCSCOMR S.SFCSCOMR...
  • Page 140 4 SFC PROGRAM CONFIGURATION MELSEC-Q (11) While SFC program is not executed, reading comments is not performed even if executing S(P).SFCSCOMR instruction. Executing S(P).SFCSCOMR instruction at a status without SFC program being executed, 0 is stored to "the total number of steps ( +0)"...
  • Page 141 4 SFC PROGRAM CONFIGURATION MELSEC-Q [Operation Errors] • When a comment file specified at execution of S(P).SFCSCOMR instruction does not existed ...........................Error No. 2410 • When SFC block No. specified at n1 is other than 0 to 319 ...........................Error No. 4100 •...
  • Page 142: Sfc Transition Comment Readout Instruction (S(P). Sfctcomr)

    4 SFC PROGRAM CONFIGURATION MELSEC-Q QCPU Applicable PLC CPU Process Redundant Basic Universal High Performance 1: First five digits of serial No. are 07012 or later. 2: First five digits of serial No. are 07032 or later. 4.8.2 SFC transition comment readout instruction (S(P). SFCTCOMR) Usable Devices Programs Using Instructions Execution Site...
  • Page 143 4 SFC PROGRAM CONFIGURATION MELSEC-Q 6: Comments to be read are stored as follows. D1 +0 Total number of transition conditions Number of transition conditions Order of comment to be stored D1 +1 that have read comments (N) Step No. D1 +2 b8 b7 Transition condition No.
  • Page 144 4 SFC PROGRAM CONFIGURATION MELSEC-Q [Functions] (1) This function reads comments of the transition condition associated with steps activated in the SFC block specified at n1 with the number of comments specified at n2, and stores those to the device number of after specified at SP.SFCTCOMR K1 D0 K2 K2 M0 [SFC program (block1)] Device specified at...
  • Page 145 4 SFC PROGRAM CONFIGURATION MELSEC-Q (2) Executing S(P).SFCTCOMR instruction, SM735 of the special relay (SFC comment readout instruction executing flag) turns ON. Confirms whether or not S(P).SFCTCOMR instruction is executed by SM735. (3) In case comments are not set into active steps, "2DH(-)" is stored to the comment area (word length of 32 characters).
  • Page 146 4 SFC PROGRAM CONFIGURATION MELSEC-Q (8) The operation when a command of S(P).SFCTCOMR instruction is in ON status at S(P).SFCTCOMR instruction execution completed is as follows. (a) S.SFCTCOMR instruction re-executes when a command for S.SFCTCOMR instruction is in ON status. S.SFCTCOMR S.SFCTCOMR S.SFCTCOMR...
  • Page 147 4 SFC PROGRAM CONFIGURATION MELSEC-Q (11) While SFC program is not executed, reading comments is not performed even if executing S(P).SFCTCOMR instruction. Executing S(P).SFCTCOMR at a status of SFC program not being activated, 0 is stored to "total number of transition conditions ( +0)"...
  • Page 148 4 SFC PROGRAM CONFIGURATION MELSEC-Q [Operation Errors] • When a comment file specified at execution of S(P).SFCTCOMR instruction does not existed ...........................Error No. 2410 • When SFC block No. specified at n1 is other than 0 to 319 ...........................Error No. 4100 •...
  • Page 149: Whole Program Processing Of Basic Model Qcpu

    5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q 5. SFC PROGRAM PROCESSING SEQUENCE 5.1 Whole Program Processing of Basic Model QCPU This section explains the program processing of the Basic model QCPU. Since this manual describes only the outline, refer to the QCPU User's Manual (Function Explanation, Programming Fundamentals) for details.
  • Page 150: Whole Program Processing Of High Performance Model Qcpu, Process Cpu, Redundant Cpu And Universal Model Qcpu

    5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q 5.2 Whole Program Processing of High Performance Model QCPU, Process CPU, Redundant CPU and Universal model QCPU This section explains the whole program processing of the High Performance model QCPU, Process CPU, Redundant CPU and Universal model QCPU. Since this manual describes only the outline, refer to the QCPU User's Manual (Function Explanation, Programming Fundamentals) for details.
  • Page 151 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q Execution Type Description SFC Compatibility Initial execution type • Executed only in one scan when the PLC is powered ON program or the CPU module is switched from STOP to RUN. (Initial) • After that switches to a stand-by type program. Max.
  • Page 152: Execution Type Designation By Instructions

    5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q 5.2.2 Execution type designation by instructions The "execution designation by instruction" function enables the execution type set in the program setting of the PLC parameter dialog box to be changed by the instruction. This function can be applied to normal SFC programs only. (Inapplicable to the SFC programs for program execution management.) Execution designation by instruction will be explained.
  • Page 153 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q (3) Processing time required to switch SFC program from WAIT status to scan status The processing time required to switch an SFC program from a WAIT status to a scan status is shown below. Although the scanning time is extended by the amount of the processing time, this will not result in a watch dog timer error detection.
  • Page 154: Sfc Program For Program Execution Management

    5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q 5.2.3 SFC program for program execution management This SFC program can be used to manage the program execution sequence when multiple program file switching is required. In addition to a normal SFC program, only one block can be created and executed for a single file of an SFC program for program execution management.
  • Page 155 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q (3) Example of program execution management SFC programs In the following example, SFC program ABC is executed when condition 1 is satisfied, and SFC program XYZ is executed when condition 2 is satisfied. Condition 1 When condition 1 is satisfied, execution proceeds to S1.
  • Page 156: Sfc Program Processing Sequence

    5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q 5.3 SFC Program Processing Sequence 5.3.1 SFC program execution The SFC program is executed once per scan. (1) Basic model QCPU The Basic mode QCPU executes a sequence program and then executes a SFC program. The program execution status is shown below under the following condition.
  • Page 157 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q (2) High Performance model QCPU, Process CPU, Redundant CPU and Universal model QCPU The High Performance model QCPU, Process CPU and Redundant CPU can execute multiple programs stored in the program memory. (Scan execution is enabled for two SFC programs (one SFC program for program execution management and one normal SFC program).
  • Page 158: Block Execution Sequence

    5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q 5.3.2 Block execution sequence (1) In the SFC program, the step in the active block is executed every scan. (2) When there are multiple blocks, the blocks are processed in order of lower to higher block numbers.
  • Page 159: Step Execution Sequence

    5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q 5.3.3 Step execution sequence (1) In the SFC program, the operation outputs of all active steps are processed within one scan. Block 0 Active steps in corresponding block are executed within 1 scan. : Active step : Inactive step (2) At the end of the operation output execution at each step, whether the transition condition to the next step is satisfied or not is checked.
  • Page 160: Continuous Transition On/Off Operation

    5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q 5.3.4 Continuous transition ON/OFF operation There are two types of SFC program transition processing: "with continuous transition" and "without continuous transition". Set "with continuous transition" or "without continuous transition" using the continuous transition bit of the SFC information devices. When the device set to the continuous transition bit is turned ON/OFF by the user, operation is performed as described below.
  • Page 161 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q (1) Transition processing for continuous transition OFF setting The SFC program processing procedure without continuous transition will be explained. (1) Active step (n) instruction operation oY10 (2) Transition condition satisfied/unsatisfied check oY11 When transition condition When transition condition is unsatisfied is satisfied...
  • Page 162 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC-Q (2) Transition processing for “continuous transition ON” setting The SFC program processing procedure with continuous transition will be explained. (1) Active step (n) instruction operation oY10 (2) Transition condition satisfied/unsatisfied check oY11 When transition condition When transition condition is unsatisfied is satisfied...
  • Page 163: Sfc Program Start And Stop

    6 SFC PROGRAM EXECUTION MELSEC-Q 6. SFC PROGRAM EXECUTION 6.1 SFC Program START And STOP There are the following three types of SFC program start and stop methods. • Auto START using PLC parameter • Start and stop using the special relay for SFC program start/stop (SM321) •...
  • Page 164: Sfc Program Resumptive Start Procedure

    6 SFC PROGRAM EXECUTION MELSEC-Q 6.1.1 SFC program resumptive START procedure The SFC program START format can be designated as “initial START” or “resumptive START”. The “resumptive START” setting procedure as well as some precautions regarding the “resumptive START” format are described below. (1) Resumptive START setting procedure Make the resume START setting of the SFC program in the "SFC program start mode"...
  • Page 165 6 SFC PROGRAM EXECUTION MELSEC-Q 4: A resume start may be made depending on the SFC program change. If a resume start is made as-is, a start is made from the old step number, leading to a malfunction of the mechanical system. When any SFC program change (SFC diagram correction such as step addition and deletion) has been made, make an initial start once and then return it to a resume start.
  • Page 166: Block Start And End

    6 SFC PROGRAM EXECUTION MELSEC-Q 6.2 Block START and END 6.2.1 Block START methods The block START methods during SFC program execution are described below. As shown below, there are several block START methods. Choose the method which is most suitable for the purpose at hand.
  • Page 167: Block End Methods

    6 SFC PROGRAM EXECUTION MELSEC-Q 6.2.2 Block END methods The methods for ending block operations are described below. As shown below, there are several block END methods. Choose the method which is most suitable for the purpose at hand. END Method Operation Description Remarks •...
  • Page 168: Block Temporary Stop And Restart Methods

    6 SFC PROGRAM EXECUTION MELSEC-Q 6.3 Block Temporary Stop and Restart Methods 6.3.1 Block STOP methods The temporary block STOP methods which can be used during SFC program execution are described below. (1) Block STOP methods The methods for temporarily stopping a block during SFC program operation are shown below. STOP Method Operation Description Remarks...
  • Page 169 6 SFC PROGRAM EXECUTION MELSEC-Q (2) Block STOP timing and coil output status when STOP occurs The STOP timing in response to a block STOP request, and the coil output status during the STOP are as shown below. Operation Held step Setting of Output Operation Active step other than held...
  • Page 170 6 SFC PROGRAM EXECUTION MELSEC-Q POINT The operation of SM325 differs depending on the CPU module. • For the Basic model QCPU, High Performance model QCPU, Process CPU, and QnACPU The SM325 turns ON/OFF at STOP RUN of the CPU module according to the output mode setting at block stop of parameters.
  • Page 171: Restarting A Stopped Block

    6 SFC PROGRAM EXECUTION MELSEC-Q 6.3.2 Restarting a stopped block The methods for restarting a block which has been temporarily stopped during SFC program processing are described below. (1) Restarting block processing The methods for restarting a block which has been temporarily stopped are shown below. Restart Method Operation Description Remarks...
  • Page 172 6 SFC PROGRAM EXECUTION MELSEC-Q POINT The operation of SM325 differs depending on the CPU module. • For the Basic model QCPU, High Performance model QCPU, Process CPU, and QnACPU The SM325 turns ON/OFF at STOP RUN of the CPU module according to the output mode setting at block stop of parameters.
  • Page 173: Step Start (Activate) And End (Deactivate) Methods

    6 SFC PROGRAM EXECUTION MELSEC-Q 6.4 Step START (Activate) and END (Deactivate) Methods 6.4.1 Step START (activate) methods There are the following step START (activation) methods. Step START Operation Remarks (Activation) Method • The corresponding step is automatically started when the preceding transition condition is satisfied.
  • Page 174: Step End (Deactivate) Methods

    6 SFC PROGRAM EXECUTION MELSEC-Q 6.4.2 Step END (deactivate) methods Steps can be ended (deactivated) by the methods shown below. END Method Operation Remarks • The step is automatically ended by the system • Basic operation of SFC program when the transition condition associated with the •...
  • Page 175: Changing An Active Step Status (Cannot Be Used For Basic Model Qcpu And Universal Model Qcpu)

    6 SFC PROGRAM EXECUTION MELSEC-Q 6.4.3 Changing an active step status (Cannot be used for Basic model QCPU and Universal model QCPU) This section explains the method for ending (deactivating) an active step and starting (activating) the specified step. Changing Method Operation Remarks •...
  • Page 176: Operation Methods For Continuous Transition

    6 SFC PROGRAM EXECUTION MELSEC-Q 6.5 Operation Methods for Continuous Transition If "with continuous transition" is set, whether a continuous transition will be performed or not can be selected at each step using the continuous transition disable flag (SM324). (1) Processing performed when continuous transition disable flag is not used SFC Program With Continuous Transition Without Continuous Transition...
  • Page 177: Operation At Program Change

    6 SFC PROGRAM EXECUTION MELSEC-Q 6.6 Operation at Program Change The SFC program of the CPU module can be changed in either of the following methods. • Write to PLC (write in file unit) • Online change (write in ladder block unit) The following table indicates SFC program changes that can be made in the above methods.
  • Page 178 6 SFC PROGRAM EXECUTION MELSEC-Q (1) Operation at program change made by write to PLC (a) When program was written with CPU module in PAUSE/STOP status 1) Program start after write to PLC An initial start is performed independently of the SFC start mode setting (initial start/resume start).
  • Page 179 6 SFC PROGRAM EXECUTION MELSEC-Q MEMO 6 - 17 6 - 17...
  • Page 180: Appendix 1 Special Relay And Special Register List

    APPENDICES MELSEC-Q APPENDICES APPENDIX 1 Special Relay and Special Register List The special relays and special registers which can be used in SFC programs are shown below. For information regarding other special relays and special registers (not used at SFC program), refer to the QCPU (Q mode) / QnACPU Programming Manual (Common Instructions).
  • Page 181: Special Relays (Sm)

    APPENDICES MELSEC-Q APPENDIX 1.1 Special Relays (SM) Compatible CPU Setting Side Name Content Description (Setting Timing) Step transition watch SM90 dog timer START (corresponds to SD90) Step transition watch SM91 dog timer START (corresponds to SD91) Step transition watch SM92 dog timer START (corresponds to SD92) Step transition watch...
  • Page 182 APPENDICES MELSEC-Q Compatible CPU Setting Side Name Content Description (Setting Timing) Step transition watch OFF: Not started Switched ON to begin the step SM98 dog timer START (Watch dog timer transition watch dog timer count. (corresponds to SD98) reset) User Watch dog timer is reset when ON : Started Step transition watch...
  • Page 183 APPENDICES MELSEC-Q Compatible CPU Setting Side Name Content Description (Setting Timing) Select whether the coil output of the active step will be held or not at a block STOP. • As the default value, OFF when coil output OFF is System selected for the output mode at Operation output at...
  • Page 184 APPENDICES MELSEC-Q Compatible CPU Setting Side Name Content Description (Setting Timing) • Indicates whether the normal SFC program is being executed Normal SFC program OFF : Not executed S (status SM331 or not. execution status ON : Being executed change) •...
  • Page 185: Special Registers (Sd)

    APPENDICES MELSEC-Q APPENDIX 1.2 Special Registers (SD) Compatible CPU Setting Side Name Content Description (Setting Timing) • Set the set time of the step transition watch SD90 dog timer and the annunciator No. (F No.) that will turn ON at time-out of the watch SD91 dog timer.
  • Page 186 APPENDICES MELSEC-Q APPENDIX 2 Restrictions and Alternative Method of the Basic Model QCPU and Universal Model QCPU This section explains the restrictions on use of a SFC program with the Basic model QCPU. (1) Function comparison High Performance Model QCPU Basic Mode QCPU Replacement Item...
  • Page 187: Step Transition Watchdog Timer Replacement Method

    APPENDICES MELSEC-Q APPENDIX 2.1 Step Transition Watchdog Timer Replacement Method (1) Operation of step transition watchdog timer The step watchdog timer measures the ON time of the special relay for step transition watchdog timer start (SM90 to SM99), and when it exceeds the time set to the special register for step transition watchdog timer setting (SD90 to SD99), the corresponding annunciator (F) set to any of (SD90 to SD99) is turned ON.
  • Page 188: Periodic Execution Block Replacement Method

    APPENDICES MELSEC-Q APPENDIX 2.2 Periodic Execution Block Replacement Method (1) Operation of periodic execution block A periodic execution block is executed in each scan where the specified execution interval has elapsed. The following figure shows the operation performed when blocks 0, 1, 2, 10 and 11 are used and blocks 10 and 11 are set as the periodic execution blocks.
  • Page 189: Forced Transition Bit (Trn) Replacement Method

    APPENDICES MELSEC-Q APPENDIX 2.3 Forced Transition Bit (TRn) Replacement Method (1) Operation by forced transition bit The forced transition bit forcibly satisfies a transition condition. When the forced transition bits are used, the preset input conditions can be ignored and the transition conditions can be satisfied in due order.
  • Page 190: Active Step Change Instruction (Schg) Replacement Method

    APPENDICES MELSEC-Q APPENDIX 2.4 Active Step Change Instruction (SCHG) Replacement Method (1) Operation of active step change instruction The active step change instruction deactivates the instruction-executed step and forcibly activates the specified step in the same block. SCHG K6 Activates step 6 when X1 turns ON.
  • Page 191 APPENDICES MELSEC-Q MEMO APP -12 APP -12...
  • Page 192 6. Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi. 7. Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user. 2. Onerous repair term after discontinuation of production (1) Mitsubishi shall accept onerous product repairs for seven (7) years after production of the product is discontinued.

Table of Contents