Home

QCPU(Q Mode)/QnACPU Programming Manual (SFC)

image

Contents

1. Up to 32 steps 4 SFC PROGRAM CONFIGURATION MELSEC QnA 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 Transition condition b Step n41 Block 1 START Transition Transition condition condition When condition b is satisfied at step n ES execution processing will proceed to step n 1 and block 1 will be started Blocks 0 and 1 will then be processed simultaneously 3 Up to 1280 steps total for all blocks can be processed simultaneously If the 1280 limit is exceeded an error will occur and the PC CPU operation will be stopped The maximum number of active steps per block is 256 4 Couplings must be provided when the parallel transition format is used Program creation is impossible without couplings Example Program without couplings NG example Jump END step Each column ends A e at the END step Jump transition see Section 4 3 4 occurs without coupling 5 As arule a waiting step must be created prior to the coupling However in cases such as the example below where each of the parallel transition columns consist of only 1 step program without a transition condition between the parallel trans
2. At expansion SFC and other columns m represents the block No and n represents the step transition condition No Hie T Function 1 The step where this instruction is executed is deactivated and a specified step within the same block is forcibly activated 2 If the destination step is already active the step where this instruction is executed will be deactivated and processing of the destination step will continue as is 3 The step where this instruction is executed is deactivated when processing proceeds to the transition condition status check following the completion of that step s program operation 4 This instruction can only be used at SFC program steps Operation Error e Error No 4631 occurs when the specified destination step does not exist e Error No 4001 occurs when this instruction is used at a Sequence program other than an SFC program error is activated on switching from STOP to RUN Program Examples 1 When X1 switches ON the following program deactivates step 5 and activates step 6 X1 L sre re 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 4 11 Block switching instruction BRSET Usable Devices Programs Using Instructions Execution Site l Devi i nternal Device o A i Data SFC Program Lu System User x e Type Sequence id Program iti Bit Word BLm TRn TRn Selene Condition O At expansion SFC and other columns
3. D Ja s5 se p s Lts Lt5 t6 La Les When a selection coupling has been designated for a block with multiple active initial steps the steps immediately following the coupling will be activated when any one of the transition conditions immediately preceding the coupling is satisfied In the program example shown above step 8 S8 will be activated when any one of the t4 to t7 transition conditions is satisfied When another transition condition immediately preceding the coupling becomes satisfied after the post coupling step has been activated re activation processing will occur as a follow up function When the other transition condition is established with the step immediately after coupling S8 in the above example being active you can select stop standby or transition using Operation mode for step transition to active step at step double start refer to Section 4 7 6 in Block parameter of Set SFC information in the Tools menu 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 3 6 Precautions when creating sequence programs for operation outputs steps and transition conditions The points to consider when creating operation output step and transition condition sequence programs are described below 1 Sequence program for operation outputs steps a Step sequence program expression format A step sequence program using the ladder expression format is shown below nik ae Condition can be omitted C inst
4. 1 GENERAL DESCRIPTION MELSEC QnA 10 Convenient trace function for GPPQ and QnACPU only Blocks can be synchronized and traced enabling the user to check the operation timing of multiple blocks Moreover the trace results display screen can be switched to display the trace result details for each block Trace Results Display Block x k m Active step Nos 2 are displayed from smallest No for each block Block n Block No Where trace zs kk 6 SS Sp zk kp amp amp amp 1 occurred 2 117 6 220 32 58 400 A 819 Active step No 402 displa 819 Play 403 204 404 204 1 11 1 11 2 SYSTEM CONFIGURATION MELSEC QnA 2 SYSTEM CONFIGURATION 1 Applicable CPU models MELSAP3 SFC program can be run by the following CPU models e Q02CPU e QO2HCPU e Q2ACPU e Q2ASCPU e QO6HCPU e Q2ACPU S1 e Q2ASCPU S1 2 e Q12HCPU e Q3ACPU e Q2ASHCPU e Q25HCPU e Q4ACPU e Q2ASHCPU S1 e Q4ARCPU 2 Peripheral devices for the SFC program SFC program creation editing and monitoring operations are conducted at the following peripheral devices Peripheral Device Software Package High Model Name Name g Remarks Performance QnACPU model QCPU SW3D5C F GPPW Personal Computer SW4D5C GPPW PC AT Compatible PC SW2IVD GPPQ 2 SYSTEM CONFIGURATION MELSEC QnA MEMO 3 SPECIFICATIONS MELSEC QnA 3 SPECIFICATIONS The performance specifications for SFC programs are des
5. Indicates character Variable string processing number of words e Device Indicates device name and Variable first device processing number of words 4 The type of program which can be used with the instruction in question is indicated here 5 The request destination for the instruction in question is indicated here 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 4 1 Step operation status check instructions LD LDI AND ANI OR ORI Devi i jarernal Devies i i spacial Expansion Data SFC Program System User en rn Function Index Constant Sequence BANE Pe SFC Other Type Module L Program Bit Word BLm Sn Ste Transition i o P Condition ele Device name Sn only At expansion SFC and other columns m represents the block No and n represents the step transition condition No Usable Devices Programs Using Instructions Execution Site Sn a n is the step No BLm Sn m is the block No n is the step No LD Sn n LD BLm Sn C gt Sn BLm Sn LDI Sn ch LDI BLm Sn E GE Sn BLm Sn ano sa fp ano atmisn 4 J C4 BLm Sn mis HO M sms H ee a OR Sn f C OR BLm Sn Co BEA aen ORI Sn ORI BLm Sn CoH Sn BLm Sn Functions 1 Checks a specified step in a specified block to determine if the step is active or inactive 2 If the step in question is
6. m represents the block No and n represents the step transition condition No Hmc TO H Function 1 Designates the destination block number for an SFC control instruction which specifies only a step Sm or transition condition TRn 2 Although BLm Sn or BLm TRn may be used as the instruction device when designating the destination block number only a constant K H may be designated at the m of BLm thereby fixing the designation destination When block switching is executed by this BRSET instruction a word device can be used for indirect designation index qualification etc 3 The effective operation range when block switching occurs by BRSET instruction varies according to the program being run at the time as shown below 1 If the BRSET instruction is executed at a sequence program block switching will be effective from the point where the instruction is executed to the END step At the next scan the block in question will be designated as block 0 default value until the point when the BRSET instruction is executed again 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 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 Moreover within a
7. 4 Expanded memory capacity In addition to an increased number of steps and branches per block the capacity of step and transition condition programs has been increased to 4k sequence steps in order to make programming easier 5 Substantial block information The amount of block information has been increased permitting operations such as a continuous transition designation in 1 block units and a STOP timing selection immediate STOP or STOP when transition condition is satisfied for block STOP requests Furthermore the additional block information simplifies operation by permitting a block START and END to be executed from a single device 6 Increased processing speed reduces system processing time The SFC program s system processing time has been reduced resulting in reduced tact times through the efficient combination of the SFC program functions 7 Improved operability of SFC software package Troublesome menu switching operations have been eliminated by permitting SFC comments steps and transition condition programs to be created concurrently with SFC ladder creation Moreover the SFC diagram cut amp paste function and block unit registration utilization have been simplified x For reference purposes comparisons of the major MELSAP II andMELSAPS3 functions are shown in the following pages APP 6 APP 6 APPENDICES MELSEC QnA 1 SFC Diagram Symbols MELSAP II MELSAP3
8. 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA 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 1 Settings and corresponding operations A PAUSE WAIT or TRANSFER setting can be designated The operations resulting from these settings are shown below Setting e A CPU operation error BLOCK EXE ERROR occurs and ie A step range can be CPU operation is stopped designated for the STOP e All Y outputs switch OFF setting e CPU operation continues and a WAIT status is established when the transition condition is satisfied The WAIT status continues until the START destination step is deactivated sl a transition WAIT occurs the previous step is deactivated the output is switched OFF and the operation output will not be executed e CPU operation continues the transition occurs and the previous step is deactivated and absorbed by the transition destination step TRANSFER default Active step Inactive Condition satisfied Active step gt Active e A step range can be designated for the WAIT setting Condition satisfied 2 Transition to HOLD step by double START The following table shows the transition procedure for transitions to coil HOLD steps operation HOLD steps
9. Step 1 operation output deactivated ransition condition h satisfied Step 4 operation output executed Step 2 operation output executed x1 y Step 1 operation output deactivated ransition conditio c satisfied YES 1 Step 2 operation output deactivated Step 3 operation output executed ransition condition TT satisfied YES Si Step 4 operation output deactivated Step 5 operation output executed Step 6 oper exec ation output uted Transition conditio i satisfied YES 1 Step 6 operation output Transition condition Transition condition deactivated g satisfied d satisfied YES 1 YES Kal Step 5 operation output Step 3 operation output deactivated deactivated Je Step 7 operation output executed Transition condition j satisfied Step 7 operation output deactivated END step executed operation completed 4 20 4 20 x1 For steps with attribute designations processing occurs in accordance with the attributes 4 SFC PROGRAM CONFIGURATION 4 3 3 Parallel transition MELSEC QnA 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 Transition condition b a Step
10. satisfied a Step 2 Transition condition c Initial step operation output deactivated H Step 3 Transition condition d Step 1 operation output executed END step a Transition condition b satisfied YES x1 Step 1 operation output deactivated Step 2 operation output executed Transition condition c satisfied YES 1 Step 2 operation output deactivated Step 3 operation output executed Transition condition d satisfied YES EA Step 3 operation output deactivated END step executed operation completed x1 For steps with attribute designations processing occurs in accordance with the attributes 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 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 e From step n processing will proceed to either B Step n step n 1 or n 2 depending on which operation output A transition condition b or c is satisfied first e If both transition conditions are satisfied simultaneously the condition to the left will take precedence Step n will then be deactivated e Subsequent processing will proceed from step to step in the selected column until another
11. As shown below there are several block START methods Choose the method which is most suitable for the purpose at hand START Method Operation Description e When the SFC program is started block Convenient when block 0 is used as a Auto START ON Ois automatically started and is executed from its initial step e A START request is designated from another sequence program for a specified block The specified block is then started and executed from its initial step Auto START OFF e Another block is started by the block START steps HI E at each of the SFC program blocks m H Ges Hm START occurs Block START by SFC diagram symbol i 1 1 1 ele e Using an SFC control instruction a specified block is forcibly started from an SFC program step operation output or from another sequence program 1 When specified block is executed from its initial step Block START by SFC Condition control instruction H m is the block No 2 When specified block is executed from a specified step Condition 7 m is the block No n is the step No e A specified block is started by forcing the block START END bit ON from a program or a peripheral device The block START END bit is designated at each block as an SFC information register Block START by SFC information register control block pre processing block or a constant monitoring bloc
12. HOLD Steps Steps OFF or no setting immediate STOP OFF e After the STOP instruction the e Operation output s coil output OFF ON operation output s coil output coil output switches post transition switches OFF when the transition OFF at the STOP STOP condition is satisfied and operation instruction and stops operation stops e Operation output s coil output switches OFF at the STOP instruction and operation stops Coil output OFF default coil output ON OFF or no setting immediate STOP Coil output ON e A coil output HOLD ON coil output HOLD ON Mee status is established i lish postaranaiion output HOLD status is established at the STOP STOP when the transition condition is instruction and satisfied and operation stops e operation stops e A coil output HOLD status is established at the STOP instruction and operation stops The operation holding step means the step at which the transfer conditions are established and the operation is held when the step attribute is set at hold step SC SE ST 1 The coil HOLD step becomes inactive the first time processing occurs at the block in question following the STOP request 2 When CPU STOP gt RUN switching occurs the SM325 special relay is switched OFF when the coil output is OFF and is switched ON when the coil output is ON in accordance with the parameter setting The SM325 special relay can also be switched ON and OFF by t
13. STOP RESTART bit is switched OFF at the sequence 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 A coil output HOLD step cannot be restarted after being stopped as it is deactivated at that time 4 Execution of PLS and 1P instructions after a block STOP has been canceled varies according to the ON HOLD or OFF all OFF status of the SM325 special relay ON operation output HOLD at block STOP OFF all OFF SM325 ON Not executed OFF Executed again 5 When the SFC control block STOP instruction PAUSE BLm is executed the block in question is stopped and the block STOP RESTART bit switches ON When the block RESTART instruction RSTART BLm is executed while the block is stopped the block in question is restarted and the block STOP RESTART bit switches OFF POINTS 1 Stopping of program processing by a block STOP RESTART bit being switched ON or by a block STOP instruction applies only to the specified block 2 Even if a block stop is executed for the START destination block the START source block will not be stopped 3 Even if a block stop is executed for the START source block the START destination block will not be stopped Related Instructions 1 SFC information register e Block STOP mode bn See Section 4 5 4 2 SFC control
14. _ TRn and transition destination instruction TSET Sn 2 For parallel branching Total number of steps for the transition START instruction TRAN TRn and transition destination instructions TSET Sn for the number of parallel branches in question 3 For parallel coupling Total number of steps for the transition START instruction TRAN TRn and the transition destination instructions TSETSn and coupling check instructions TAND Sn for the number of parallel branchings in question 1 e Jump L block end L Calculated as step 0 because it is included in the previous transition condition e Operation outputs for each step The capacity per step is as follows e Total number of sequence steps for all instructions For details regarding the number of sequence steps for each instruction refer to the QCPU Q mode QnACPU Programming Manual Common Instructions e Transition conditions The capacity per transition condition is as follows e Total number of sequence steps for all instructions For details regarding the number of sequence steps for each instruction refer to the QCPU Q mode QnACPU Programming Manual Common Instructions 3 SPECIFICATIONS MELSEC QnA 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 Expression SFCP
15. information APP 4 Error information classification code Error common information Error individual information e When more than one error has occurred the error with the highest displa priority is stored SD1 Year 00 to 99 Month 1 to 12 SD2 Day 1 to 31 Hour 0 to 23 SD3 Minute 0 to 59 Second 0 to 59 e Code which identifies an error as information or individual information is stored BIN 8 bits BIN 8 bits Individual information codes 0 None 1 2 File name 3 Time actual count value 4 Program error location 5 Parameter No 6 Annunciator F No Each item is stored as BCD 2 digit data Common information codes 0 None 1 Unit No 2 File name 3 Time setting value 4 Program error location 7 CHK instruction Failure No e The error 2common information is stored zk When the SFC program is started data is stored as SD5 SD6 follows File name Extend name Eu Pattern Step No transition condition No Block No Sequence program No for step and transition condition b15 b3 b2 bi b 0 0 1 0 1 0 1 b0 SFC block information present b1 SFC step information present b2 SFC transition condition information present The error individual information is stored There is no individual information for errors origina
16. refer to the QCPU Q model QnACPU Programming Manual Common Instructions b Method for calculating the system processing time System processing time SFC END processing time active block processing time x number of active blocks processing time for inactive blocks x number of inactive blocks x processing time for nonexistent blocks x number of nonexistent blocks active step processing time x number of active steps processing time for active step transition conditions x number of active step transition conditions processing time for steps where transition conditions are satisfied x number of steps where transition conditions are satisfied e Number of active blocks 0 a001aa Total number of active blocks e Number of inactive blocks Total number of inactive blocks e Number of nonexistent blocks Total number of parameterdesignated blocks which have no programs e Number of active steps aseeeseea Total number of active steps in all blocks e Number of active step transition conditions Total number of transition conditions for all steps in all blocks e Number of steps where transition conditions are satisfied Number of steps in all blocks where the transition conditions have been satisfied resulting in an operation output OFF 3 SPECIFICATIONS MELSEC QnA 2 CPU models and corresponding system processing times 1 High Performance model QCP
17. steps in sequence as their specified block and transition conditions are satisfied a STOP will occur OFF or no e After the STOP request a coil output HOLD status will be setting established the first time processing occurs at the specified immediate stop block and a STOP will occur e After the STOP request the coil After the STOP output HOLD status will be EE ON established when the transition i HOLD ae vg i Edel de coil output HOLD ON condition is satisfied and a STOP HOLD Status will pa i 8 established the first post transition will occur Beete STOP e If multiple steps are active the p 9 e occurs at the STOP will occur at each of the e 8 specified block and steps in sequence as their e a SA a STOP will occur transition conditions are satisfied Coil output OFF OFF coil output HOLD coil output OFF ON post transition STOP 4 SFC PROGRAM CONFIGURATION MELSEC QnA 1 The coil HOLD step becomes inactive the first time processing occurs at the block in question following the STOP request 2 During SFC program execution the M325 special relay is switched OFF when the coil output is OFF and is switched ON when the coil output is ON in accordance with the parameter setting The M325 special relay can also be switched ON and OFF by the user program without regard to the parameter setting 3 Processing of the block is restarted from the step where the STOP occurred when the block
18. with transition check and operation HOLD steps without transition check which occur when the double START condition is satisfied These transitions occur without regard to the settings described at item 1 above e The TRANSFER setting applies to all operations regardless of the setting e At coil HOLD steps The operation output is restarted and a transition condition check begins The PLS instruction for which the input conditions have already been established is non executable until the input conditions are turned on again e Following the double PAUSE e At operation HOLD steps without transition check START execution of all WAIT TRANSFER A transition condition check begins subsequent steps where e At operation HOLD steps with transition check transition conditions are Operation continues as is satisfied will occur according Active step Inactive to the step attributes Transition condition satisfied Coil HOLD step or operation output step F 2 without transition check i ransition CONAN is checked No transition condition check 4 SFC PROGRAM CONFIGURATION MELSEC QnA 3 Precautions when transition destination is a parallel branch e When a STOP setting is designated E An error is activated if even 1 of the parallel branch stransition destination steps is active and CPU operation isstopped E WW II WW e When a WAIT setting is designated zeg A WAIT status is establi
19. without transition check e e with transition check Reset Resetstep i BEE with END wait e E without END wait D lt Coupling amp Branch KH E A dummy step is required when couplings or branches are duplicated at a transition condition DI Coupling and branch duplications are possible at a transition condition APP 7 APP 7 APPENDICE MELSEC QnA 2 SFC Control Instructions The SFC control instruction shown below are available at MELSAP3 MELSAP II has no SFC control instructions Ladder Expression Function LD AND OR Sr Step status active inactive LDI ANI ORI check instruction C LD AND OR LDI ANI ORI Ee AND OR J TRn Checks a specified step in a specified block to Forced transition check LDI ANI ORI determine if the transition condition by instruction LD AND OR J BLn TRn transition control instruction for that step was LDI ANI ORI satisfied forcibly or not Block operation status C LD AND OR S BLm Checks a specified block to determine if it is check instruction LDI ANI ORI active or inactive BLm K4Sn K8Sn D e Active steps in a specified block are read toa specified device as bit information e Executes a check to determine if a specified J BLm Sn step at a specified block is active or inactive Active steps batch readout instruction e A specified block is
20. AEA aea Aut AE ea ede 5 2 5 1 1 Program processing SEQUENCE eccseceeeeeeeeeeeeeeeeeeeteneseaeeeaeseaesaeeeaeeaeseaeeeaeseaeeeaeseaeeeaeeeaeeeaeeeaeeeas 5 2 5 1 2 Execution type designation by instructions eceeceeeceeeceseeeeeeeeeeeeeeeseeseeeseeseeseeseeeeeeeteeeseeeeeeateaes 5 4 5 1 3 SFC program for program execution management 5 6 5 2 SFC Program Processing Sequence eseseeesssesiesesrsresnstetnrstnttstntnstntustntnonsnnennnsnsnnnnsnnnnsnnnnnnnnnnn nen 5 8 5 2 1 SFC program execution Cycle 5 8 5 2 2 Block execution SEQUENCE us oh ait en cinta lit aie ei eet 5 9 5 2 3 Step EXECUTION seouence i aa e aa aa a a aaa A a a aa A a E a aai 5 10 5 2 4 Continuous transition ON OFF operation cccccecceceeseeeeceeceeeeaeeeeceeseeseeseeseeeeaesaeseeseaesaesaeseeseaeeaees 5 11 6 SFC PROGRAM EXECUTION 6 1 to 6 10 6 1 SFG Program START and STOP gett citsieerechayteinimeeeclaysbecthinineielayeaeen iieelaiene Taaa aaa aao tities 6 1 6 1 1 SFC program resumptive START Drocedure 6 2 6 2 Block START and END eat ee 6 3 RE ER Hu ele EE 6 3 GEI d2lgtlulE le EE 6 4 6 3 Block Temporary Stop amp Restart Methode 6 5 6 3 1 Block STOP methods Asie tds e Mintaro nena al Wipe Nea ae Meee ped 6 5 6 3 2 Restarting a stopped DIOCK seciseccseccseccsectsencsorcseccsaccscessoncaaecazetacecazecdae cane iacecanecatncusetastcesaceaceesetacecaaes 6 7 6 4 Step START Activate and END Deactivate Methods A 6 8 6 4 1
21. Block START END bit Step transition bit Y M L F V B SFC information register settings are designated when entering the SFC diagram 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 5 1 Block START END bit The block START END bit can be used as a confirmation device when a block is activated by a block START step or it can be used to execute a forced START or forced END from sequence program or by peripheral device test operation at a given block 1 The block START END bit can be used for purposes such as providing an interlock when confirming that the sub block in question is inactive when a sub block is started by a block START step Block 0 Block 5 0 Bra C 9 Block 5 s block active bit MO 0 S 0 1 Yy 1 1 2 A o MO ON i 1 p 1 OFF ee 2 Desai 2 oer A8 SIE 2 If the block in question is inactive and is forced ON by the block START END bit from a peripheral device test function that block can be started independently Moreover processing of that block can be forcibly ended by executing a forced OFF 3 When a forced OFF is executed by the block START END bit and the block in question becomes inactive processing will occur as follows e Execution of the block in question will stop together with all outputs from the step which was being executed Devices switched ON by the SET instruction will not switch OFF e If a START status exists at a
22. DX Output relay YO to Y1FFF LO to L8192 e Direct processing at DY Internal relay MO to M8192 FO to F2047 Latch relay VO to V2047 BO to BiFFF Variable within a total of 28 75 K words Internal user Bit word Edge triggered rela DO to 12287 Link register 0 to C1023 e Contact and coil by bit Link relay WO to W1FFF e T and ST by parameter setting Special link relay SBO to SB1FF Special link 3 SWO to SW1FF register Step relay Link input i TO to T2047 Retentive timer e Contact and coil by bit SO to 8511 1 block s e Exclusively for SFC program 8192 points for all blocks Link input J X0 to J X1 FFF Link output J L YO to J J Y1FFF J BO to J _ B1FFF Link direct paana Link special relay J C SBO to J SB1FF e Present at each link unit MELSECNET H Tick register J LIWO to J W1FFF Word Link special register e Present at each installed Special unit direct Buffer register Word U _ GO to U _ G16383 f special unit i W index geet index register_ _Word 20 to zs e 3 SPECIFICATIONS MELSEC QnA User Classification Device Type Expression Assign Remarks ment to R32767 e When block switching is used File register File register Fixed ee to ZR1042431 SFC block BLotoBL3ig ssi to BL319 SFC transition TRO to TR511 block e Exclusively for SFC program device 8192 points for
23. EE roa Program geg i BLm Sn g Ste Transition Hl Condition BIN16 BIN32 roo BIN16 BIN32 A X 2 3 4 5 l et o mrn Ee OH Destination Source Instruction code Destination Source Instruction code Destination cccceeeeeeteeeeees Data destination following the operation Ee tte Where data is stored prior to the operation 2 Usable devices are indicated at this area e Devices indicated by a circle mark O can be used with the instruction in question The device application classifications are shown below 4 32 4 32 4 SFC PROGRAM CONFIGURATION MELSEC QnA NET 10 Direct Special Internal System User Device KEE Function Decimal hexadecimal real number Usable devices constant character string constant When a device name is indicated in the constant only that device may be used Example If K H is indicated in the constant column only a decimal K or hexadecimal H constant may be used Real number constants E and character string constants may not be used expansion SFC or the other column 3 The data type for the designated device is indicated here S E Indicates a bit data operation e DIN Indicates 16 bit binary value processing 1 word used 2 a Indicates 16 bit binary value processing 2 words used e Character string
24. Example 7 M1 BL1 ransition E 7 E a condition St Ce SE ES Block 1 START request When the block 1 Block 1 status BLOCK START end bit is M1 active inactive is checked 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 2 10 Block END 1 A block END indicates the end of the processing sequence for a given block 2 After a block END execution is completed operation is restarted by the methods shown below Block No Restart Method When block 0 START condition is designated as auto START ON at the SFC parameter setting When block 0 START condition is e A restart is executed when any of the following occurs e Processing automatically returns to the initial step and operation is repeated At block 0 designated as auto START OFF 1 When another START request is received from another block block at the SFC parameter setting START step is activated 2 When the block START instruction SFC control instruction is executed At all other blocks other than block 0 3 When the block information register s block START END bit is forced ON 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA 4 3 Transition Condition A transition condition is the condition which must be satisfied in order for processing to proceed to the next step 4 3 1 Serial transition Serial transition is the transition format in which processing proceeds to the step immediat
25. H execution occurs in a 1 step per scan format Block END processing occurs at the 3rd scan and the block becomes inactive 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 1 Transition processing for continuous transition ON setting The SFC program processing procedure for a continuous transition ON setting is shown below 1 Active step n ladder operation Y10 n Xo 2 Transition condition satisfied unsatisfied check Fi n 1 Y1 When transition condition When transition condition is unsatisfied is satisfied v 3 END processing 3 The active step n is deactivated and the coil If other blocks exist subsequent the block where the OUT instruction is ON is switched OFF in question END processing will be executed ns those blocks have been processed 4 Step n 1 is activated and its ladder operation occurs Vv 4 Ladder processing for the same step n as that at the previous scan re d SS d H 5 Transition condition satisfied unsatisfied check 6 Subsequent processing is executed in a continuous manner up to a step with an unsatisfied transition condition 7 END processing If other blocks exist subsequent the block in question END processing will be executed after those blocks have been processed 8 Ladder operation is executed for the step activated by the satisfied condition at the previous scan e END processing occurs following the e
26. Number of steps 1 Description e Indicates the SFC program START Required Number of Steps 1 per program SFCP END instruction SFCPEND Number of steps 1 e Indicates the SFC program END 1 per program Block START instruction BLOCK BLm Number of steps 1 e Indicates the block START 1 per block Block END instruction BEND Number of steps 1 e Indicates the block END 1 per block STEP e Number of steps 2 e Indicates the step START DI varies according to the step attribute 1 per step IRAN TR Number of steps 2 e Indicates the transition START i varies according to the step attribute 1 per transition condition TAND Si Number of steps 2 e Coupling completed check occurs at parallel coupling Number of parallel couplings 1 per parallel coupling Transition designation instruction TSET Si Number of steps 2 e Designates the transition destination step For serial transitions and selection transitions 1 per transition condition for parallel branching transitions the number of steps is the same as the number of parallel couplings Step END instruction SEND Number of steps 1 e Indicates the step transition END 1 per step 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 SFC PROGRAM CONFIGURATION The SFC program symbols control instructions and information registe
27. OFF or reset the SFC program s STOP position will be maintained HOLD but the statuses of the devices used at the operation outputs will not Therefore a latch setting must be designated for devices where a HOLD condition is required in addition to execution of a resumptive START 2 When the PLC power is turned OFF or reset the coil HOLD steps SC become inactive Thus they do not remain continuously held 3 The special function module is initialized when a PLC power OFF or reset occurs Initial programs for the special function module should be created at constantly active blocks or programs other than SFC programs 4 After making SFC program changes SFC diagram modifications such as step additions or deletions etc while a resumptive START setting is in effect switch to an initial START setting then back to the resumptive START setting in order to register the changes Failure to do so will result ina START executed from the pre change step number causing a mechanical system malfunction 5 If a CPU reset occurs during SFC program execution with a resumptive START format an initial START status may be designated when the system is restarted due to the reset being interpreted as a resumption disabled condition 6 SFC PROGRAM EXECUTION 6 2 Block START and END 6 2 1 Block START methods MELSEC QnA The block START methods during SFC program execution are described below
28. QnA Series of General Purpose Programmable Controllers Before using the product please read this manual carefully to develop full familiarity with the functions and performance of the Programmable Controller Q Series Q mode QnA Series you have purchased so as to ensure correct use CONTENTS 1 GENERAL DESCRIPTION 1 1to 1 11 1 1 Description Of SFC Program 1 2 12 SECAMELSAPS Features a e aa veer e vg Eeer Eeer 1 4 2 SYSTEM CONFIGURATION 2 1to2 2 Ia SPECIFICATIONS 3 1 to 3 10 3 1 Performance Specifications Related to SFC Programs ssesesesssesisssisissnsrsrnsrsrnrsrsrsrusesrnsnsrnrnsrsnnnns 3 1 SEENEN 3 3 3 3 Processing Time for SFC Program cccceseesceecceceeseeeececeeceeaecaecaeseaeeaecaeseaeeaeeaesaeeeaseaesaeseseateaesaeseaseateas 3 5 3 4 Calculating the SFC Program Capacity ccccecceccesessecseceseeseeeceeceeeeaesaeceeeeeeseseeseeesaesaeseeseaeeaesaeseeeeaeeaes 3 9 4 SFC PROGRAM CONFIGURATION 4 1 to 4 74 4 1 Listof SFC Diagram SymMBOIS aysor ete aa ett dE dE ae a aaa aa aa a E E 4 2 RE 4 4 Sep Tree en entities denice ere mide enna 4 4 EE e oN cee asad cen rch See te ice A are NL De AN Oe Sele Ne Nee es Be ese 4 6 AOS RE lu Sta i EE 4 6 4 24 Coil OED step SE EE 4 7 4 2 5 Operation HOLD step without transition Check t 4 9 4 2 6 Operation HOLD step with transition check 4 11 E EE 4 12 4 2 8 Block START step with END check Egeter 4 13 4 2 9 Block START step wit
29. SFC block STOP instruction processing will occur as follows e STOP status timing A STOP status is established after the block STOP request output occurs and processing returns to the beginning of the block in question e Coil output A coil output OFF or HOLD status will be established depending on the output mode setting see Section 4 7 3 at the time of the block STOP designated in the SFC operation mode However an ON status will be maintained for coil outputs which were switched ON by the SET instruction 1 When the transition condition immediately prior to a given step is satisfied or if the step has been reactivated by a JUMP instruction the step transition will occur again when the transition condition is satisfied 2 Double STARTs do not apply to reactivated steps 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 2 6 Operation HOLD step with transition check An operation HOLD step with transition check is a step where operation output ladder processing continues even after a transition to the next step with the next step being reactivated when the transition condition is again satisfied 1 During normal SFC program operation the coil ON status switched ON by OUT instruction when transition condition is satisfied is automatically switched OFF before proceeding to the next step By designating an operation output step as an operation HOLD step with transition check that step will remain active e
30. START e After block processing is ended the condition is designated as auto block remains inactive until a START OFF START request occurs by one of the methods described in Section 6 2 1 Blocks other than block 0 blocks 1 to 319 FC PR RAM EXECUTION GENEE GH MELSEC QnA 6 3 Block Temporary Stop amp 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 e Using an SFC control instruction a specified Convenient for temporarily stopping operation block is temporarily stopped ee a SFC at error detection etc in order to correct the program step operation output or from error by manual operation Block STOP by SFC another sequence program SES EEN Sondition Fass ge The manual operation control program can Gel PAUSE BLm Ze F be placed at another block which is forcibly m is the block No started when the block STOP occurs e A specified block is temporarily stopped by forcing the block START END bit ON from a program or a peripheral device The block START END bit is designated at each block as an SFC information register e Convenient for confirming operation by step control at debugging and test operations because block processing can b
31. Step START activate mebode A 6 8 6 4 2 Step END deactivate Methods A 6 9 6 4 3 Changing an active step status 6 10 APPENDIX 1 SPECIAL RELAY AND SPECIAL REGISTER LIST 0 eceeceeceeceeseeeeeeeeeeeeeeeeeeteaeeatens APP 1 UE APP 1 1 2 SD Special Registers AAA APP 4 APPENDIX 2 MEL GAP I AND MELSAP3 COMPARISON sssssseseseeseeeeseeiesesrssersrssnsrsrnsrsrnsrsrnsrsrsrnsnss APP 6 About the Generic Terms and Abbreviations Related Manuals Manual Name Manual Number Model Code Windows Software package SW4D5C GPPW V E Operating Manual SFC Describes how to create SFC programs using the software package for creating SFC Option SH 080033 134964 TYPE SW2IVD NX GPPQ GPP Software package Operating Manual SFC Describes how to create SFC programs using the software package for creating SFC IB 66776 programs Supplied with the product 133923 only for QNACPU QCPU Q Mode User s Manual Function Explains Programming Fundamentals Describes the functions programming procedures and devices necessary to create the programs using QCPU Q mode Option SH 080038 13JL98 QCPU Q Mode QnACPU Programming Manual Common instruction Describes how to use sequence instructions basic instructions and application instructions Option SH 080039 13JF58 High Performance model QCPU Q mode User s Manual Function Explanation Programming Fundamentals QCPU Q mode QnACPU Pr
32. a step as a HOLD step that step will not be deactivated and processing will continue in accordance with the attribute e If the continuous transition bit at a give block is set to ON processing will proceed to the next step when the transition condition is satisfied without ending the SFC program at the end of each step s operation output CPU RUN END processing END processing SM3210N SM3210ON Initial step operation output Initial step operation Step 1 operation executed output executed output executed SFC program Block 0 Transition condition Transition condition Transition condition unsatisfied satisfied unsatisfied The continuous transition ON setting is recommended for faster tact times and step transitions A continuous transition ON setting eliminates the waiting time from the point when a transition condition is satisfied until the point when the operation output for the transition destination step is executed For further details see Section 5 2 4 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 5 2 4 Continuous transition ON OFF operation SFC program transition processing can occur with or without a continuous transition depending on whether the continuous transition bit device designated by the SFC information register is set to ON or OFF by the user e Continuous transition ON When the transition conditions for contiguous steps are all satisfied all these steps will be executed in a s
33. block number to the block number stored at the DO data register Condition MOV Kn x1 2 When X2 switches ON the following program switches the Sn or TRn block number according to the constant at the Z1 index register X2 BRSET KOZ 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 4 12 Program operation status check instruction Usable Devices Programs Using Instructions a Device MELSECNET Special Expansion i i 10 Direct SFC Program Device a User le re e i SFC Data Type Sequence 9 Register Raves axa il BLm Sn Program Transition wert BLm TRn Ste a mee a won Condition Programs Character name string ny At expansion SFC and other columns m represents the block No and n represents the step transition condition No LD Ponk Program name AND 4 H PCHK Program name PCHK Program name Function 1 Executes a check to determine whether a specified program is currently being executed 2 If the specified program is currently being executed an ON status is established as an N O contact Operation Error e Error occurs when the designated program file is not registered at the parameter s Program error No 2410 Set item Program Examples 1 The following program switches Y10 ON if the ABC QPR program is currently being executed 8 PCHK ABC QPR 10 C ne Being executed N
34. check and operation HOLD with transition check steps within that block will be reset 2 In addition to designating the step to be reset 1 step or all HOLD steps a reset step possesses the same functions as a normal step no step attributes lt n When a reset step is R n activated a specified step is deactivated reset Only HOLD steps can be reset deactivated by a reset step Resets are impossible for active HOLD steps where a HOLD status is not in effect and for steps not designated as HOLD steps 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA 4 2 8 Block START step with END check H A block START step with END check is the step to which processing proceeds when a specified block is started activated and the START destination block is deactivated 1 Multiple blocks can be started simultaneously by using a parallel transition format see Section 4 3 3 at the block START request Steps in the simultaneously started blocks will be processed in parallel 2 The block START request source is stopped at the block START request step until execution of the START destination block is completed The block START request source will then proceed to the next step 3 If a ladder exists at the transition condition which follows a block START step the step transition will occur according to the ladder s AND condition following the completion of the START request destination block operation 4 A
35. e When the designated time period beginning from the point when a specified condition is satisfied elapses the designated output device is switched ON Time check instruction TIMCHK 3 Block Step START END and STOP Methods MELSAP II MELSAP3 By SFC Diagram By Block By SFC Diagram By Block By SFC Controll Symbol Information Symbol Information Instruction Block START Block START Block without END Block active bit ON Elm START END bit PEREM SET BLm Sn ON Block START END bit RST BLm OFF Block Block STOP Block STOP bit ON STOP RESTART PAUSE BLm 8 Block Block restart Block STOP bit STOP RESTART RSTART BLm STOP cancel S Block active No S SET Sn Step START SC register at block E SET BLm Sn ransition ncel Block clear bit ON OFF IL DE GE RST Sn Step END RST BLm Sn t SET BLm TRn Forced transition RST TRn Specified by block STOP mode bit Not specified Immediate STOP immediate STOP or STOP after transition condition is satisfied APP 9 APP 9 APPENDICES MELSEC QnA 4 SFC Program Specifications MELSAP I MELSAP3 Max 124k bytes Max 58k bytes A3N A3A A3U A4U Q4ACPU main program only Max 252k bytes Q25HCPU Max 320 blocks Max of 8192 steps total for all blocks max of 512 steps per block Number of branches Max of 22 Max of 32 Max of 1280 steps total Number of concurrently Max of 1024 steps total for all blocks max of 22 for all blocks m
36. ended and deactivated from an SFC program step operation output or from another sequence program Convenient for executing a forced STOP at Condition SE emergency stops etc without regard to the operation status m is the block No Block processing is also ended when the RST BLm Sn instruction is used todeactivate all steps at a specified block e A specified block is ended by forcing the block START END bit OFF from a program or a peripheral device The block START END bit is designated at each block as an SFC information register POINTS 1 A forced end to block processing is possible using a method which is different from that used to start the block Example 1 A block started by an SFC diagram symbol H3 SFC control instruction RST BLm 2 A block started by an SFC control instruction SET BLm can be ended by forcing the SFC information register s block START END bit OFF Convenient for debugging and test operations because block processing can be ended from a peripheral device without requiring a program Block END by SFC information register EI can be ended by an 2 After block END processing is completed the block can be restarted as shown below When the block 0 START e After block processing is ended condition is designated as auto processing is started automatically START ON from the initial step Block eee When the block 0
37. g satisfied YES xy Step 5 operation output deactivated END step executed operation completed 1 For steps with attribute designations processing occurs in accordance with the attributes 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 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 on Step n n execution step n operation output A is operation output A ES Step m deactivated and processing proceeds to step Transition condition b operation output B m 1 There are no restrictions regarding the number of jump transitions within a single block 2 In the parallel transition format only jumps in the vertical direction are possible at each of the branches It is impossible to create programs with jumps to another vertical ladder of a branch or with jumps which leave a parallel branch Example Program with jump which leaves a parallel branch NG example 4 Parallel transition Example Program with vertical direction jump transition within the branch to coupling range OK example HOH The jump transition must occur within the branch to coupling range n If the transition condition jumps to its step as shown at lef
38. instructions e Block STOP instruction PAUSE BLm amp block RESTART instruction RSTART Besten See Section 4 4 7 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA 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 1 The stop timing for a block where a STOP request has occurred varies according to the ON OFF setting of the block STOP mode bit as shown below e The block is stopped immediately when the block STOP RESTART bit switches from OFF to ON or when a block STOP instruction is executed However if the block STOP RESTART bit is switched ON within the current block the STOP will occur when that block is processed at the next scan or when the instruction is executed Block STOP mode bit OFF e The block is stopped at the step transition which occurs when the transition condition for the current step active step is satisfied However the operation output will not be executed for the step Block STOP mode bit ON following the transition e When multiple steps are active in a parallel branch the STOP will occur sequentially at each of the steps as their transition conditions are satisfied Related Instructions 1 SFC information register e Block STOP RESTART bn See Section 4 5 3 2 SFC control instruction e Block STOP instruction P
39. interlock contacts would be required at the ladder Pilih ee ee ew wee ao ur C Tran J used for the headstock ADVANCE x3 XA Headstock ADVANCE y20 w i x3 x4 Headstock ADVANCE Step7 9 d 1 lt Y22 gt te SE Pat i tf lt y22 4 e ke emm Interlock contacts 1 SFC program 3 Block and step configurations can easily be changed for new control applications A total of 320 blocks can be used in an SFC program with 512 steps in each block A total of 4k sequence steps can be created in each block of the ladder diagram programs for operation outputs and transition conditions Reduced tact times as well as easier debugging and trial run operations are possible by dividing the blocks and steps so as to obtain the optimum configuration for system of units used for machine operation 320 blocks Block 0 Block 1 Block 319 Initial Initial Initial step step step Operation output program xo tf lt Y20 gt K20 lt TO gt TO m ya x1 512 steps 4 v 2k sequence steps per block for operation outputs and transition conditions 1 GENERAL DESCRIPTION MELSEC QnA 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 SO to S3 are active the step where the transition condition t4 to t7 immediately prior to the selected coupling
40. method at a double START Some of the settings are designated at the parameter file common for entire system and others at the SFC program file The SFC operation mode setting items and the resulting operations are shown below Setting Range Default Value Setting File e Designates an initial START or resumptive START when the SFC program is started Initial START resumptive START Initial START Block 0 START e Designates whether block 0 is tobe Auto START ONT Auto Auto START Parameter file condition started automatically Bee OFF Output mode at e Designates the coil output mode at a block STOP block STOP ral Coll output OFF HOLD Denar e Designates the first block No of the 0 to 319 iaf F periodic execution blocks Periodicexecution e Designates the time interval for No setting execution of the periodic execution 1 to 65535 ms SFC program Pause Wait a block range when a START request is made for a can be designated Wait block which is already active for the PAUSE settng e Designates the operation which occurs Pause Wait Transfer when a transition follow up is a step range executed to a step which is already can be designated Transfer active or when an active step is for the PAUSE started or Wait setting Operation mode at transition to active step double step START 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 7 1 SFC program START mode The SFC program START mod
41. n 1 Step n 3 operation operation output B output D Transition condition c Transition condition d Step n 2 Step n 4 operation operation output ICH output E Step n operation output A Transition condition b Step n 1 operation output B Transition condition c Waiting step Waiting step Transition condition d Step n 2 operation output C e From step n processing will proceed simultaneously to steps n 1 and n 3 when transition condition b is satisfied e Processing will proceed to step n 4 when transition condition c is satisfied and to step n 4 when transition condition d is satisfied e When transition conditions b and c are satisfied at step n and step n 1 execution steps n and n 1 will be deactivated and processing will proceed to the waiting steps e Waiting steps are used to synchronize parallel processing operations Parallel processing steps always proceed to a waiting step When condition d is satisfied at the waiting steps processing will proceed to step n 2 e Waiting steps are dummy steps which require no operation output ladder 1 Up to 32 steps can processed simultaneously with the parallel transition format Step Step n 2 n 3 Step n 32
42. of the interlock condition X0 e Transition will not occur even if the transition condition is satisfied again e Convenient for maintaining an output until the block in question is completed hydraulic motor output pass confirmation signal etc e Operation output processing continues even after a step transition occurs and xo et coil output Y10 ON OFF switching viol M occurs in accordance with the interlock condition X0 ON OFF status Transition will not occur if the transition condition is satisfied again e Convenient for repeating the same operation cylinder advance retract etc while the relevant block is active r xo e Operation output processing continues k Y10 LL even after a step transition occurs and X1 J PLS MO Transition executed Step which is active due KZ E previous transition condition being satisfied coil output Y10 ON OFF switching MO occurs in accordance with the interlock T r E Tan H condition X0 ON OFF status E e When the transition condition is again satisfied the transition is executed and the next step is activated e Operation output processing is executed at the reactivated next step When the transition condition is satisfied transition occurs and the step is deactivated e Convenient for outputs where there is an rile interlock with the next operation for example where machining is started on completion of a repeated op
43. output HOLD status will be established the first time processing occurs at the specified block and a STOP will occur e After the STOP request the coil output HOLD status will be established when the transition condition is satisfied and a STOP will occur e If multiple steps are active the STOP will occur at each of the steps in sequence as their transition conditions are satisfied e After the STOP request a coil output HOLD status will be established the first time processing occurs at the specified block and a STOP will occur e The coil HOLD step becomes inactive the first time processing occurs at the block in question following the STOP request 6 SFC PROGRAM EXECUTION MELSEC QnA 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 e Processing of the specified block is restarted by an SFC control instruction at a step operation output or sequence program outside the e Convenient for returning to automatic operation stopped block when the manual control END signal is output Condition at the temporary STOP m is the block No Restart by SFC control instruction e A specified block is restarted by forcing the e Convenient for conf
44. parallel coupling selection occurs Transition condition b Transition condition c Branch Step n 1 Step n 2 operation output B operation output ICH Step n Step n 1 operation output A operation output B Transition condition b Transition condition c e When the transition condition b or c at the Coupli executed branch is satisfied the executed step oupiing A or B will be deactivated and processing Step n 2 operation output ICH will proceed to step n 2 1 Up to 32 steps can be available for selection in the selection transition format Step n Step Step Step Steps iaut Step LJ Dn KS n 2 n 3 E n 4 E n 32 e Max of 32 steps 2 When two or more selection step transition conditions are satisfied simultaneously the left most condition will take precedence Example If transition conditions c Step n and d are satisfied simultaneously the step TI Transition Transition Transition _ Transition y x i condition b condition c condition d condition e n 2 operation output will Step Step Step Step eee na SS Re be executed za 4 SFC PROGRAM CONFIGURATION MELSEC QnA 3 The following method of coupling can be omitted when the selecti
45. relays and special registers not used at SFC program refer to the QCPU Q mode QnACPU Programming Manual Common Instructions APPENDIX 1 1 SM Special Relays Pe ve e en e Switches ON when a diagnosis result error occurs OFF normal no error 3 e System Al h N SMO Diagnosis error ON abnormal error REES at error error e Remains ON even when normal status is PE restored Step transition SM90 watchdog timer START corresponds to SD90 Step transition watchdog timer START corresponds to SD91 Step transition watchdog timer START corresponds to SD92 Step transition SM93 watchdog timer START APP corresponds to SD93 Step transition SM94 tchdog ti START i Wee GEES Switched ON to begin the step transition corresponds to SD94 reset Step transition ON Watchdog timer watchdog timer START START corresponds to SD95 Step transition watchdog timer START corresponds to SD96 Step transition watchdog timer START corresponds to SD97 Step transition watchdog timer START corresponds to SD98 Step transition watchdog timer START corresponds to SD99 watchdog timer count Watchdog timer is reset when switched OFF APP 1 APP 1 APPENDICES MELSEC QnA N OFF Name Content Description One Control OEE eRe progam e Switches ON when the SFC program status is SM320 SFC program absent ET f System parameter program settings PO presence absence ON SFC program in
46. sossar O instructions L O OA OCA A C SFC transition START CA CO COC AND Da SFC couplingcheck_ _ JL SEI SEI Designate SFC transition destination senp senD __ SFCstpenD _ o o Cid 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA 2 Sequence program for transition condition a Transition condition sequence program expression format A transition condition sequence program using the ladder expression format is shown below pena kc TRAN is a dummy output Condition b Sequence program capacity A transition condition s sequence program capacity is as follows e Max of 2k sequence steps per transition condition e Max of 2k sequence steps per block c Instructions used Instructions which can be used in a transition condition sequence program are listed below Instruction Code LD Operation START N O contact AND Serial connection N O contact OR Parallel connection N O contact Contacts LDI Operation START N C contact ANI Serial connection N C contact ORI Parallel connection N C contact LDP Leading edge pulse operation START ANDP Leading edge pulse serial connection ORP Leading edge pulse parallel connection Contacts ss LDF Trailing edge pulse operation START ANDF Trailing edge pulse serial connection ORF Trailing edge pulse parallel connection ANB Ladder block serial connection ORB Ladder block parallel connection Operation
47. 4ARCPU Generic names for Q2ASCPU Q2ASCPU S1 Q2ASHCPU Q2ASHCPU Generic names for QnNACPU High Performance model QCPU 1 GENERAL DESCRIPTION sit MELSEC QnA 1 GENERAL DESCRIPTION This manual describes the specifications functions instructions and programming procedures used to program the MELSEC Q Series High Performance model QCPU Q mode hereafter referred to as High Performance model QCPU and MELSEC QnA Series CPU hereafter referred to as QnACPU with an SFC program using the MELSAP3 function This manuanl does not refer to Qn H CPU A A mode With an SFC program using Qn H CPU A A mode please refer to MELSAP II SFC Programming Manual SFC is an abbreviation for Sequential Function Chart and represents a program format in which a sequence of control operations is split into a series of steps enabling a clear expression of the program execution sequence and execution conditions MELSAP3 conforms to the IEC standard for SFC In this manual the sequential function chart is referred to as SFC program diagram Basic model QCPU Q00J Q00 Q01CPU is not compatible with MELSAP3 When using MELSAP3 use High Performance model QCPU 1 GENERAL DESCRIPTION 2 ia MELSEC QnA 1 1 Description of SFC Program The SFC program splits a sequence of machine operations into individual steps with the detailed control which occurs at each step being represented by ladders Mac
48. 6 0 40 35 86 00 Fax 46 0 40 93 23 01 e mail info elc beijer se ECONOTEC AG Postfach 282 CH 8309 N rensdort Phone 41 0 1 838 48 11 Fax 41 0 1 838 48 12 e mail info econotec ch GTS TURKEY Dar laceze Cad No 43A KAT 2 TR 80270 Okmeydani Istanbul Phone 90 0 212 320 1640 Fax 90 0 212 320 1649 e mail gts turk net SWITZERLAND EURASIAN REPRESENTATIVES MITSUBISHI ELECTRIC EUROPE B V Moscow Representative Office 52 Kosmodamianskaya Nab bld 5 RUS 113054 Moskow Phone 7 0 95 721 2070 Fax 7 0 95 721 2071 e mail info mitsubishi electric ru NPP Uralelektra RUSSIA Sverdlova 11A RUS 620027 Ekaterinburg Phone 7 34 32 53 27 45 Fax 7 3432 53 2461 e mail elektra etel ru JV CSC Automation 15 Marina Raskovoyi St U 02002 Kiev Phone 380 44 238 83 16 Fax 380 44 238 83 17 e mail mkl csc a kiev ua RUSSIA UKRAINE AFRICAN REPRESENTATIVE Circuit Breaker SOUTH AFRICA Industries Ltd Private Bag 2016 ZAF 1600 Isando Phone 2711 928 2000 Fax 2711 392 2354 PLC12 01 Printed in Germany A MITSUBISHI ELECTRIC NDUSTRIAL AUTOMATION Gothaer Strasse 8 D 40880 Ratingen Phone 49 2102 486 0 Hotline 49 1805 000 7650 Fax 49 2102 486 7170 www mitsubishi automation de megfa mail meg mee com www mitsubishi automation com
49. A MITSUBISHI ELECTRIC MELSEC Q Programmable Logic Controllers Programming Manual SFC Instructions QCPU Q Mode QnACPU Art no 130023 A MITSUBISHI ELECTRIC INDUSTRIAL AUTOMATION 10 05 2001 SH 080041 B e SAFETY CAUTIONS e You must read these cautions before using the product When using the Mitsubishi Programmable Controller MELSEC Q QnA 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 Store carefully the manual associated with the product in a place where it is accessible for reference whenever necessary and forward a copy of the manual to the end user REVISIONS The manual number is given on the bottom left of the back cover Print Date 1 Manual Number Dec 1999 SH NA 080041 A First edition May 2001 SH NA 080041 B Partial correction Chapter 1 Section 3 1 Appendix 2 Japanese Manual Version SH 080023 B This manual confers no industrial property rights or any rights of any other kind nor does it confer any patent licenses Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property ights which may occur as a result of using the contents noted in this manual 1999 MITSUBISHI ELECTRIC CORPORATION INTRODUCTION Thank you for purchasing the Mitsubishi MELSEC Q Series Q mode and MELSEC
50. ART OFF is designated operation begins from the initial step of the block designated by another pro gram file s SFC control instruction START request 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 5 1 Overall Program Processing The overall High Performance model QCPU Q mode QnACPU program processing operation is described in this section Note that this manual describes only the outline For details refer to the user s manual of the CPU used 5 1 1 Program processing sequence The High Performance model QCPU QnACPU can store several programs in the program memory and manage them as files file execution can be designated for a specified file only or for multiple files simultaneously The overall operation format is shown below CPU RUN J 1 Initial program 2 Started only 4 when required ian Execution time monitoring Low speed program END END END processing processing processing 1 LG 2 A Initial scan 1 scan 1 scan CPU RUN e The longer of the surplus constant scanning time or the designated low speed program execution time is adopted for the low speed program 3 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA Execution Type e 1 scan only is executed at power ON or at STOP RUN switching e The WAIT program is used from that point on Initial program initial execution Scan program e File which is executed a
51. AUSE Bil mi See Section 4 4 7 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 5 5 Continuous transition bit The continuous transition bit setting determines whether the operation output of the next step is to be executed within the same scan after a transition condition is satisfied 1 As shown below SFC program transition processing occurs according to the continuous transition bit setting ON OFF designated by the user e Continuous transition ON leste eg When the transition conditions at contiguous steps are satisfied all the steps transition conditions will be executed at once within a single scan e Continuous transition OFF Assit Steps are executed in a 1 step per scan format Example Sample program processing Block n sl e Continuous transition ON j SM400 e When the block is activated all steps are processed within ce the same scan The block is then deactivated at the block END SM400 ni LJ e Continuous transition OFF When the block is activated steps are processed in a 1 step SM400 per scan format The block END step is processed at the 3rd H scan and the block is deactivated 2 A continuous transition can be designated for individual blocks by the continuous transition bit ON OFF setting or for all blocks using the batch setting special relay As shown below the continuous transition operation ON OFF varies according to the continuous transition bit and special relay SM323 setting combin
52. FUCHION SN E See Section 4 4 1 e Active step batch readout instruction MOV DMOV ceseseeeteeteeteeeeeeeetetees See Section 4 4 4 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 4 6 Block START amp END instructions SET RST Usable Devices Programs Using Instructions Execution Site l Devi i nternal Device r Special Data SFC Program 7 System User mir Function Index Constant Other Type Sequence Module Z 7 BLm Program Transition l E a wort S Device name At expansion SFC and other columns m represents the block No and n represents the step transition condition No F m is the block No 4 aa COE a _ _ rsT get Function 1 1 A specified block is independently activated forcibly and is executed from its initial step If multiple initial steps exist all the initial steps will become active If the SFC information register block START END bit setting has been designated the bit device in question will be switched ON 2 If the specified block is already active when this instruction is executed the instruction will be ignored equivalent to the NOP instruction and processing will continue 2 RST BLm 1 If the SFC information register block START END bit setting has been designated the bit device in question will be switched ON 2 If the specified block is inactive when this instruction is executed nothing wi
53. IA Sirius Trading amp Services srl ROMANIA Drvinje bb Bd Ghica nr 112 BI 41 Sc 2 ap 98 HR 10000 Zagreb Phone 385 0 1 366 71 40 Fax 385 0 1 366 71 40 e mail inea cr zg tel hr RO 72235 Bucaresti 2 Phone 40 0 1 210 55 11 Fax 40 0 1 210 5511 e mail sirius_t_s fx ro AutoCont Control CZECHIA Systems s r o Nemocnicni 12 CZ 702 00 Ostrava 2 Phone 420 0 69 615 21 11 Fax 420 0 69 615 21 12 e mail petr pustovka autocont cz DENMARK louis poulsen Geminivej 32 DK 2670 Greve Phone 45 0 43 95 95 95 Fax 45 0 43 95 95 91 e mail pia lpmail com UTU Elektrotehnika AS P rnu mnt 160i EE 11317 Tallinn Phone 372 6 51 72 80 Fax 372 6 51 72 88 e mail utu utu ee ESTONIA Beijer Electronics OY FINLAND Elannontie 5 FIN 01510 Vantaa Phone 358 0 9 615 2011 Fax 358 0 9 615 20 500 e mail info elc beijer fi MITSUBISHI ELECTRIC EUROPE B V Irish Branch Westgate Business Park IRL Dublin 24 Phone 353 0 1 419 88 00 Fax 353 0 1 419 88 90 e mail sales info meuk mee com IRELAND ACP AUTOCOMP a s Chalupkova 7 SK 81109 Bratislava Phone 421 0 7 592 22 48 Fax 421 0 7 592 22 54 e mail acp autocomp nextra sk INEA doo SLOVENIA Ljubljanska 80 SI 1230 Dom ale Phone 386 0 1 721 80 00 Fax 386 0 1 724 1672 e mail inea inea si SLOVAKIA Beijer Electronics AB SWEDEN Box 325 S 20123 Malm Phone 4
54. If multiple programs are specified the execution sequence is determined by the program setting parameter e Designates low speed execution of a specified program beginning from the next scan e If multiple programs are specified the execution sequence is determined by the program setting parameter e The following conditions will result in an operation error e When the specified program does not exist error No 2410 e At execution of the PSCAN or PLOW instruction when scanning or low speed execution of the specified program is in progress error No 2411 e When an SFC program is designated by the PSCAN instruction while scanning is in progress at another SFC program error No 2412 e The SFC control PCHK instruction can be used to check whether or not the specified SFC program is currently being executed For details regarding the PCHK instruction refer to Section 4 4 12 2 Instruction format instruction Program name I SES Character string or word device where character string is stored PSTOP POFF PSCAN PLOW 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 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 watchdog timer error detection No sys
55. Manual of the applicable CPU regarding the details of processing order and contents of processing of the programs other than SFC program FC PROGRAM EXECUTION co MELSEC QnA 6 SFC PROGRAM EXECUTION 6 1 SFC Program START And STOP The SFC program s START STOP special relay SM321 is automatically switched ON when CPU STOP RUN switching occurs and the SFC program is automatically started At other program files SFC program processing can be temporarily interrupted and restarted by switching SM321 OFF and ON CPU RUN OFF SM321 ON ON Is another program designated at the execution file D Resumptive START Initial START j SFC program execution Was SM321 switched ON or OFF at another program file OFF SFC program not executed k SFC program not executed 1 The processing which occurs when an SFC program is designated as a WAIT program by the POFF instruction is identical to that when SM321 is switched OFF 2 The processing which occurs when an SFC program scan execution status is designated by the PSCAN instruction is identical to that for a CPU RUN condition 6 SFC PROGRAM EXECUTION MELSEC QnA 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 a
56. ORATION Office Tower Z 14 F 8 12 1 chome Harumi Chuo Ku Tokyo 104 6212 Phone 81 3 622 160 60 Fax 81 3 622 160 75 MITSUBISHI ELECTRIC USA AUTOMATION 500 Corporate Woods Parkway Vernon Hills IL 60061 Phone 1 847 478 21 00 Fax 1 847 478 22 83 EUROPE JAPAN GEVA GmbH Wiener Stra e 89 A 2500 Baden Phone 43 0 2252 85 55 20 Fax 43 0 2252 488 60 e mail office geva co at AUSTRIA Getronics bv BELGIEN Getronics bv NETHERLANDS Control Systems Donauweg 2B NL 1043 AJ Amsterdam Phone 31 0 20 587 68 30 Fax 31 0 20 587 68 39 e mail info gia getronics com MIDDLE EAST REPRESENTATIVE TEXEL Electronics LTD Rehov Hamerkava 19 IL 42160 Netanya Phone 972 0 9 863 08 91 Fax 972 0 9 885 24 30 e mail texel_me netvsion net il ISRAEL Control Systems Beijer Electronics A S NORWAY Pontbeeklaan 43 Teglverksveien 1 B 1731 Asse Zellik N 3002 Drammen Telefon 32 0 2 467 1751 Phone 47 0 32 24 30 00 Telefax 32 0 2 467 17 45 Fax 47 0 32 84 85 77 E Mail infoautomation getronics com e mail info elc beijer no TELECON CO BULGARIA MPL Technology SP z o o POLAND 4 A Ljapchev Blvd ul Wroclawska 53 BG 1756 Sofia PL 30011 Krak w Phone 359 92 97 44 05 8 Phone 48 0 12 632 28 85 Fax 359 92 97 44 06 1 Fax 48 0 12 632 47 82 e mail e mail mpl krakow ipl net INEA CR d 0 0 CROAT
57. RT step 1 step 1 step 1 o 1 I 1 O I 1 Z _ Station 2 START l Drilling i Tapping Workpiece unloading block 2 START step 2 step 2 step 2 __ Station 3 START S i Pallet unclamp Pallet unclamp i Pallet unclamp block 3 START step 3 l step 3 l step 3 t END KS END step END step END step 2 Requires no complex interlock circuitry Interlock circuits are used only in the operation output programs for each step Because interlocks between steps are not required it is not necessary to consider interlocks with regard to the overall system Clamp SOL SOL2 N N LS U 4 Clamp UP endpoint gt MT1 F Ss lt MIOE gt I DOWN i EE E At amp DOWN endpoint MTO B R eeneg 1 LS D Headstock rotation GER i MT2 R Tan ON i Carriage L L 4 LS10 Headstock RETRACT Machining Machining Carriage ADVANCE endpoint START END endpoint Carriage RETRACT endpoint LSO LS1 LS2 LS F LS R 1 GENERAL DESCRIPTION MELSEC QnA i 5 Carriage ADVANCE endpoint Step5 7 7 4 es sSOY2O 4 Carriage ADVANCE X3 See es Mel C Tran J As sh in the SF i Clamp DOWN s shown in e SFC Progra at left the steps require no operation completed interlock contact with the Step6 4 lt Y21 gt L previous step With a conventional sequence program Clamp DOWN endpoint carriage FORWARD Y20 and clamp DOWN Y21 X4
58. RT instruction SET BLm and block END instruction RST Bil mi See Section 4 4 6 b SFC diagram symbols Block START step H n Ein See Sections 4 2 8 and 4 2 9 c SFC information register e Block START END fant See Section 4 5 1 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 4 4 Active step batch readout instructions MOV DMOV Usable Devices Internal Device i d Expansion Data SFC enen System U W Ti ki SCH SFC Other Type Sequence Block Step ransition il Program Condition SC AE BLm Sn EEN beste Condition PT o o BIN PT emne GEI Sn only At expansion SFC and other columns m represents the block No and n represents the step transition condition No E Readout instruction p n is the step No p m is the block No n is the step No k moviP k4Sn L Mov P BLm k4Sn _ I _ pmov P tege DMOV P BLm K8Sn _ Function 1 Executes a batch readout of the operation statuses active inactive of steps in a specified block 2 The readout results are stored at the OD device as shown below b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 bi Pae aA T TN 8 gt ae designated at Sn Sn step 15 Sn step 1 0 Step in question is inactive 1 Step in question is active 3 If the step in question i
59. ST Sn ki RST d ET TRn ki ET RST TRn k RST BRSET 4 SFC PROGRAM CONFIGURATION MELSEC QnA Name Ladder Expression Function e When the instruction execution condition is ON the subroutine call is executed in a constant manner When it is switched OFF the subroutine call occurs only once at that time Program operation status check LD AND OR PCHK Program name e A check occurs to determine if a specified instruction program is being executed When the designated time period beginning Time cheek instu tan from the point when a specified condition is satisfied elapses the designated output device is switched ON x1 The block designated by the block switching instruction BRSET becomes subject to the instruction The default setting is block 0 or all blocks see Section 4 4 11 k2 Use is permitted only at steps with SFC programs An error will occur if used at steps with other sequence programs Subroutine call instruction 4 31 4 31 4 SFC PROGRAM CONFIGURATION MELSEC QnA 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 Programs Using Instructions Execution Site MELSECNET Internal Device i Special File 10 Direct P Expansion SFC Program SW Sequence Transition Block Step D Condition Usable Devices S t U te Kate System User mari SFC Register
60. Step n Ion H PLs Yo H inactive the PLS or P instruction will be executed when the step becomes active even though the execution condition contact is always ON Step n 1 L Step conditions When active ON T contact When inactive OFF Always ON H c rs Yo H Leading edge CH and trailing edge CX PLS instructions are executed in the same manner as the PLS P instructions described above 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA 4 2 2 Initial step The initial step represents the beginning of a block Up to 32 initial steps per block can be designated Initial step processing occurs in the same manner as other steps 1 When multiple initial steps are used the step statuses active inactive are determined by the block START request as shown below e Start by block START step e When an initial step is At SFC Program START e Start by block START designated by a step SET SM321 instruction SET BLm START instruction SET e Start by block START END BLm Sn bit Block 0 All steps active All steps active Only designated step is active 2 Processing of initial steps with attributes occurs in the same manner as for other steps For further information see Sections 4 2 4 to 4 2 7 REMARK e Refer to section 4 3 5 for details regarding transition processing when multiple initial steps are used 4 2 3 Dummy step X A dummy step is a waiting step etc which contains no operation
61. U Q Mode ae of active step transition 10 0 us conditions Processing of Without a HOLD 44 2 19 1 tranismon With a HOLD step conditions are designation satisfied esig SFC END At initial START processing At resume START 2 QNACPU Q4ACPU Item Q4ARCPU Q3ACPU e Q2ASHCPU S1 Active block processing 103 3 us Inactive block processing Nonexistent block processing 14 5 us 19 3 us 108 0 us 144 0 us Processing of active step transition 19 0 us 25 3 us Processing of Without a HOLD 42 4 112 steps where step designation 0 us 84 0 us 0 us With a HOLD step conditions are i i designation satisfied SFC END 2 7 HOLD steps include both coil Alesie START steps and operation HOLD steps with or without transition checks 3 SPECIFICATIONS MELSEC QnA Example of SFC system processing time calculation Using the Q4ACPU as an example the processing time for the SFC system is calculated as shown below given the following conditions e Designated at initial START e Number of active blocks 30 active blocks at SFC program e Number of inactive blocks 70 inactive blocks at SFC program e Number of nonexistent blocks 50 number of blocks between 0 and the max created block No which have no SFC program e Number of active steps 60 active steps within active blocks e Active step transition conditions 60 e Steps with satisfied transition conditions 10 active steps no HOLD steps wit
62. UT C instruction is used If the execution conditions for the counter at step n are already ON when transition condition m is satisfied the counter s count will increase by 1 when step n becomes active ene If X10 is already ON at step n while step n 1 is active the counter s CO count will increase by 1 Step met when the transition to step n occurs after transition Transition condition m is satisfied condition m x10 K10 Step n Ir IH If a transition to the next step occurs before the counter is reset the counter s present value and the contact ON status if ON will be maintained even after step n becomes inactive In order to reset the counter at another step an RST instruction etc will be required When the counter CO is reset at step n 1 or Example X10 K10 subsequent step the present value will be cleared SCH eats a COF and the contact will be switched OFF Transition condition m SM400 Step n H RST 2 When a PLS or _ P instruction is used at a step s operation output the instruction will be executed when the step s status changes from inactive to active even though the execution condition contact is always ON The ladder shown above is actually executed as shown below Because the step conditions contact is Example Always ON ON when the step is active and OFF when the step is
63. active the N O contact instruction switches the contact ON and the N C contact instruction switches the contact OFF 3 To designate a step in the current block use SN To designate a step in another block or to execute an instruction by the sequence program use BLm Sn 4 If the step in question does not exist in the SFC program it will remain OFF 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA Program Examples 1 The following program switches Y20 ON when the operation status of step 5 in block 3 is checked and found to be active Designating a step within the current block 5 Y20 Designating a step in another block BL3 S5 Y20 2 The following program executes a step synchronously with another step of a parallel branch 33 56 SI 20 Interlock ii E S20 Related Instructions 1 SFC control instructions e Block switching instruction DPRGET See Section 4 4 11 e Step control instruction CHOCO See Section 4 4 10 e Active step batch readout instruction MOV P DMOV P BMOV P nossen See Section 4 4 4 Section 4 4 5 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 4 2 Forced transition check instruction Usable Devices Programs Using Instructions Execution Site Internal Device i Expansion Data SFC Program System User r 3 S Other Type Sequence iti S Ea ma Program iti Si BLm TRn Transition a wort D
64. active steps 6 steps 2 to 4 6 to 8 Number of transition conditions 02 0 6 transition conditions 2 to 4 5 to 7 Number of steps with satisfied transition conditions GE ocho SEAN dE EE Ee 4 steps 2 3 6 7 PECIFICATION isla Sa MELSEC QnA 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 1 Method for calculating the SFC program capacity block 0 capacity block 1 capacity block n capacity Number of blocks being used max created SFC program capacity 2 l 8 x block No 1 SFC file header capacity SFC program START SFCP and END SFCPEND instructions operation output total for all steps number of steps where SFC diagram is total number of transition conditions E l exparessed by SFC dedicated instructions x As shown below Block START BLOCK BLm and END BEND instructions x Number of steps where SFC diagram is expressed by SFC dedicated instructions Step L H E 3 sequence steps for step START STEP Sn and END SEND instructions e Transition conditions 1 For serial transition or selective branching coupling 4 sequence steps for transition START instruction TRAN
65. ailures in Mitsubishi products damages and secondary damages caused from special reasons regardless of Mitsubishi s expectations compensation for accidents and compensation for damages to products other than Mitsubishi products and other duties 5 Changes in product specifications The specifications given in the catalogs manuals or technical documents are subject to change without prior notice 6 Product application 1 In using the Mitsubishi MELSEC programmable logic controller the usage conditions shall be that the application will not lead to a major accident even if any problem or fault should occur in the programmable logic controller device and that backup and fail safe functions are systematically provided outside of the device for any problem or fault 2 The Mitsubishi general purpose programmable logic controller has been designed and manufactured for applications in general industries etc Thus applications in which the public could be affected such as in nuclear power plants and other power plants operated by respective power companies and applications in which a special quality assurance system is required such as for each Japan Railways company or the Department of Defense shall be excluded from the programmable logic controller applications Note that even with these applications if the user approves that the application is to be limited and a special quality is not required application shall be possible When consider
66. all blocks Fixed Network No P to J239 nee No to UFF Decimal constant constant K 2147483648 to K2147483647 Po Hexadecimal HO to HEFFFFFFF constant Constants Real number E 1 17549 38 to Et 3 40282 38 constant Character string ABC123 etc constant PECIFICATION daca alles MELSEC QnA 3 3 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 The processing time for the SFC program comprises the processing time for operation outputs and transition condition instructions and the system processing time SFC program Operation output transition condition r system processing processing time instructions processing time time a Processing time for operation output amp transition condition instructions condition instructions for operation output for transition conditio Operation output transition Processing time Processing time x2 n processing time instructions instructions Only when transition condition is satisfied e Processing time for operation output instructions Total processing time for instructions used for operation outputs at all active steps e Processing time for transition condition instructions Total processing time for instructions used for transition conditions at all active steps For details regarding the processing times for operation outputs and transition condition instructions
67. ation jal Rel e a l e Special Relay Continuous Transition Bit Status SFC Program Operation Status h Continuous transition bit OFF e Operation occurs without continuous transition eher e No continuous transition bit e No continuous transition bit setting e Operation occurs with continuous transition e Continuous transition bit ON e SM323 OFF e No continuous transition bit setting je Operation occurs without continuous e Continuous transition bit OFF transition To shorten tact time a continuous transition ON status is recommended in order to speed up the step transitions This will eliminate the waiting time from the point when a transition condition is satisfied until the point when the transition destination step s operation output is executed 4 SFC PROGRAM CONFIGURATION MELSEC QnA 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 D 1171177 Number of steps 2 The number of active steps value includes normal active steps coil HOLD steps operation HOLD steps with transition check and operation HOLD steps without transition check 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 6 Step Transition Watchdog Timer The step transition watchdog timer is a check function which monitors the time from the point when execution o
68. atus check at SFC program is executed is stored SD816 Status check execution Status check execution SD817 Status check execution Status check execution Valid only when SM816 is ON APP 5 APP 5 ENDICE SE MELSEC QnA APPENDIX 2 MELSAP II AND MELSAP3 COMPARISON Compared to MELSAP II the improved MELSAP3 has additional functions which facilitate the use of SFC programs MELSAP II and MELSAP3 are compared below MELSAP3 improvements and added functions 1 SFC program control by instructions Using SFC control instructions at a sequence program the SFC program status can be checked and blocks steps can be forcibly started and ended 2 Expression of SFC program as a sequence program ladder list is possible SFC programs can be expressed as ladders or lists and step and transition condition programs timer T and counter C setting values etc can be revised at the Q6PU 3 Additional step attributes MELSAPS offers many more step attributes such as the operation HOLD step reset step block START step without END wait etc Moreover machine control by SFC program has been made easier by improvements such as the step follow up function activates multiple steps in a series within a single block and a control function which allows transitions at block START requests without waiting for a block END status at the START destination block asynchronous control of the START source and destination blocks
69. ax of 256 active steps steps per block steps per block including HOLD steps N f i Max of 2k steps per umber OF operation Max of 255 sequence steps Ke ps p output sequence steps block no limit per step Number of transition condition sequence steps Step transition watchdog timer function Function exists 8 timers Function exists 10 timers Number of blocks Max 256 blocks Number of SFC steps Max of 255 steps per block SFC program Max of 2k steps per Max of 255 sequence steps block no limit per step 5 System Processing Times for CPU Types MELSAP II MELSAP3 ETA AnNCPU F Q4ACPU QnHCPU muepy ATSCPU Q2ASHCPU Active block processing 260 0 us Inactive block processing 14 0 us 45 0 us 10 2 us 10 8 us Nonexistent block processing 25 0 us 355 0 us 24 5 us Processing of transition condition at active step 100 0 us Without HOLD step Processing of step with 17 0 us 60 0 us 42 0 us 44 2 us 19 1 us satisfied transition condition With HOLD step designation With initial START 28 5 us SFC END processing With resumptive 285 0 us 72 3 us 76 0 us 32 8 us START 195 0 us APP 10 APP 10 WARRANTY Please confirm the following product warranty details before starting use 1 Gratis Warranty Term and Gratis Warranty Range If any faults or defects hereinafter failure found to be the responsibility of Mitsubishi occurs during use of the product within th
70. cluded in the SFC program readout results are as follows e When the block in question has the last step number S10 but S5 and S8 are missing 1 When K4SO is designated b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 bi b0 0 1 0 1 O 0 1 0 1 O O 1 O 1 0 1 0 1 0 1 These out of range steps are not defined 0 indicates the non existence of steps 2 When BLm SO is designated b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 bi b0 0 o 0 0 on fon o onon 0 0 1 0 on fonfon ka CH X All out of range steps take on 0 0 indicates the non existence of steps Program Examples 1 When XO switches ON the following program executes a 3 word readout beginning from DO of block 3 active step statuses Designating a step within the current block xo BmovP K4S0 Do K3 7 Designating a step in another block X0 8 _ BMOVP BL3 S0 sal b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 bi DO S15 S14 S13 S12 S11 S10 S9 S8 S7 S6 S5 S4 S3 S2 S1 SO D1 Step Nos S31 S30 S29 S28 S27 S26 S25 S24 S23 S22 S21 S20 S19 S18 S17 S16 D2 S47 S46 S45 S44 S43 S42 S41 S40 S39 S38 S37 S36 S35 S34 S33 S32 Related Instructions 1 SFC control instructions e Block switching instruction DPRGET See Section 4 4 11 e Step operation status check INSt
71. cribed in this section 3 1 Performance Specifications Related to SFC Programs Performance specifications related to SFC programs are shown in table 3 1 below Table 3 1 Performance Specifications Related To SFC Programs x2 Step trace function memory card required Se QO02CPU QO2HCPU QO6HCPU one Q25HCPU Q2ACPU Q2ACPU S1 Q4ACPU Q2ASCPU Q2ASCPU S1 Q3ACPU Q4ARCPU Q2ASHCPU Q2ASHCPU S1 Capacit Max 28k Max 60k Max 92k Max 124k Max 252k saan steps steps steps steps steps Number of files 1 file number of scannable files 1 Number of blocks Max of 320 blocks 0 to 319 Max of 8192 steps for all blocks Number of SFC steps 512 steps per block Max of 1280 steps for all blocks including HOLD steps 256 steps per block Number of operation output Max of 2k steps per block sequence steps no per step restrictions Number of transition conditions Max of 2k steps per block sequence steps no per transition condition restrictions Number of concurrently active steps Designated step break Number of cycles 1 to 255 times 1 block designation Continue from designated step 1 point designation at specified step Forced block execution 1 block designation block designation 1 to 48k bytes per block 1k byte units Max of 12 blocks Trigger step 1 step per block Execution conditions Per scan or per designated time Step transition watchdog timer function Equipped with 10 timers 1 Cr
72. ctivated by the methods shown below Step START SC e The step is automatically started activated when the preceding transition condition is satisfied Step START by SFC Condition diagram symbol E TRANCI START occurs when transition condition is satisfied e Basic SFC program operation e Using an SFC control instruction a specified step is forcibly started from an SFC program step operation output or from another sequence program e Jumps to other blocks are possible Condition e If the block where the specified Sn H destination step is located is inactive a forced block START will occur e When multiple initial steps exist a Condition __ BLm Sn H selection START will occur m is the block No n is the step No Step START by SFC control instruction is the step No 2 Operation at double step START When a double step START occurs for a step which is already active operation varies according to the START method as shown below a Double START by SFC diagram symbol Operation varies according to the transition to active step block parameter setting for the block in question e When PAUSE setting is designated A T E E E E A CPU operation error occurs and CPU operation is stopped e When WAIT setting is designated E EE The previous step is deactivated and a WAIT status is established EE The transition occurs when the transiti
73. dog timer is shown below Time setting 10 x1 sec 10 secs MOVP H010A SD90 Step where time RES ENEE Annunciator F No EI monitoring occurs _ Transition SM90 HO10A condition a 10 sec Ia F1 annunciator a As shown above the special relay switches ON at the operation output of the monitored step and the time count begins 4 SFC PROGRAM CONFIGURATION MELSEC QnA b If transition condition a at the step in question is not satisfied within the designated time 10 secs after SM90 switches ON the F1 annunciator will switch ON However SFC program operation will continue c If transition condition a is satisfied within the designated time SM90 will switch OFF the time count will stop and the timer will be reset 5 Even if the annunciator FO to F255 switches ON the annunciator s ON detection count and the annunciator number will not be stored at SD62 SD63 or SD64 to SD79 6 The same step transition watchdog timer can be used at more than one step provided that the steps are not concurrently active Example 4 5 Watchdog timer 1 As there is no chance that steps 5 and 6 will be a concurrently active the same watchdog timer can be 6 Watchdog timer 2 used at both steps 6 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 7 SFC Operation Mode Setting The SFC operation mode setting is used to designate SFC program START conditions or to designate the processing
74. e effective control method 2 Functions controlled by a given control method can be canceled by another control method Example For block START An active block which was started by the SFC diagram H m method can be ended forced end by an SFC control instruction RST BLm or by switching the SFC information register s block START END bit OFF 7 A sophisticated edit function simplifies editing operations A same screen SFC diagram operation output and transition condition ladder display features a zoom function which can split the screen 4 ways right left upper lower to simplify program cut and paste operations Moreover advanced program edit functions such as the SFC diagram or device search function etc make program creation and editing operations quick and easy 1 GENERAL DESCRIPTION MELSEC QnA 8 Displays with comments for easy understanding Comments can be entered at each step and transition condition item Up to 32 characters can be entered waiting for start S Wait ste 2 9 An automatic scrolling functions enables quick identification of mechanical system trouble spots Active execution blocks and steps as well as the execution of operation output transition condition ladders can be monitored by a peripheral device with automatic scrolling function This monitor function enables even those with little knowledge of sequence programs to easily identify trouble spots 1 10 1 10
75. e following devices are used for this instruction Condition TIMCHK 8 za Device switched ON at time up Lt where measurement set value is stored Device where measured present value is stored Measurement execution condition 3 When the measurement execution condition switches ON the device switched ON by the measured present value and the time up status switches the monitor execution condition OFF Or if the transition condition is satisfied the status is held When the present value is cleared to 0 or the device which was ON switches OFF the measurement execution condition will either switch ON again or the program will be reset Program Examples 1 The following is a program where the X0 ON time setting is 5 seconds with the present value stored at device DO and with device Y10 switching ON when time up occurs XO _ TIMcHK Do K50 og 8 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 5 SFC Information Registers The SFC information registers designated at each block are described in this section In cases where SFC information register functions are not required there is no need to designate the register settings when creating the SFC program The absence of register settings will not affect SFC program operation The devices which can be used for each of the SFC information register types and functions are shown below SFC Information Registers Usable Devices
76. e gratis warranty term the product shall be repaired at no cost via the dealer or Mitsubishi Service Company Note that if repairs are required at a site overseas on a detached island or remote place expenses to dispatch an engineer shall be charged for Gratis Warranty Term The gratis warranty term of the product shall be for one year after the date of purchase or delivery to a designated place Note that after manufacture and shipment from Mitsubishi the maximum distribution period shall be six 6 months and the longest gratis warranty term after manufacturing shall be eighteen 18 months The gratis warranty term of repair parts shall not exceed the gratis warranty term before repairs Gratis Warranty Range 1 The range shall be limited to normal use within the usage state usage methods and usage environment etc which follow the conditions and precautions etc given in the instruction manual user s manual and caution labels on the product 2 Even within the gratis warranty term repairs shall be charged for in the following cases 1 failure occurring from inappropriate storage or handling carelessness or negligence by the user Failure caused by the user s hardware or software design 2 Failure caused by unapproved modifications etc to the product by the user 3 When the Mitsubishi product is assembled into a user s device failure that could have been avoided if functions or structures judged as necessary in the legal
77. e setting determines whether an SFC program START SM321 OFF ON is executed by an initial START or by a resumptive START from the preceding execution status 1 Settings and corresponding operations The SFC program START format can be designated as an initial START or a resumptive START As shown below the operation which occurs depends on the parameter and special relay SM322 setting combination SM 322 status 1 Operation description Initial Se ON OFF e Initial START default e When auto START ON is designated for block 0 Block Ois executed from its initial step e When suto START OFF is designated for block 0 The block started by the SFCcontrol block Resumptive START START instruction is executed from its initial step e Resumptive START A resumptive START is executed from the previous active status 2 x1 When CPU STOP gt RUN switching occurs SM322 is switched OFF or ON in accordance with the parameter setting OFF if an initial START is designated and ON if a resumptive start setting is designated x2 The previous active status is the status which was active when SM321 was switched OFF during SFC program execution or when a CPU reset or power OFF occurred 4 7 2 Block 0 START condition The block 0 START condition setting determines whether block 0 is automatically started and activated when an SFC program START occurs SM321 OFF ON 1 Settings and co
78. e stopped from a peripheral device without requiring a program Block STOP by SFC information register 2 Block STOP timing amp 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 Status of Operation Description Output Mode Output Setting Mode s at Parameter Special Block STOP Status of Block STOP Active Step Other Active HOLD Stel Mode Bit than HOLD Step p OFF or no e After the STOP request the coil output will be switched OFF the setting first time processing occurs at the specified block and a STOP will immediate stop occur e After the STOP request the coil OFF output will be switched OFF when _ e After the STOP request the coil output ON the transition condition is satisfied coil output will be switched OFF and a STOP will occur OFF the first time post transition STOP e If multiple steps are active the processing occurs at the STOP will occur at each of the steps specified block and a in sequence as their transition STOP will occur conditions are satisfied 6 SFC PROGRAM EXECUTION Status of Output Mode Output Setting Mode s at Parameter Special Block STOP ON Coil output HOLD Status of Block STOP Mode Bit ON post transition STOP MELSEC QnA Operation Description Active Step Other than HOLD Step Active HOLD Step e After the STOP request a coil
79. eactivated from an SFC program step operation output or from another sequence program END by SFC control e instruction RST Sn e Step resets at other blocks are also possible H e If all the block s steps are deactivated by the reset processing of that block will be ended n is the step No Condition SET BLm Sn S m is the block No n is the step No 6 SFC PROGRAM EXECUTION MELSEC QnA 6 4 3 Changing an active step status The method for deactivating an active step and activating a specified step is shown below Change Method Operation Description e Active SFC program steps instruction execution Convenient when jump destination varies steps are deactivated and a forced START is according to the condition executed for a specified step e The change destination step must be located in the current block Conditi Change by SFG EI bereest e Indirect designation DO K4MO etc of the control instruction ere change destination step is also possible e If multiple instructions exist in a single step the Active step Specified step change destination executed in the same scan deactivated gt is activated will be effective APPENDICES MELSEC QnA 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
80. eation of 1 separate SFC program for program execution management is possible see Section 5 1 3 x2 This function is executable when a GPPQ is used as a peripheral device for QnACPU only 3 SPECIFICATIONS MELSEC QnA The relationship between the CPU memory s program capacity and the number of files is shown below To execute an SFC program which is in the wait status switch the SFC program being scanned to the wait status then scan the program in question Multiple program files possible no SFC programs Multiple program files possible f 1 SFC program only Multiple program files possible multiple SFC programs OK Multiple program files possible no SFC programs eThe program capacity varies according to the CPU types as shown below For further information see the CPU s User s Manual Detailed 3 SPECIFICATIONS MELSEC QnA 3 2 Device List Devices which can be used for the SFC program s transition conditions and operation outputs are shown in table 3 2 below Table 3 2 Device List User Classification Device Type Expression Assign Remarks ment Argument input Bit FXO to FX15 f i f e Sub routine with argument Argument output FYO to FY15 Fixed Argument e Sub routine with argument Word FDO to FD4 register 1 point 4 words Special relay Bt SMO to SM2047 Special register Wora Po to SD2047 O Input relay XO to X1FFF e Direct processing at
81. ely below the current step when the transition condition is satisfied e When transition condition b becomes satisfied at step n Step n operation output A operation output A execution operation output A will Transition condition b be deactivated and processing will proceed to step n 1 Step n 1 operation output B operation output B 1 A maximum of 512 serial transition steps C L per block are possible representing 512 serial transitions When SFC display column When SFC display setting is 1 or 2 column setting is n Max of Max of 1536 lines 512 serial transitions Number of lines Yy SC Examples of the permissible number of lines corresponding to a few SFC display column setting values are shown below The SFC dis play column setting value can be designated E freely within a 1 to 32 range Number of columns max of 32 SFC Display Col Number of Lines umn setting Possible ae 1336 Numberot ines S SFC display column setting value n 384 192 138 108 96 4 SFC PROGRAM CONFIGURATION MELSEC QnA 2 Serial transition operation flowchart Operation status Initial step Transition condition a U Initial step operation output executed Step 1 Transition condition b Transition condition a
82. eration workpiece transport etc 1 GENERAL DESCRIPTION MELSEC QnA Reset step R ES e 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 uestion Din E the reset step is q activated a designated step will become inactive e Types of block START steps and their operations 1 Block START step with END check H m m e In the same manner as for a subroutine CALL RET a START source block eg transition will not occur until the end of the START destination block is reached Convenient for starting the same block several times or to use several blocks together etc e A convenient way to return to the START source block and proceed to the next process block when a given process is completed in a processing line for example 2 Block START step Without END check E3 m m e Even if the START destination block is active a START source block transition SE will occur if the transition conditions for the block START step are satisfied At such times processing of the START destination block will be continued to the block END e By starting another block at a given step the START destination block can be controlled independently and asynchronously with the START source block until processing of the curre
83. evice name At expansion SFC and other columns m represents the block No and n represents the step transition condition No TRn 4 n is the transition condition No BLm TRn m is the block No n is the transition LD TRn HC gt LD BLMTR e jH condition No C TRn BLm TRn LDI TRn E D 4H LDI BLm TRn TRn BLm TRn AND TRn c H Li AND BLm TRn TRn BLm TRn ANI TRn C ANI BLm TRn H OR TRn OR BLm TRn TRn BLm TRn ORI BLm TRn TRn BLm TRn ORI TRn Y Function 1 Check whether or not the specified transfer conditions for the specified blocks are set at forced transfer by the SET BLm TRn 2 If a forced transition is designated at the transition condition in question the N O contact instruction switches the contact ON and the N C contact instruction switches the contact OFF 3 To designate a step in the current block use TRn To designate a step in another block or to execute an instruction by the sequence program use Dm Pr 4 If the transition condition in question does not exist in the SFC program it will remain OFF 4 SFC PR RAM NFI RATION E OA MELSEC QnA Program Examples 1 The following program switches Y20 ON when a forced transition is designated for transition condition 5 at block 3 Designating a transitio
84. f a step begins until the point when transition to the next step occurs to determine whether the transition occurred within the preset time period If transition to the next step fails to occur within the designated time period a preset annunciator F switches ON 1 The preset time period and the annunciator F ON when time over status occurs device number are designated at special relays SD90 SD99 The step transition watchdog timer operation begins when these special relays switch ON at the operation outputs of the monitored steps If the SM90 SM 99 special relays switch OFF while a time count is in progress the time count will be stopped and the timer will be reset 2 There are a total of 10 watchdog timers in the SFC program The special relay and special register allocations for each watchdog timer are shown below Watchdog Watchdog Watchdog Watchdog Watchdog Watchdog Watchdog Watchdog Watchdog Watchdog Timer 1 Timer2 Timer3 Timer4 Timer5 Timer6 Timer7 Timer8 Timer9 Timer 10 is even awa awe sMm93 smo4 sMm95 zwee ug Smos zwee Special ister S090 Sb91 Spee sm sD94 apos spss ster so sD99 3 The setting method at special registers SD90 SD99 is shown below pipe be eg Time setting 1 to 255 setting value x1 sec Annunciator F ON when time over status occurs device No setting 0 to 255 4 The method for using a watch
85. f the RST instruction is executed at a step located in a parallel branch the parallel coupling condition will remain unsatisfied 4 If a specified step is already inactive when this instruction is executed the instruction will be ignored equivalent to the NOP instruction Operation Error e When no specified step is present or the SFC program is in standby mode Error No 4631 Program Examples 1 When X1 switches ON the following program will select and start step 2 of block 1 which contains multiple initial steps Program 1 Designating a step within the current block X1 SET S2 I Designating a step in another block X1 2 The following program deactivates step 5 HOLD step when step 10 is activated SE S5 s10 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 4 9 Forced transition EXECUTE amp CANCEL instructions SET RST Usable Devices Programs Using Instructions Execution Site Internal Device i Expansion Data SFC Program be System User r h tani H my SFC ouer Type Sequence ene oui el Ee Bit Word Step Condition aaa ee eee name At expansion SFC and other columns m represents the block No and n represents the step transition condition No n is the step No i BO tmn H i RSTO m HH m is the block No SETO Baal RSTO BLm TRn Function 1 SET 1 A
86. fie 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 5 3 Block STOP RESTART bit The block STOP RESTART bit is used to temporarily stop processing of a given block due to a machine malfunction etc 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 If a START status is in effect at another block the STOP will still occur but the START destination block will remain active and processing will continue To stop the START destination block at the same time the START destination s block STOP RESTART bit must also be switched OFF 2 When a block is stopped by switching the block STOP RESTART bit ON the STOP timing will be as shown below Output Mode Status of Output Operation Description Setting at Status of Block Parameter Block STOP Mode s Special Relay SM325 STOP Mode Bit Active Step Other than HOLD Step Active HOLD Step OFF or no e After the STOP request the coil output will be switched setting OFF the first time processing occurs at the specified block immediate stop and a STOP will occur e After the STOP request the coil e After the STOP output will be switched OFF when request the coil the transition condition is satisfied output will be and a STOP will occur switched OFF the e If multiple steps are active the first time processing STOP will occur at each of the occurs at the
87. fied 2 A transition bit which is ON will automatically switch OFF when processing of the block in question occurs again Example Step transition bit M1 Block n lo Transition condition 1 M1 Step 2 Step 1 Transition condition 3 unsatisfied Step 1 Transition condition 2 satisfied Step 0 Transition condition 2 unsatisfied Transition condition 1 satisfied 1 Transition condition 2 2 Other program executed Other program executed Other program executed Transition condition 3 3 3 If a continuous transition is designated continuous transition bit ON the transition bit will remain ON during the next step s operation output after the transition condition is satisfied It will also remain ON following the execution of multiple steps even if the transition condition is unsatisfied In these cases the transition bit will switch OFF when block execution occurs at the next scan Example Step transition bit M1 Step 1 Step 1 Step 0 Transition condition 2 unsatisfied Transition condition 1 satisfied Other program executed 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 At active parallel branch steps the transition bit will switch ON when any of the transition conditions are satisfied teen HTa Am Step n Step n 2 Step n Step n 1 Transition condition satisfie Transition condition unsatisfie Other program execute Transition condition unsatis
88. forcibly started activated Block START instruction SET BLm independently and is executed from its initial step deactivated BLm Block STOP instruction e A specified block is temporarily stopped e The temporary stop status at a specified block Block restart instruction RSTART BLm is canceled with operation resuming from the STOP step e A specified block is forcibly started activated SET BLm sn independently and is executed from a specified step Step control instruction RST Sn x1 e A specified step at a specified block is forcibly RST BLm Sn deactivated SCHG xo The instruction execution step is deactivated and a specified step is activated SET TRmn x1 je A specified transition condition at a specified SET BLm TRn block is forcibly satisfied e The forced transition at a specified transition BLm TRn condition in a specified block is canceled RST e j ok 1 SF Block switching instruction BRSET ees Seen e he Pepto instruction are designated e When the instruction execution condition is ON the subroutine call is executed in a Subroutine call instruction constant manner When switched OFF the subroutine call occurs only once at that time Transition control instruction APP 8 APP 8 APPENDICE MELSEC QnA Ladder Expression LD AND OR PCHK program name Program operation status check instruction e A check occurs to determine if a specified program is being executed
89. h satisfied transition conditions SFC system process time 72 3 38 8 x 30 10 2 x 70 7 3 x 50 54 0 x 60 9 5 x 60 42 0 x 10 6545 3 us 6 55 ms In this case calculation using the equation shown above results in an SFC system processing time of 6 55 ms With the QnHCPU given the same conditions the processing time would be 2 97 ms The scan time is the total of the following times SFC system processing time main sequence program processing time SFC active step transition condition ladder processing time and CPU END processing time The scan time is the total of the following times SFC system processing time main sequence program processing time SFC active step transition condition ladder processing time and CPU END processing time The number of active steps the number of transition conditions and the number of steps with satisfied transition conditions varies according to the conditions shown below e When transition condition is unsatisfied e When transition condition is satisfied without continuous transition e When transition condition is satisfied with continuous transition The method for determining the number of the above items is illustrated in the SFC diagram below Step 1 Transition condition 1 Step 2 Step 6 _ Transition Transition condition 2 condition 5 Step 3 Step 7 _ Transition Transition condition 3 condition 6 Step 4 Step 8 _ Transition Trans
90. he user program without regard to the parameter setting 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 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 and all subsequent blocks will become periodic execution blocks The execution time interval setting can be designated in 1 ms units within a 1 to 65535 ms range 2 Periodic execution block operation method Periodic execution block operation occurs as shown below 1 scan 1 scan 1 scan Execution interval Execution interval END processing Periodic execution blocks 1 Until the specified time interval elapses only the sequence programs and blocks designated for execution at each scan will be executed 2 When the specified time interval elapses the periodic execution blocks will be executed following execution of blocks designated for execution at each scan If the specified time interval is shorter than the scan time the periodic execution blocks will be executed at each scan in the same manner as the other blocks 3 The specified time interval countdown is executed in a continuous manner 4 SFC PR RAM NFIGURATION SFC PROGRAM CO MELSEC QnA 4 7 5 Operation m
91. herefore the coil output status will remain unchanged even if the input conditions are changed 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 e When the END step of the block in question is executed e When an SFC control instruction RST BLm designates a forced END at the block in question e When an SFC control instruction RST BLm Sn RSTSn designates a reset at the block in question When a reset occurs at the device designated as the SFC information register s block START END device When a reset step for resetting the step in question becomes active e When the SFC START STOP command SM321 is switched OFF e When the coil in question is reset by the program 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 Precautions when designating coil HOLD steps a PLS instruction When the transition condition is satisfied at the same scan where a PLS output condition is satisfied resulting in a PLS output the PLS contact will remain ON until the OFF condition described at item 3 above is satisfied b PLF instruction The PLF output occurs when the OFF condition described at item 3 above is satisfied c Counter If the counter coil is ON when the transition condition becomes satisfied counting will not occur even if input condition ON OFF switching is executed after the transition to the next step d Timer If the t
92. hine operation Operation output and transition condition diagram for each step flowchart SFCdiagram Workpiece R START switch detection xO x1 Conveyor START Process START Bet e L Ni i 1 operation unit al Initial step fl d It Y20 gt condition 1 Wi X2 Transition H F Tran Pallet confirmation Pallet clamp lon 3 e 1 operation unit Step1 Y21 gt clamp operation Clamp confirmation 1 X3 Transition _____ H F Tran condition 2 Drill rotation Y22 PLS vo MO Drill DOWN SET_Y23 1 operation unit Step2 4 Drill DOWN endpoint RST Y23 K20 lt TO gt 4 TO DUP SET Y24 Machine s operation 4 sequence x lt Drilling operation Drill UP endpoint Transition X5 TI Conditon 3 Hi Tran H Pallet unclamp 1 operation unit Sien PLS M1 M1 c RST Y4 X6 Unclamp confirmation Conveyor START Unclamp operation workpiece unloading Y20 Transition X7 Workpiece unloaded confirmation o condition 4 L Tran J Machining completed r Process END ENDstep SFC Program 1 GENERAL DESCRIPTION MELSEC QnA The SFC program performs a sequence of operations beginning from the initial step proceeding to each subsequent step as the transition conditions are satisfied and ending at the END step 1 When the SFC program is started the ini
93. his flag is ON until the continuous OFF whena System Continuous transition OFF After transition 1 step transition is completed for disable flag ON Before transition A continuous transition for the step in question instruction can be prevented by designating an AND execution condition for SM324 e Designates the operation output which occurs when the block is stopped When ON The coil output ON OFF status at the step being executed when the Operation output at OFF Coil output OFF block is stopped is block STOP ON Coil output ON maintained HOLD When OFF All coil outputs are switched OFF Operation outputs which occur in response to the SET instruction are maintained HOLD without regard to the SM325 ON OFF status OFF Continuous All blocks continuous transition enabled transition status ON Continuous transition disabled System initial value User APP 2 APP 2 APPENDICE MELSEC QnA N OFF Name Content Description One Control e Switches ON when a status check is System EPI Status check SFC OFF Disabled completed at an SFC program status information ON Enabled When switched ON information is stored at change SD816 and SD817 System status change FF N e Switch N wh s g i SM820 Step trace ready status O ot ready Switches ON when a ready status is ON Ready established after step trace registration Designates the step trace START STOP status When ON Step t
94. hout END check E 4 14 AR lee NI EE 4 15 4 3 Transition COMO EE 4 16 CERN En El EE 4 16 432 Selection tel len EE 4 18 Se Paralel eneen erer EES NEE SEENEN RA ERRE EIRA AAE EES unseeded RAALTE EEA tessa 4 21 4 3 4 Jump Kr CIE Le EE 4 24 4 3 5 Transition processing with multiple initial steps AAA 4 25 4 3 6 Precautions when creating sequence programs for operation outputs steps and transition Conditions 4 26 4 4 Controlling SFC Programs by Instructions SFC Control Instructions ccceceeceeseeeeeteeeeteeeeeeeteeaes 4 30 4 4 1 Step operation status check instructions LD LDI AND ANI OR OI 4 34 4 4 2 Forced transition check iNStrUCtiON eceeceeeeeeeeeeeeeeeeeeeeeeaeeeeeeeaeeeaeeeaesaeseaeeeaeeeaeeeaeeeaeeeaeeeaeeaeeeaeeeas 4 36 4 4 3 Block operation status check instruction DI mi 4 38 4 4 4 Active step batch readout instructions MOV DMON 4 39 4 4 5 Active step batch readout BMOV cccceccecceseeeeeeeceeeeseeaecaeceeeeaesaecaeseeeeaesaeseeseaesaesaeseeeeaeeaeeeseaeeaes 4 41 4 4 6 Block START amp END instructions SET BET 4 43 4 4 7 Block STOP amp RESTART instructions PAUSE RSTART ccccecceseseeeeeeeeeeseeecaeeeeeeaeeeteeeeaeeaes 4 44 4 4 8 Step START amp END instructions SET R I 4 46 4 4 9 Forced transition EXECUTE amp CANCEL instructions SET BEST 4 49 4 4 10 Active step change instruction GCHO 4 50 4 4 11 Block switching instruction BPRGET 4 51 4 4 12 Program opera
95. imer coil is ON when the transition condition becomes satisfied the timer will continue to run until the designated time up ting is reached even if a step transition occurs e Block STOP processing If a block STOP request is designated by the SFC information register s STOP RESTART bit or by an SFC block STOP instruction the step in question will become inactive with processing occurring as follows Step becomes inactive after the block STOP request occurs and processing returns to the beginning of the block e All coil outputs except those which were switched ON by the SET instruction will switch OFF If a block STOP request is set to HOLD coil outputs remain ON during the stop and after the restart 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA 4 2 5 Operation HOLD step without transition check An operation HOLD step without transition check is a step where operation output ladder processing continues even after a transition to the next step However transition processing will not be executed when the transition condition is satisfied again 1 During normal SFC program operation the coil ON status switched ON by OUT instruction when transition condition is satisfied is automatically switched OFF before proceeding to the next step By designating an operation output step as an operation HOLD step without transition check that step will remain active even after a transition to the next step occur
96. ing use in aircraft medical applications railways incineration and fuel devices manned transport devices equipment for recreation and amusement and safety devices in which human life or assets could be greatly affected and for which a particularly high reliability is required fin terms of safety and control system please consult with Mitsubishi and discuss the required specifications A MITSUBISHI ELECTRIC HEADQUARTERS EUROPEAN REPRESENTATIVES EUROPEAN REPRESENTATIVES MITSUBISHI ELECTRIC EUROPE B V German Branch Gothaer Stra e 8 D 40880 Ratingen Phone 49 0 21 02 486 0 Fax 49 0 21 02 4 86 1 12 e mail megfamail meg mee com MITSUBISHI ELECTRIC FRANCE EUROPE B V French Branch 25 Boulevard des Bouvets F 92741 Nanterre Cedex Phone 33 1 55 68 55 68 Fax 33 1 49 01 07 25 e mail factory automation fra mee com MITSUBISHI ELECTRIC ITALY EUROPE B V Italian Branch Via Paracelso 12 l 20041 Agrate Brianza MI Phone 39 039 6053 1 Fax 39 039 6053 312 e mail factory automation it mee com MITSUBISHI ELECTRIC SPAIN EUROPE B V Spanish Branch Carretera de Rub 76 80 E 08190 Sant Cugat del Vall s Phone 34 9 3 565 3131 Fax 34 9 3 589 2948 e mail industrial sp mee com MITSUBISHI ELECTRIC UK EUROPE B V UK Branch Travellers Lane GB Hatfield Herts AL10 8 XB Phone 44 0 1707 27 61 00 Fax 44 0 1707 27 86 95 MITSUBISHI ELECTRIC CORP
97. ingle scan e Continuous transition OFF 1 step is executed at each scan When multiple steps in a parallel branch are active the entire parallel branch is executed Example 1 Sample program and corresponding processing With continuous transition OFF flags Block o e With continuous transition ON setting 0 When the block becomes active all steps will be executed in a single scan GE En Block END processing then occurs and the block is deactivated 1 e With continuous transition OFF setting SM400 When the block becomes active step execution occurs in a 1 step per scan H tran format 2 Block END processing occurs at the 3rd scan and the block is deactivated SM400 H Tran Example 2 Processing by the sample program with continuous transition OFF flags GE e With continuous transition ON setting LI When the block in question becomes active SM324 is switched ON and the SM400 SM324 Ge ie processing is executed at Step 1 After transition to Step 1 SM324 is switched OFF the processing ends for the 1st scan The 2nd scan starts at 1 Step 2 when SM324 is switched ON Although SM324 is switched OFF SM400 ee because no contact for SM324 is available at Step 2 the block end ia re processing is executed and the block becomes inactive 2 e With continuous transition OFF setting SM400 When the block in question becomes active with or without SM324 step T
98. ion management SFC program or a normal SFC program is designated with the GX Developer For details regarding the setting procedure refer to the GPPQ Operating Manual SFC e Periodic execution block settings see Section 4 7 4 cannot be defined the SFC programs for program execution control If defined no operation occurs 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 3 Example of program execution management SFC programs SFC1 QPR SFC2 QPR and SFC3 QPR are assumed to be SFC program files and SQ QPR is assumed to be a program file for a program other than an SFC program Condition 1 SO PSCAN SFC1 QPR PSCAN Condition 2 SFC1 QPR te Js Condition 3 INV inverse of previous operation result S1 PSCAN SFC2 QPR Condition 4 POFF SFC2 QPR Condition 5 Condition 4 PCHK SFC2 QPR ti Condition 5 HH Hafsa ees S2 SFC3 QPR Condition 6 SFC3 QPR t3 PCHK SFC3 QPR TRAN e Scanning of the zero return etc pre processing control SFC program and the constant monitoring sequence program is executed e An SFC program WAIT status is estab lished at the zero return END signal e When an SFC program SFC1 WAIT status is established a selection transi tion occurs if condition 3 product type etc is ON e Scanning
99. irming operation by step block START END bit ON from a program or a control at debugging and test operations peripheral device because block processing can be restarted The block START END bit is designated at from a peripheral device without requiring a each block as an SFC information register program Restart by SFC information register 2 Active step when restart occurs The step which is active when a block is restarted varies according to the status which existed when the STOP occurred as shown below Status at STOP Step Other than Operation HOLD Step Operation HOLD Step Block STOP mode e Operation is restarted from the step which was gr 5 TER th eps where an operation status with or bit is OFF being executed when the STOP occurred p p B the STOP isd Get iti without transition check was in effect when the e Because the is due a satisfied transition Block STOP mode WW ree STOP occurred retain their operation HOLD e condition operation is restarted from the post bit is ON A status when restarted transition step e H the output mode for a block stop is set to OFF coil HOLD steps are inactive when a STOP occurs and are therefor not reactivated by a restart 6 SFC PROGRAM EXECUTION MELSEC QnA 6 4 Step START Activate and END Deactivate Methods 6 4 1 Step START activate methods The methods for activating steps are described below 1 Step START activate methods Steps can be started a
100. is satisfied becomes inactive and a transition to the next step occurs Moreover when the transition condition immediately prior to an active step is satisfied the next step is executed in accordance with the parameter settings e Want Transition to the next step occurs after waiting for the next step to become inactive e Transfer Transition to the next step occurs even if the next step is active e Pause An error occurs if the next step is active O Os Os tO L t2 J te J Cis Cos Cs t4 t5 t6 Linked steps can also be changed at each initial step 1 GENERAL DESCRIPTION MELSEC QnA 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 e Types of HOLD steps and their operations 1 Coil HOLD step SC H 4 Yio H Transition condition satisfied transition condition being Step which is active due to satisfied 2 Operation HOLD step no transition check SE WP lt vn transition condition being satisfied HHN Step which is active due to 3 Operation HOLD step with transition check e When the transition condition is satisfied the coil output status is eech E maintained regardless of the ON OFF gph status
101. itial value resent designated e Switches ON automatically when an SFC program is present e If switched OFF by another program file prior to System SFC program execution the SFC program will initial value not be executed User e SFC program START STOP control is possible by ON OFF switching at the user program e The default value is the value designated at the parameter s SFC program START mode When OFF All execution statuses are cleared when the SFC program is stopped and a START occurs OFF Initial START from the initial step of block 0 System ON Resumptive When ON A START occurs from the block initial value START and step which were being User executed when the SFC program was stopped f An ON setting is only valid when the J s OFF SFC program SFC program STOP START STOP ON SFC program START SM321 SFC program START status parameter s SFC program START mode i set to resumptive START e When the transition conditions of contiguous steps are satisfied this setting determines whether all those steps will be executed in a single scan When ON Continuous execution continuous transition enabled When OFF Steps are executed in a1 step APP per scan format continuous transition disabled zs When the SFC information register s continuous transition bit setting is designated at each block those settings will take precedence e If the continuous transition status is set to ON t
102. ition branch and the coupling a waiting step is not required 4 SFC PROGRAM CONFIGURATION MELSEC QnA 6 Parallel transition operation flowchart L Initial step Operation status _ Transition condition a Initial step operation output ea Step 1 executed Transition condition b Transition condition _ _ Transition JL Transition HS Transition g YES xi condition c condition d condition e LE B Waiting C Waiting E Waiting Initial step operation output step step step deactivated Transition Step 1 SET condition f ep AA utp Step 5 executed _ Transition Een g ransition conditio b satisfied YE S 1 Step 1 operation output deactivated D Step 2 operation output executed D 4 Step 4 operation output executed Step 3 operation output executed ransition condition e satisfied ransition condition c satisfied Parallel processing YES 1 YES 1 YES 1 Step 2 operation output Step 3 operation output Step 4 operation output deactivated deactivated deactivated Passes Sp pep ae aa ee ee ee FPH a A E gt Waiting step executed Waiting step executed Waiting step executed f RZ o All waiting steps executed Transition condition m f satisfied YES Step 5 operation output executed Transition condition
103. ition condition 4 condition 7 Step 5 Step 9 Transition condition 8 Step 10 3 SPECIFICATIONS MELSEC QnA 1 When transition condition is not satisfied If steps 2 and 6 are both active but transition conditions 2 and 5 are not satisfied Number of active steps 2 steps 2 6 Transition conditions eeeeeee 2 transition conditions 2 5 Number of steps with satisfied transition conditions d ae Rte E EES 0 2 When transition conditions are satisfied e f steps 2 and 6 are active transition conditions 2 and 5 are satisfied and transition conditions 3 and 6 are not satisfied With continuous transition Number of active steps 2 steps 2 6 Number of transition conditions 0 2 transition conditions 2 5 Number of steps with satisfied transition conditions with continuous transition AA E A E T E A tate tires 2 steps 2 6 Number of active steps 4 steps 2 3 6 7 Number of transition conditions 4 transition conditions 2 3 5 6 Number of steps with satisfied transition conditions EE 2 steps 2 6 e f steps 2 and 6 are active and transition conditions 2 3 6 7 are all satisfied without continuous transition Number of active steps 2 steps 2 6 Number of transition conditions E 2 transition conditions 2 5 Number of steps with satisfied transition conditions with continuous transition Lett ere ee cus tua cae Ge 2 steps 2 6 Number of
104. ive step batch readout Instruction BMC See Section 4 4 5 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 4 5 Active step batch readout BMOV Usable Devices Type Internal Device i Expansion Data System User 2 cr i Constant ee Other ae i i i SSES S SFC E T equence Block Step ransition Program Condition Transition Sal RS RES Po BINA Ee era Sn only At expansion SFC and other columns m represents the block No and n represents the step transition condition No n is the step No E Number of readouts m is the block No 4 BmMoviP k4Sn Tool 4 m BMOV P BLmk4sn 4 Function 1 A batch readout designated number of words of step operation statuses is executed at the specified block 2 The readout results are stored at the D device as shown below b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 bi b 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 4 k SR ee gt l Step designated at Sn Sn step 1 Sn step 15 0 Step in question is inactive 1 Step in question is active Di 0 1 0 1 O 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Ess Sn Ax 16 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 3 If the step in question is not in
105. k Convenient when the started block is to be variable product type etc when the SFC program is started e A sequence program other than the SFC program must be designated at the program setting parameter e Convenient for automatic operations etc where the sequence control is clearly defined e There are 2 types of block START The START source step remains active until the START destination block is ended The START source transition occurs without waiting for the START destination block to be ended SFC diagram symbol H e Convenient when starting an error resetting block when error detection occurs and for executing interruption processing Convenient for debugging and test operations in 1 block units because the block can be started from a peripheral device without requiring a program FC PROGRAM EXECUTION EE GH MELSEC QnA 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 e Block processing is ended and the block is deactivated when the block s END step is executed e Convenient for cycle stops at automatic operations etc e Multiple END steps are possible within a single Block END by SFC diagram symbol Se lt END step block e Using an SFC control instruction a specified block is forcibly
106. k is stopped the block STOP RESTART bit switches OFF Operation Error e Error No 4621 occurs when the specified block does not exist or when the SFC program is in the standby status Program Examples 1 Block 1 is stopped when X1 switches ON and is restarted when X2 switches ON PAUSE BL RSTART BL1 Related Instructions 1 SFC information register e Block STOP RESTART Dbiit cece eee eens See Section 4 5 3 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 4 8 Step START amp END instructions SET RST Usable Devices Internal Device Special mir Function Index Constant ee Other Ce sevens enen Module zi Sn Hen Program ES ES Condition SL fo free o fof Ciel name At expansion SFC and other columns m represents the block No and n represents the step transition condition No D n is the step No el Hi m is the block No SET BLm Sn RST BLm Sn Function 1 SET 1 A specified step at a specified block is activated forcibly Operation at the block in question varies as follows depending on whether the block is active or inactive e When the specified block is inactive The specified block is activated when the SET instruction is executed and processing begins from the specified step If an SFC information register block START END bit setting has been designated the bit device in questi
107. l occur at each of the steps in sequence as their transition conditions are satisfied at the specified block and a STOP will occur 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA POINTS 1 The coil HOLD step becomes inactive the first time processing occurs at the block in question following the STOP request 2 During SFC program execution the M325 special relay is switched OFF when the coil output is OFF and is switched ON when the coil output is ON in accordance with the parameter setting The M325 special relay can also be switched ON and OFF by the user program without regard to the parameter setting 3 The STOP RESTART bit switches ON when the SFC control block STOP instruction PAUSE BLm is executed 2 RSTART 1 The block in question is restarted from the step where a STOP occurred 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 A coil output HOLD step cannot be restarted after being stopped as it becomes deactivated at that time 2 Execution of PLS and P instructions after a block STOP has been canceled varies according to the ON HOLD or OFF all OFF status of the SM325 special relay ON operation output HOLD at block STOP OFF all OFF ON Not executed SM325 OFF Executed again 3 If the block restart instruction RSTART BLm is executed while the bloc
108. ll change Operation Error e Error No 4621 occurs when the specified block does not exist or when the SFC program is in the standby status Program Examples 1 When X1 switches ON the following program forcibly activates block1 When X2 switches ON it ends and forcibly deactivates block1 X1 SET BL1 x2 RST BL1 Related Instructions a SFC diagram symbols Block START step H Elccnceieccnceands See Sections 4 2 8 and 4 2 9 b SFC information register e Block START END fant See Section 4 5 1 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 4 7 Block STOP amp RESTART instructions PAUSE RSTART Internal Device System User fo Usable Devices MELSECNET 10 Direct Special Function Index Constant Module Expansion SFC BLm Sn BLm TRn Ge Data eT Type Sequence Program SFC enen Transition Block 60k Step Condition EEN Condition Device name At expansion SFC and other columns m represents the block No and n step transition condition No m is the block No PAUSE BLm n represents the RSTART BLm D Function 1 PAUSE Output Mode Setting at Parameter 1 Executes a temporary stop at the specified block output status setting designated by OUT instruction Status of Output Mode s Special Relay Status of Block STOP Mode Bit 2 As shown belo
109. m Symbol Quantity Selective branching Selective branching parallel branching KE nee nS L J E 7 d q 1 H d J 1 d ih Selection coupling RRE b Aa ae has f g ta bp Selection coupling parallel branching Free Pere dene ZS Geier Parallel branching HE l oiie Late Transition E EEN E E ege G i I i i LE Bic Parallel coupling La ek D i K nne EE eet Parallel coupling parallel branching a T 7 Leg Ki i D i H E 4 CSN e E 3 E a ST Se Parallel coupling selective branching E b Lake ege ESO a acct r ch E wee kt Loe i i b Parallel coupling selective coupling a SKS 222 p j Jump a Lj Can be used more Block END Block END al than once per block 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 2 Steps Steps are the basic units which comprise a block and they represent the units in which the SFC program is executed 1 Each step consists of operation outputs A maximum of 512 steps per block can be designated total of 8192 steps for all blocks 2 Step numbers are assigned to the steps either automatically or by user designation when the SFC program is created The step numbers are used for monitoring step processing and for designating a forced START or END by SFC control instruction 4 2 1 Step _ without step attribute During processing of steps without attributes the next transition conditi
110. maximum of 1280 steps total for all blocks can be executed simultaneously A maximum of 256 steps including HOLD steps can be executed simultaneously in each block RK Fa POINTS 1 A simultaneous START at a single block or at a block which has already been started is impossible If attempted a BLOCK EXE ERROR error will occur and the programmable controller CPU will be stopped 2 The execution status of each block can be checked at another block by using the block START END bit see Section 4 5 1 or the block execution status check instruction SFC control instruction see Section 4 4 3 3 If the double block START operation mode is stopped it is advisable to use a block START END bid or block execution status check instruction as an interlock to the transition condition that precedes a block START request Then execute the block in question after verifying that it has not been executed Example M1 BL1 Transition l Eat condition T aE Tran ae aay Block 1 START request When the block 1 Block 1 status BLOCK START end bit is M1 active inactive is checked 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA 4 2 9 Block START step without END check E A block START step without END check is the step to which processing proceeds when a specified block is started activated without waiting for the START destination block to be deactivated 1 Transition from
111. n condition No within the current block el mH Designating a transition condition No in another block BL3 TR5 Y20 Related Instructions 1 SFC control instructions e Transition control instructions SET TRn SET BLm TRn RST TRn RST BLIM TR crieure See Section 4 4 9 e Block switching instruction DPRGET See Section 4 4 11 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 4 3 Block operation status check instruction BLm Usable Devices Internal Device Neser Special i 10 Direct SFC Program Ka System User x PREI lex Constant Expansion Other e Sequence to K H SFC BLm Program Tranciion iti a fn Device name At expansion SFC and other columns m represents the block No and n represents the step transition condition No poraz tee mp HH Cl o ES CoH BLm Function 1 A check occurs to determine if the specified block is active 2 If the block in question does not exist in the SFC program it will remain OFF As the BLm device is treated as a virtual device the contact on the monitor of a peripheral device does not turn ON OFF If the internal device is ON the coil instruction is switched ON for operations Program Examples 1 The following program switches Y20 ON when block 3 is checked and found to be active BL3 20 E Related Instructions a SFC control instructions e Block STA
112. n the END step of the block in question is executed e When an SFC control instruction RST BLm designates a forced END at the block in question e When an SFC control instruction RST BLm Sn RST Sn designates a reset at the block in question e When a reset occurs at the device designated as the SFC information register s block START END device e When a reset step for resetting the step in question becomes active e When the SFC START STOP command SM321 is switched OFF 3 Block STOP processing If a block STOP request is designated by the SFC information register s STOP RESTART bit or by an SFC block STOP instruction processing will occur as follows e STOP status timing A STOP status is established after the block STOP request output occurs and processing returns to the beginning of the block in question Coil output A coil output OFF or HOLD status will be established depending on the output mode setting see Section 4 7 3 at the time of the block STOP designated in the SFC operation mode However an ON status will be maintained for coil outputs which were switched ON by the SET instruction 4 2 7 Reset step R A reset step is a step which designates a forced deactivation of another specified step operation output 1 When the reset step is activated a specified step within that block will be reset deactivated If 999 is designated as the step to be reset all coil HOLD operation HOLD without transition
113. nother block the STOP will still occur but the START destination block will remain active and processing will continue To clear the START destination block at the same time the START destination s block START END bit must also be switched OFF 4 A block which has been forcibly deactivated is restarted as shown below When the START condition for block 0 is designated as auto START ON at the SFC parameter setting Operation is restarted from the initial step following END step processing another START request occurs for Blocks 1 to 319 that block Block ock0 wiren the START condition for block The block is deactivated after END 0 is designated as auto START step processing and processing is OFF at the SFC parameter setting restarted from the initial step when Related Instructions 1 SFC control instructions e Block START instruction SET BLm block END instruction RST BEM 3 ege Ee Gee ais See Section 4 4 6 2 SFC diagram symbols e Block START step H n Bim See Sections 4 2 8 and 4 2 9 4 58 4 58 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 5 2 Step transition bit The step transition bit performs a check to determine if the transition condition for the current step has been satisfied 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 satis
114. nt block is completed xo H k Tran H 1 GENERAL DESCRIPTION MELSEC QnA 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 e Control by SFC diagram symbols Sia eee es Convenient for control of automatic operations with easy sequential control e Control by SFC instructions Sofia sait Enables requests from program files other than the SFC and is convenient for error processing for example after emergency stops and interrupt control e Control by SFC information registers fuser Enables control of SFC peripheral devices and is convenient for partial operations such as debugging or trial runs Functions which can be controlled by these 3 methods are shown below Control Method Function SFC Diagram Pee Ge SFC Information Registers Instructions 5 E with END wait mee es Sege S m SETBLm Block START END bit ON Block END RST Blm Bock START END bit OFF Block STOP PAUSE BLm Bock STOP RESTART bit ON Restart stopped block RSTART BLm Block STOP RESTART bit OFF 1 In cases where the same function can be executed by a number of methods the first control method which has been designated by the request output to the block or step in question will be th
115. ode 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 H Ei for a block which is already started 1 Settings and corresponding operations Either a PAUSE or WAIT setting can be designated The operations resulting from these settings are shown below Setting e A CPU operation error BLOCK EXE ERROR occurs and ie A block range can be CPU operation is stopped designated for the STOP e All Y outputs switch OFF setting e CPU operation continues and a WAIT status is established when the transition condition is satisfied The WAIT status continues until the START destination block is deactivated e A step transition occurs when the START destination block is deactivated and that block is then reactivated e If a transition WAIT occurs the previous step is deactivated the output is switched OFF and the operation output will not be executed WAIT default HOLD step Condition with transition check i Tran ea SE Transition to step in active block POINTS e When a START request for a block which is already started is executed by the SFC control block START instruction SET BLm or by the SFC information register s block START END bit being switched ON the START request will be ignored and processing of the SFC program will continue as is
116. of SFC program for automatic operation is executed e An SFC program WAIT status is estab lished when the automatic operation END condition is satisfied by a cycle STOP or emergency STOP etc e When condition 4 is satisfied normal END by cycle STOP a block END oc curs and S0 is reactivated after the tran sition condition is satisfied e When condition 5 is satisfied forced END by emergency STOP etc a selec tion transition to S2 occurs after the tran sition condition is satisfied e Scanning of the error processing SFC program is executed e An SFC program WAIT status is estab lished when condition 6 is satisfied er ror processing END e When error processing is completed and the transition condition is satisfied a block END occurs and S0 is reactivated ZS The processing sequence when transition condition t4 is satisfied is the same as that shown above except for a different product type 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 5 2 SFC Program Processing Sequence 5 2 1 SFC program execution cycle The SFC program execution cycle is one time per scan while the SFC program START STOP special relay SM321 is ON Example Under the conditions shown below the execution cycle would be as follows Condition 1 Program sequence 1 ABC Sequence lt scan gt designated by f 2 DEF SFC lt scan gt parameter setting 3 XYZ sequence lt low speed gt Condition 2 Parameter setting for low
117. ogramming Manual Common Instruction Describes instructions other than those described in manual to right Generic Names Before reading this manual refer to High Performance model QCPU Q mode User s Manual Function Explanation Programming Fundamentals and QnACPU Programming Manual Fundamentals in order to confirm the programs I O processing and devices used with High Performance model QCPU Q mode QnACPU Describes the executable programs I O processing and device names for High Performance model QCPU QnACPU Programming Manual Special Function Describes instructions for special function modules such as AJ71QC24 and AH71PT32 S3 QnACPU Programming Manual Fundamentals QnACPU Programming Manual AD57 Command Describes the AD57 commands used to control an AD57 AD58 Describes the executable programs UO processing and device names for QnACPU QCPU Q mode QnACPU Programming Manual PID Control Instructions Describes the instructions used for PID control This manual QCPU Q mode QnACPU Programming Manual SFC Describes SFC programming Q4ARCPU Programming Manual Application PID Edition Describes the instructions used for Applied PID control High Performance model QCPU Generic names for Q02CPU QO2HCPU QO6HCPU Q12HCPU Q25HCPU QnACPU CPU module S1 Q2ACPU Q3ACPU Q4ACPU Q
118. on destination step becomes inactive Transition destination step is reactivated e When TRANSFER setting is designated a a E e The transition occurs immediately and the previous step is deactivated The activation is absorbed b Double START by SFC control instruction The instruction is ignored and processing of the START destination step continues as is The instruction is executed in the same way as the NOP instruction FC PROGRAM EXECUTION a a MELSEC QnA 6 4 2 Step END deactivate methods The methods for deactivating steps are described below 1 Steps can be ended deactivated by the methods shown below Step END Method Operation Description e The step is automatically deactivated by the system when the step s transition condition is satisfied Deactivated when condition is satisfied Condition e If a reset step is designated as the step attribute e Convenient for resetting HOLD steps during the reset deactivate step No must be SFC program execution when a machine specified operation condition is satisfied or when a parallel branch transition to an error processing step occurs e The specified reset step must be located in the same block e Basic SFC program operation e At steps where attributes are specified operation will occur according to the attribute END by SFC diagram symbol Reset step No e Using an SFC control instruction a specified step is forcibly reset d
119. on is constantly monitored with transition to the next step occurring when the condition is satisfied 1 The operation output status of each step n varies after a transition to the next step n 1 depending on the instruction used e When the OUT instruction is used excluding OUT C 4 After a transition to the next step n 1 step n becomes inactive resulting in an automatic output OFF in accordance with the OUT instruction The same processing occurs for timers with the present value being cleared and the contact switched OFF Bereich When transition condition m becomes satisfied at the step n operation output where YO is ON in Seele H mo accordance with the OUT instruction YO is Transition 2 automatically switched OFF condition m Step n 1 VC e When a SET Basic or Application instruction is used Even though step n becomes inactive after a transition to the next step n 1 the ON status or present value is held If switched OFF an RST instruction etc will be required to execute another step Example When transition condition m becomes satisfied at the x2 step n operation output where YO is ON by SET Step nti agea Hi H SET Yo H instruction the YO ON status will be maintained even Transition after the transition to step n 1 condition m Step n 1 E 4 SFC PROGRAM CONFIGURATION MELSEC QnA e When the O
120. on transition format is used k n 3 Step n Transition condition b Step n 1 Step n 2 Step 3 Transition T condition d gt Nn _L Transition condition c EE Step n 5 When transition condition b is satisfied at the step n operation output processing will proceed in order through steps n 1 n 2 and n 3 When transition condition d is satisfied processing will jump to step n For details on jump transitions see Section 4 3 4 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 Selection transition operation flowchart Initial step Operation status _L Transition condition a Initial step operation output executed Step 1 _ Transition Transition Transition condition b condition e condition h Transition condition Step 2 Step 4 Step 6 a satisfiedZ Transition _ Transition YES SI condition c condition f Initial step operation output BS Step 3 step S deactivated _ Transition _ Transition Transition condition d condition g condition i D Step 1 operation output Step 7 executed _ Transition _ condition j ransition condition YES b satisfied ransition conditio e satisfied Kal Step 1 operation output deactivated
121. on will switch ON at this time e 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 2 When multiple initial steps exist an initial step selection START will occur when a given step is specified and activated 3 When designating a step located in a parallel branch all the parallel steps should be activated An inactive parallel branch ladder at such a time will prevent the parallel coupling condition from being satisfied 4 If a specified step is already active when this instruction is executed the instruction will be ignored equivalent to the NOP instruction and processing will continue To hold a specified step with the HOLD step see Transition to HOLD step by double START in Section 4 7 6 2 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 2 1 A specified step at a specified block is forcibly deactivated Coil HOLD and operation HOLD steps are subject to this instruction 2 When the number of active steps at the block in question reaches O due to the execution of this RST instruction block END processing will occur and the block will be deactivated If an SFC information register block START END bit setting has been designated the bit device in question will switch OFF at this time 3 I
122. orced transition check instruction Block operation status check C LD AND OR J BLm Checks a specified block to determine if it is instruction LDI ANI ORI active or inactive MOV P K4Sn x1 MOV P BLm K4Sn DMOV P K8Sn 1 e Active steps in a specified block are read to DMOV P BLm KsSn a specified device as bit information BMOV P K4Sn D Kn zi BMOV P BLm K4Sn Kn e A specified block is forcibly started activated independently and is executed from its initial step SET BLm Block END instruction RST BLm e A specified block is forcibly ended deactivated Block STOP instruction PAUSE BLm e A specified block is temporarily stopped e The temporary stop status at a specified Block restart instruction RSTART BLm block is canceled with operation resuming from the STOP step activated independently and is executed S BLm Sn from a specified step er per Sn 1 A specified step at a specified black is Step control instruction DESCH forcibly deactivated S S Active steps batch readout instruction Block START instruction e The instruction execution step is SCHG deactivated and a specified step is activated e A specified transition condition at a BLm TRn specified block is forcibly satisfied transition condition in a specified block is BLm TRn canceled DEER Blocks subject to the 1 SFC control Block switching instruction 5 d 8 instruction are designated ET Sn ki ET R
123. ot bei LAT executed Not being executed indicates a program s execute type is on standby Being executed indicates that program s execute type is scan low speed and fixed scan 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 4 13 Subroutine call instruction XCALL Usable Devices Programs Using Instructions Execution Site Internal Device A Data Ls System User ra ECH Sequence LANE Sien Type o wor to 5 L Program T C F cannot be used At expansion SFC and other columns m represents the block No and n represents the step transition condition No c XCALL P 9r H Function 1 When the condition is satisfied the subroutine call designated at P is switched ON CALL The subroutine call is switched OFF FCALL when the condition switches from ON to OFF X0 eo T A 1 While is XO is ON the P1 subroutine is executed at every scan each time the step in question is executed 2 When XO switches from ON to OFF the P1 subroutine is switched OFF once only 2 Because pointers cannot be used in SFC programs a common pointer must be called when the XCALL instruction is executed in these programs 3 Normal processing will be impossible if the subroutine program s argument type is different from the XCALL instruction s argument type 4 A maximum of 16 XCALL nestings including those for other CALLs are possible e For de
124. output program 1 The next transition condition is constantly checked during execution of a dummy step and the operation proceeds to the next step when the condition is satisfied 2 LT is displayed if a ladder is created at a dummy step 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 2 4 Coil HOLD step A coil HOLD step is a step where the coil output status is maintained in the transition to the next step The coil output is switched ON by the OUT instruction when the transition condition is satisfied 1 During normal SFC program operation the coil ON status switched ON by OUT instruction when transition condition is satisfied is automatically switched OFF before proceeding to the next step By designating an operation output step as a coil HOLD step the coil ON status will remain in effect when proceeding to the next step When designated as a coil HOLD step When not designated as a coil HOLD step XO s HiH O HEHH ON ON ON 1 ON Wetten Ge catistied Transition condition satisfied Y10 Se 4 rep ee Ea ee e At a designated coil HOLD step Y10 e At steps not designated as coil HOLD steps switched ON by OUT instruction will remain Y10 switched ON by OUT instruction is ON even when the transition condition is automatically switched OFF when the satisfied transition condition is satisfied 2 No ladder processing occurs following a transition to the next step T
125. race function is started SM821 Step trace START Gu When OFF Step trace function is stopped OMETE TAAT If switched OFF during a trace execution the trace operation is stopped ion is i Syst Step trace execution OFF Trace inactive ON viert Siep traca execution 1S progress YSE SM822 and OFF when tracing is completed or status flag ON Trace active stopped change e Switches ON when a trigger condition is System satisfied at any of the blocks where the step status trace function is being executed change OFF Trigger unsatisfied Post trigger step trace ON Trigger satisfied OFF Block with unsatisfied trigger e Switches ON when trigger conditions are System Post trigger step trace exists satisfied at all blocks where the step trace status ON Triggers at all function is being executed change blocks are satisfied e Switches ON when step tracing is completed at System all the specified blocks and switches OFF status when step tracing begins change OFF Trace START Step trace END flag ON Trace END APP 3 APP 3 APPENDICES APPENDIX 1 2 SD Special Registers MELSEC QnA No Name Goen Description SSS e The No of the diagnosis error is stored as 4 digit binary data SDO Diagnosis error Diagnosis error No Time of diagnosis error Time of diagnosis error occurrence Error information classification Error common information 2 Error individual
126. results converted to leading edge pulse step memory Operation results converted to trailing edge pulse step memory Operation results converted to leading edge pulse memory Operation results converted to trailing edge pulse memory 4 SFC PROGRAM CONFIGURATION MELSEC QnA Instruction Code BIN16 bit data comparison BIN32 bit data comparison Floating decimal point data comparison Character string data comparison Contacts LDPCHK Operation START N O contact program operation ANDPCHK Serial connection N O contact status check ORPCHK Parallel connection N O contact 4 SFC PROGRAM CONFIGURATION MELSEC QnA 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 They can be used in SFC programs for easier SFC program control The various SFC control instructions and their functions are shown in the table below L LD AND OR Sn 1 Step operation status LDI ANI ORI e Checks a specified step in a specified block checkinstructionO to determine if the step is active or inactive LDI ANI ORI e Checks a specified step in a specified block LDI ANI ORI to determine if the transition condition by K LD AND OR BLn TRn transition control instruction for that step LDI ANI ORI was Satisfied forcibly or not F
127. rresponding operations An auto START ON or auto START OFF setting is designated for block 0 Operations which occur at the SFC program START and at the block END are shown below Settin Operation 9 At SFC Program START At Block END Block 0 Auto START ON e lock 0 is automatically activated and is e The initial step is automatically activated again default executed from its initial step at the block END e Block 0 is activated by a START request e Block 0 is deactivated at the block END and resulting from an SFC control block START waits for another START request instruction or a block START step in the same manner as other blocks Auto START OFF 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 7 3 Output mode at block STOP The output mode at block STOP setting determines whether an output designated by OUT instruction is to remain ON or be switched OFF when a temporary STOP occurs at a given block in response to the SFC information register s STOP RESTART bit or the SFC control block STOP PAUSE BLm instruction 1 Settings and corresponding operations Either an output HOLD or an output forced OFF setting can be designated as the output mode when a block STOP occurs As shown below the operation which occurs depends on the parameter and special relay SM325 setting combination Block STOP Mode Setting SM325 Status k Active Steps Other than Operation Operation HOLD Bit Status
128. rs which comprise an SFC program are discussed in this section 1 As shown below an SFC program consists of an initial step transition conditions intermediate steps and an END step The data beginning from the initial step and ending at the END step is referred to as a block Initial step Transition Transition condition 1 condition Step 1 Step Transition Transition Block 4 condition 2 condition Step 2 Step ale END step 2 SFC program operation begins at the initial step and proceeds to each of the successive steps as each transition condition is satisfied This operation sequence ends when the END step is reached a When the SFC program is started the initial step is executed first During initial step processing the next transition condition transition condition 1 in the above illustration is checked to determine whether or not it is satisfied b Initial step processing continues until transition condition 1 is satisfied When transition condition 1 is satisfied initial step processing stops and processing of the next step step 1 in the above illustration begins During step 1 processing the next transition condition transition condition 2 in the above illustration is checked to determine whether or not it is satisfied c When transition condition 2 is satisfied step 1 processing stops and processing of the next step step 2 in the above illustration begins Proce
129. ruction only at the first ladder block Condition Output instruction The lack of a sequence program at a given step will not result in an error In such cases no processing will occur until the transition condition immediately following the step in question is satisfied b Sequence program capacity A step s sequence program capacity is as follows e Max of 2k sequence steps per step e Max of 2k sequence steps per block 4 SFC PROGRAM CONFIGURATION MELSEC QnA c Instructions used All instructions except for those shown below may be used Prohibited Instruction List IMCNLJNo 1_D Mastercontrolset o o o y O Master contro reset END EE tere Ei en seuenee pean en Condition jump Delay jump Master control Use of label P is S Delayjump Lee prohibited rogram brane TE Se PO Unconditional jump H GOEND GOEND Jump to END an b Use of label I is Program control IRET eT Reset from interrupt program also prohibited Forced END to repeat operation Reset from subroutine yi CHKST CHKST CHK instruction START Po Debugging failure Prescribed format failure check Po diagnosis Cup ton Begin check pattern change CHKEND_ _ CHKEND__ End check pattern change SECE pop SFC programsSTART SFCPEND___ SFCPEND____ SFC programEND BLOCK _ BLOcK SFC block START BEND BEND SFCblockEND LI N D SC SE ST R C G SFC step START SE pe ISE IST IR J
130. s and processing of its operation output ladder will continue Therefore the coil status will be changed if the input conditions are changed 2 As no transition condition check occurs when the next step becomes active no step transition will occur when the transition conditions for the step in question are again satisfied The difference between an operation HOLD step without transition check and a coil HOLD step is that processing continues even after the step transition with the former and does not with the latter X0 No subsequent k lt Y10 gt transition Ge IT m vo LT 1 Step activated by previous transition condition being satisfied 3 An operation HOLD step without transition check becomes inactive when any of the following occur e When the END step of the block in question is executed e When an SFC control instruction RST BLm designates a forced END at the block in question e When an SFC control instruction RST BLm Sn RSTSn designates a reset at the block in question e When a reset occurs at the device designated as the SFC information register s block START END device When a reset step for resetting the step in question becomes active e When the SFC START STOP command SM321 is switched OFF 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 Block STOP processing If a block STOP request is designated by the SFC information register s STOP RESTART bit or by an
131. s not included in the SFC program readout results are as follows e When the block in question has the last step number S10 but S5 and S8 are missing a When RAGOT is designated b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 bi b0 0 1 0 1 O 0 1 0 1 O O 1 O 1 0 1 AA Xm y A These out of range steps are A not defined 0 indicates the non existence of steps b When BLm SO is designated b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 bi b0 0 0 0J OJ O O 1 0 1 O 0 1 0 1 O 0 1 0 1 0 1 0 1 0 1 Xm y A All out of range steps take on 0 0 indicates the non existence of steps 4 SFC PR RAM NFIGURATION SFC PROGRAM CO MELSEGC QnA Program Examples 1 The following program will read out steps 0 to 32 in block 3 when XO switches ON Designating a step within the current block xo _ _pmovp _ksso o 7 Designating a step in another block XO DMOVP BL3 K8S0 b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 Dh b4 b3 b2 bi S Ed _ 15 14 S13 S12 S11 S10 S9 S8 S7 S6 S5 S4 S3 S2 S1 SO nl SETZ Fee _ 31 S30 S29 S28 S27 S26 S25 S24 S23 S22 S21 S20 S19 S18 S17 S16 Related Instructions 1 SFC control instructions e Block switching instruction DPRGET See Section 4 4 11 e Step operation status check instruction SA ics ge wide eet ee See Section 4 4 1 e Act
132. s some precautions regarding the resumptive START format are described below 1 Resumptive START setting procedure An SFC program resumptive START format can be designated at the SFC program START mode item of the SFC parameter setting 2 Block operation status resulting from SFC program START mode setting The block operation statuses which correspond to the SFC program START mode settings SFC parameter setting are shown below START Mode SM322 Status 1 Operation Status Setting default e When auto START ON is designated for block 0 2 Block 0 is executed from its initial step e When auto START OFF is designated for block 0 2 Resumptive The block started by the SFC control block START instruction is START executed from its initial step ON e Resumptive START A resumptive START is executed from the previous active status 3 1 When CPU STOP gt RUN switching occurs SM322 is switched OFF or ON in accordance with the parameter setting OFF if an initial START is designated and ON if a resumptive start setting is designated 2 The block 0 auto START ON OFF setting is designated at block 0 START condition item of the SFC parameter settings 3 The previous active status is the status which was active when SM321 was switched OFF during SFC program execution or when a CPU reset or power OFF occurred POINTS 1 When a resumptive START occurs following a PLC power
133. safety measures the user s device is subject to or as necessary by industry standards had been provided 4 Failure that could have been avoided if consumable parts battery backlight fuse etc designated in the instruction manual had been correctly serviced or replaced 5 Failure caused by external irresistible forces such as fires or abnormal voltages and failure caused by force majeure such as earthquakes lightning wind and water damage 6 Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi 7 Any other failure found to not be the responsibility of Mitsubishi or 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 Discontinuation of production shall be notified with Mitsubishi Technical Bulletins etc 2 Product supply including repair parts is not possible after production is discontinued 3 Overseas service Overseas repairs shall be accepted by Mitsubishi s local overseas FA Center Note that the repair conditions at each FA Center may differ 4 Exclusion of chance loss and secondary loss from warranty liability Regardless of the gratis warranty term Mitsubishi shall not be liable for compensation to damages caused by any cause found not to be the responsibility of Mitsubishi chance losses lost profits incurred to the user by f
134. shed until all the parallel branch s transition destination steps become inactive The transition is then be executed and all the parallel branch s first steps become active When the WAIT status is established the previous step is deactivated Active Transition condition satisfied WAIT status A Transiti Transition conditions conditions Inactive Transition Inactive satisfied satisfied MAIT executed I Transition Eh a WC e When a TRANSFER setting is designated edad The transition is executed if even 1 of the parallel branch stransition destination steps is active and the previous stepis deactivated Transition destination steps which are inactive are notactivated at this time pe Sea ese bag All active Transition condition a Mm CF II If all the transition destination steps are inactive transition processing occurs in the normal manner with all the destination steps being activated POINTS e The operation mode at transition to active step double step START setting applies at transitions caused by satisfied transition conditions and at forced transitions caused by the SFC control transition control instruction SET TRn If the SFC control step control instruction SET Sn is used to request a START at a step which is already active the req
135. single step block switching will be effective from the point where the BRSET instruction is executed to that step s processing END point When processing is repeated at the next scan following the processing END for that step the block in question will be designated as the current block until the point when the BRSET instruction is executed again Repeated Sequence program Sequence program SFC program A END O B Block n Block n 1 Execution Program 5 3 5 3 S g S g i T T e I T 4 I T e 83 33 Sg 3 ZS o Eo oO 50 nO x nN e nO x nO x S o 0 d o o Sn TRn destination e gt gt q Lei rid rit z block Block specified Block specified Block specified Block specified Block 0 by instruction BlockO by instruction Current block Wey instruction Current block by instruction 1 scan x The block No designated by the m at BLm Sn or BLm TRn will be effective regardless of the execution status ON OFF of the BRSET instruction x When multiple steps are active at parallel branch etc only the step where the instruction was executed will be effective To designate blocks at multiple steps the BRSET instruction must be executed at each of the steps Operation Error e Error No 4621 occurs when the specified block does not exist or when the SFC program is in the standby status Program Examples 1 When X1 switches ON the following program switches the Sn or TRn
136. specified transition condition in a specified block is forcibly satisfied and an unconditional transition is executed at the step which precedes the condition User designated Continuous transition preventer transition condition SM324 1 1 1 i T 2 After execution of the instruction the forced transition status remains effective until a reset instruction is executed 2 1 Cancels the forced transition setting designated by SET instruction at a transition condition and restores the transition condition ladder created by the user Operation Error e Error No 4631 occurs when the specified transition condition does not exist 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA Program Examples 1 When X1 switches ON the following program executes a forced transition at transition condition 1 of block 1 The forced transition setting is canceled when X2 switches ON Designating a transition condition No within the current block 1 x X N Designating a transition condition No in another block SET BL1 TR1 RST BL1 TR1 4 SFC PR RAM CONFIGURATION SFC PROG MELSEC QnA 4 4 10 Active step change instruction SCHG Usable Devices Programs Using Instructions Execution Site l Devi i nternal Device g i Data SFC Program i System User ra ECH Sequence ag D Type Pa buad Program T m n Bit Word BLm TRn TRn Step oe Condition Ol ins dol Jol
137. speed program time 20 ms Condition 3 Automatic START designated for SFC program CPU RUN ABC SFC END ABC SFC END XYZ program execution processing program program execution processing program execution execution execution execution for 20 ms Refer to Section 6 1 for details regarding the SFC program START STOP procedure 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 5 2 2 Block execution sequence 1 When a block becomes active the operation output programs at each step are executed in order beginning from the initial step 2 At SFC programs with multiple blocks block processing is executed in order beginning from the block with the lowest number block0 gt block1 block 2 3 If multiple steps are activated by a parallel transition in an SFC program the operation outputs of all the active steps will be processed in a single scan Example Inthe SFC program shown below steps 3 and 4 at block 0 and steps 4 and 5 at block 1 are activated simultaneously Block 0 Block 1 Block 1 START Ki Step 3 of Step4of Step5of Step 4 of block 0 block 0 mme block 1 block 1 r executed executed executed executed Ed Active steps within a sinale block are processed in order from left to riaht 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 5 2 3 Step execution sequence The step opera
138. ssing of the SFC program continues in this manner executing the steps in order until the END step is reached 4 SFC PROGRAM CONFIGURATION 4 1 List of SFC Diagram Symbols The symbols used in the SFC program are listed below MELSEC QnA Step check ae ial Quantity Initial step O o Dumny initial step Glo Coil HOLD initial step Sc 0 Operation HOLD step without ANEN step No SE 0 siol Rese steps per block transition check initial step is O Operation HOLD step with ST 0 transition check initial step Reset initial ste R 0 Sn Initial step Oj Dummy initial step j Coil HOLD initial step When initial step SC j Operat lon HOLD Step without No is other than LSE j e Max of 31 steps per block transition check initial step wm Operation HOLD step with ST j transition check initial step a Reset initial step R j Sn Step O i Dummy step E Coil HOLD step SC i Operation HOLD step without SE i transition check CG Operation HOLD step with Steps other than Gab e Max of 512 steps per block transition check initial step including initial step Reset step R i Sn Block START step with END i Blm check Block START step without END E i BLm 4 SFC PROGRAM CONFIGURATION MELSEC QnA Serial transition SFC Diagra
139. t SCH in the figure it remains active instead of becoming inactive n 4 SFC PROGRAM CONFIGURATION MELSEC QnA 4 3 5 Transition processing with multiple initial steps Transition processing at blocks which contain multiple initial steps is discussed in this section Only the selection coupling format may be used at blocks with multiple initial steps 1 Active step at block START At blocks containing multiple initial steps the step s which becomes active at the block START depends on the START method used e If the block START step is a H or E step all All initial steps will NEE i become active initial steps will become active at the block START If the block START is designated by the SET BLm block START instruction SFC control instruction all initial steps will become active at the block START If a forced block START is designated by the SFC information register s block START END bit all initial steps will become active at the block START e If one of the initial steps is designated by the SET gt BLm Sn SET Sn step control instruction SFC control instruction only the designated step will become active at the block START Only the designated step will become active 2 Transition processing for multiple active initial steps len Cl Cs Cl t0 t 12
140. t every scan scan execution e The execution time for this file is either the surplus constant scanning time or the preset low speed execution time Low speed program low speed execution e This file is for subroutines or interrupt programs etc KL E program twaingj e Started by program start instruction REMARKS 1 The SFC program can execute only one of the scan execution files To start a WAIT program the SFC program where scanning is currently in progress must first be designated as a WAIT program Refer to section 5 1 2 for details regarding the scan execution gt WAIT program switching procedure 2 Specify the execution type of each program file using Program in the parameters 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 5 1 2 Execution type designation by instructions The execution by instruction function enables the use of instructions to change the execution type designated by the program setting parameter Details on execution type designation by instructions are given below Instructions and corresponding operations conga PSTOP e Designates a WAIT status at the specified block beginning from the next scan e Designates END processing for all blocks of a specified SFC program from the next scan with a WAIT status established at the 2nd scan following execution of the instruction e Designates scanning of a specified program beginning from the next scan e
141. tails regarding the common pointer and the subroutine program s argument refer to the QCPU Q mode QnACPU Programming Manual Common Instructions 4 SFC PROGRAM CONFIGURATION MELSEC QnA Operation Error e Error No 4210 occurs if the program for the specified pointer does not exist e Error No 4211 occurs if an END FEND GOEND or STOP instruction is executed prior to the RET instruction e Error No 4212 occurs if the RET instruction is executed prior to the XCALL instruction e Error No 4213 occurs if the number of nestings exceeds 16 4 SFC PR RAM CONFIGURATION SFC PROG MELSEGC QnA 4 4 14 Time check instruction TIMCHk Programs Ess Instructions Execution Site Usable Devices Internal Device r K Special Data SFC enen 7 System User f y Function Index Constant Type Sequence Block Ste Transition Module z1 KH y Program Tree P Condition SC iti Bit Word ULAGE Condition e 1 _______________ 84 D BIN16 O EES on n represents At expansion SFC and other columns m represents the block No and the step transition condition No L mer n Ie l o Function 1 Measures the condition device ON time and switches a specified device ON when the condition device remains ON longer than the designated time setting Measurements and settings are made in 100ms K1 100ms 2 Th
142. tem processing time is required when switching from a scan status to a WAIT status Switching time number of created programs x km number of created steps x kn SFC program capacity x kp Q4ACPU Q02CPU QnHCPU Se Q3ACPU Q4ARCPU Q2ASHCPU a 451 9us 194 7uUs 1145 3us 859 0us 429 429 5us e 19 1us 8 2us 48 3us 36 2us 18 1us 16 sas 2s 15745 GER 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 5 1 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 Unlike scan execution SFC programs this program execution management SFC program can consist of only 1 file with 1 block 1 Program execution management SFC program creation procedure a Number of files and blocks Only 1 file with 1 block is possible when created as a scan execution program b Usable instructions Except for block START step E E symbols all SFC diagram symbols steps and sequence instructions for transition conditions used at normal SFC programs may be used POINT e A BLOCK EXE ERROR error No 4621 will occur if the block START step H E symbols are used 2 Execution procedure The program is started automatically when registered as a scan execution file After block END processing the initial step is reactivated and processing is repeated e The setting which determines whether a program is a program execut
143. the block START request source to the next step occurs when the transition condition which follows the block START step is satisfied This transition occurs without waiting for the START destination block execution to be completed Processing of the START destination sub block continues without interruption 2 Multiple blocks can be started simultaneously by using a parallel transition format see Section 4 3 3 at the block START request Steps in the simultaneously started blocks will be processed in parallel 3 A maximum of 1280 steps total for all blocks can be executed simultaneously A maximum of 256 steps including HOLD steps can be executed simultaneously in each block m m Jam POINTS 1 A simultaneous START at a single sub block or at a sub block which has already been started is impossible If attempted a BLOCK EXE ERROR error will occur and the programmable controller CPU will be stopped 2 The execution status of each block can be checked at another block by using the block START END bit see Section 4 5 1 or the block execution status check instruction SFC control instruction see Section 4 4 3 3 If the double block START operation mode is stopped it is advisable to use a block START END bid or block execution status check instruction as an interlock to the transition condition that precedes a block START request Then execute the block in question after verifying that it has not been executed
144. tial step is executed first 2 Execution of the initial step continues until transition condition 1 is satisfied When this transition condition is satisfied execution of the initial step is stopped and processing proceeds to the step which follows the initial step Processing of the SFC program continues from step to step in this manner until the END step has been executed 1 GENERAL DESCRIPTION MELSEC QnA 1 2 SFC MELSAPS Features 1 Easy to design and maintain systems Because control of the overall system and each station as well as the machines themselves corresponds on a one to one basis with the blocks and steps of the SFC program systems can be designed and maintained even by those with relatively little sequence program experience Moreover programs designed by other programmers using this format are much easier to decode than sequence programs Station 1 Station 2 Station 3 control unit control unit control unit Step transition control unit for overall processi e P Transfer machine Overall system SFC program Step transition control Station 1 Station 2 Station 3 unit for overall process control unit control unit control uni block 0 block 1 block 2 block 3 ea Transfer machine START___ BI START SE START sic L START i initial step initial step initial step initial step i Station START Pallet clamp Pallet clamp V Pallet clamp block 1 STA
145. ting at SFC programs APP 4 APPENDICES MELSEC QnA Step transition watchdog timer setting corresponding to SM90 Step transition watchdog timer setting corresponding to SM91 Step transition watchdog timer setting corresponding to SM92 e The step transition watchdog timer s setting value and the Step transition F No which switches ON when a watchdog timer time watchdog timer setting over status occurs are designated corresponding to SM93 b15 to b8b7 to bO Step transition x R watchdog timer setting i corresponding to Timer limit setting SM94 Timer setting value and 1 to 255 s Step transition F No at time over designated in 1 s units watchdog timer setting F No setting corresponding to SM95 Step transition The timer is started when any of these special registers watchdog timer setting switches ON corresponding to If the next transition condition for the step in question is not SM96 satisfied within the designated time the specified annunciator F switches ON Step transition watchdog timer setting corresponding to SM97 Step transition watchdog timer setting corresponding to SM98 Step transition watchdog timer setting corresponding to SM99 SD99 e The block No where a status check at SFC program is executed is stored x Valid only when SM816 is ON e The step No where a st
146. tion output programs are executed at each scan while the SFC program START STOP special relay SM321 is ON 1 Execution sequence from program START to the transition to step 1 of the SFC program When the SFC program START STOP special relay SM321 is switched ON and a program START occurs the execution sequence from the initial step to the transition to step 1 occurs as shown below CPU RUN END processing END processing END processing SM3210N SM3210N SM3210N Initial step Initial step Step 1 operation operation operation output output output executed Y executed executed SFC program Block 0 Transition condition Transition condition Transition condition unsatisfied satisfied unsatisfied e The status of the transition condition for a transition to the next step is checked at the completion of each step s operation output Condition unsatisfied The same step s operation output is executed again at the next scan Condition satisfied All outputs of the executed step are switched OFF by that step s OUT instruction and the next step s operation output is executed at the next scan e When a transition condition is satisfied and SFC programprocessing proceeds to the next step the operation output of the previous step is deactivated The CPU only processes the operation output of the step which is currently active and the transition condition program for a transition to the next step e If a step attribute designates
147. tion status Check instruction cece cece ec eee cee eeee eee seeseeeeaesae sae seneaeseeseeeeaaeas 4 53 4 4 13 Subroutine call instruction GCALL 4 54 4 4 14 Time check instruction CTIMCHKR 4 56 4 5 SFC Information ee 4 57 4 5 1 Block START END DH A 4 58 4 5 2 Step transition DI ege ege ENEE 4 59 4 5 3 Block STOP RESTART Dit s c ta ccteieee Pine dase dete tana dSeEE Eege Ee KEEN ORE TE Aa Senada tates 4 61 4 5 4 Block STOP mode bn 4 63 4 5 5 Gontinuous transition TEE 4 64 4 5 6 Number of active steps regiSter cceccesceeseeeseeeseeeeeeeeeeeseeeseeeseeeseeeeeeaeeseeeeeeneeeneeeneeesenseeeneeeaes 4 65 4 6 Step Transition Watchdog Timer ceeeeccesesseeeeeceeseeeeeeeeeesaecaeeeseesaesaseeseesaesaeseseesaesaesaseeseeeesneeaneaseees 4 66 4 7 SFC Operation Mode Setting cccccecceccecceceeeeceeceeeeeeeeecaeceeeeaecaecaeseeesaecaecaeseaeeaesaeseeseaesaesaeseeeeeseseeeeaeeaes 4 68 4 7 1 SFC program START mode sicsssiie acti ngedid eri eagadi a ENd EEN 4 69 D DEER MR e le re 4 69 4 7 3 Output Mode at block GTOR 4 70 4 7 4 Periodic execution plock Setting 2 2 eeeceeeeeeseeeeeeeeeeeeeeeeeeseeeseeeeeeeeeeeeseeeseeceeeeeeeeeneesteeenenteeeneeeaes 4 71 4 7 5 Operation mode at double block TATA 4 72 4 7 6 Operation mode at transition to active step double step GTART 4 73 5 SFC PROGRAM PROCESSING SEQUENCE 5 1 to 5 13 5 1 Overall Program Processing ssi 02 54 sented ave heh ced isk cha eek ane cab ees Raani
148. uest is ignored and processing continues as is 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 5 SFC PROGRAM PROCESSING SEQUENCE The processing sequence for SFC programs is shown below CPU RUN Initial program execution Resumptive start What is the SEG program START mode OFF Initial START Resumptive start Initial START Auto START OFF What is the block 0 START condition Auto START ON Has block START request occurred Execution from initial step of block designated by START request Execution from initial step of block 0 Has SM321 switched OFF SFC program execution END e System starts automatically at CPU power ON or at STOP RUN switching in order to switch SM321 ON e If SM321 is switched OFF before SFC program scanning begins the SFC pro gram will not be executed until SM321 is switched ON e An SFC program initial START or re sumptive start setting is designated at the SFC parameter setting e When a resumptive start setting is designated the system switches SM322 ON If SM322 is switched OFF before SFC 5 program scanning begins the initial START setting will be designated e A block 0 auto START ON or auto START OFF setting is designated in the SFC parameter settings e f auto START ON is designated block 0 is executed from its initial step e f auto ST
149. ven after a transition to the next step occurs processing of its operation output ladder will continue and a transition condition check will be executed If the transition condition is satisfied again a transition to the next step will occur with that step being activated while the current step remains active repeated operation POINTS 1 A pulse PLS format should be used for the transition condition If a pulse format is not used scan transition processing will occur each time a condition is satisfied 2 If a double START occurs due to the transition destination step being active when the transition condition is satisfied processing will be according to the parameter setting Refer to Section 4 7 6 for details regarding parameter settings and the processing for each setting 3 The difference between operation HOLD steps with and without transition checks is as follows At operation HOLD steps with transition checks the next step is activated when the transition condition is again satisfied At operation HOLD steps without transition checks the next step is not activated when the transition condition is again satisfied lt 10 gt EZ e PLS MO ren Sa Transition executed again Step activated by previous transition condition being satisfied 4 SFC PROGRAM CONFIGURATION MELSEC QnA 2 An operation HOLD step with transition check becomes inactive when any of the following occur Whe
150. w processing varies depending on when the stop occurs and on the coil Operation Description Active Step Other than HOLD Step Active HOLD Step Block STOP SM325 gee de After the STOP request the coil output will be switched OFF the first 9 time processing occurs at the specified block and a STOP will immediate occur stop Coil output OFF After the STOP request the coil output After the STOP OFF will be switched OFF when the transition coil output coil output condition is satisfied and a STOP will request the coil output p OFF ON post will be switched OFF HOLD S occur Se transition the first time e If multiple steps are active the STOP STOP f processing occurs at will occur at each of the steps in ae f Ss fe the specified block sequence as their transition conditions e Ge and a STOP will occur are satisfied OFF or no BE e After the STOP request a coil output HOLD status will be s 9 established the first time processing occurs at the specified block immediate e and a STOP will occur stop e After the STOP request the coil output N f e After the STOP Coil output ae utput HOLD status will be established when SE SC output HOLD HOLD ON post the transition condition is satisfied anda HOLD status will be ts STOP will occur i transition lt If multiple steps are active the STOP established the first STOP p p time processing occurs wil
151. xecution of all program files designated at the program setting parameter as scan execution files Refer to the User s Manual of the applicable CPU regarding the details of processing order and contents of processing of the programs other than SFC program 5 SFC PROGRAM PROCESSING SEQUENCE MELSEC QnA 2 Transition processing for continuous transition OFF setting The SFC program processing procedure for a continuous transition OFF setting is shown below 1 Active step n ladder operation Y10 xo 2 Transition condition satisfied unsatisfied check H n 1 A Vit When transition condition When transition condition i is unsatisfied is satisfied v 3 END processing 3 The active step n is deactivated and the coil If other blocks exist subsequent the block where the OUT instruction is ON is switched OFF in question END processing will be executed after those blocks have been processed 4 4 END processing If other blocks exist subsequent the block in question END processing will be executed Y after those blocks have been processed 4 Ladder processing for the same step n as that at the previous scan ba vY 5 Ladder operation is executed for the step activated by the satisfied condition at the previous scan e END processing occurs following the execution of all program files designated at the program setting parameter as scan execution files Refer to the User s

Download Pdf Manuals

image

Related Search

Related Contents

スイッチ切換器取扱説明書 スイッチ切換器取扱説明書 [1入力4出力]  Samsung Samsung C450 Instrukcja obsługi  Replace Your Rig`s LCD Panel Lamps with SMD  C912  HP Pavilion PC シリーズ 秋冬モデル  

Copyright © All rights reserved.
Failed to retrieve file