CPM2A_PROGRAMMING MANUAL (W353-E1-2) (986750), страница 60
Текст из файла (страница 60)
If the previous executioncondition was OFF and the current execution condition is either ON or OFF,DIFD(14) will either turn the designated bit OFF or leave it OFF. The designatedbit will thus never be ON for longer than one cycle, assuming it is executed eachcycle (see Precautions, below).These instructions are used when differentiated instructions (i.e., those prefixedwith an @) are not available and single-cycle execution of a particular instructionis desired.
They can also be used with non-differentiated forms of instructionsthat have differentiated forms when their use will simplify programming. Examples of these are shown below.Flags350There are no flags affected by these instructions.Section 7-11INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03)PrecautionsDIFU(13) and DIFD(14) operation can be uncertain when the instructions areprogrammed between IL and ILC, between JMP and JME, or in subroutines.
Refer to 7-11 INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03), 7-12JUMP and JUMP END – JMP(04) and JME(05), 7-26 Subroutine Instructions,and 7-29-1 INTERRUPT CONTROL – INT(89).ExampleIn this example, IR 20014 will be turned ON for one cycle when IR 00000 goesfrom OFF to ON. IR 20015 will be turned ON for one cycle when IR 00000 goesfrom ON to OFF.00000DIFU(13) 20014DIFD(14) 200157-9Address000000000100002InstructionLDDIFU(13)DIFD(14)Operands000002001420015NO OPERATION – NOP(00)DescriptionNOP(00) is not generally required in programming and there is no ladder symbolfor it.
When NOP(00) is found in a program, nothing is executed and the programexecution moves to the next instruction. When memory is cleared prior to programming, NOP(00) is written at all addresses. NOP(00) can be input throughthe 00 function code.FlagsThere are no flags affected by NOP(00).7-10 END – END(01)Ladder SymbolEND(01)DescriptionEND(01) is required as the last instruction in any program. If there are subroutines, END(01) is placed after the last subroutine. No instruction written afterEND(01) will be executed. END(01) can be placed anywhere in the program toexecute all instructions up to that point, as is sometimes done to debug a program, but it must be removed to execute the remainder of the program.If there is no END(01) in the program, no instructions will be executed and theerror message “NO END INST” will appear.FlagsEND(01) turns OFF the ER, CY, GR, EQ, and LE flags.7-11 INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03)DescriptionLadder SymbolIL(02)Ladder SymbolILC(03)IL(02) is always used in conjunction with ILC(03) to create interlocks.
Interlocksare used to enable branching in the same way as can be achieved with TR bits,but treatment of instructions between IL(02) and ILC(03) differs from that withTR bits when the execution condition for IL(02) is OFF. If the execution conditionof IL(02) is ON, the program will be executed as written, with an ON executioncondition used to start each instruction line from the point where IL(02) is locatedthrough the next ILC(03). Refer to 6-3-8 Branching Instruction Lines for basicdescriptions of both methods.351Section 7-11INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03)If the execution condition for IL(02) is OFF, the interlocked section betweenIL(02) and ILC(03) will be treated as shown in the following table:InstructionTreatmentOUT and OUT NOTDesignated bit turned OFF.TIM and TIMH(15)Reset.CNT, CNTR(12)PV maintained.KEEP(11)Bit status maintained.DIFU(13) and DIFD(14)Not executed (see below).All other instructionsThe instructions are not executed, and all IR, AR, LR,HR, and SR bits and words written to as operands in theinstructions are turned OFF.IL(02) and ILC(03) do not necessarily have to be used in pairs.
IL(02) can beused several times in a row, with each IL(02) creating an interlocked sectionthrough the next ILC(03). ILC(03) cannot be used unless there is at least oneIL(02) between it and any previous ILC(03).DIFU(13) and DIFD(14) inInterlocksChanges in the execution condition for a DIFU(13) or DIFD(14) are not recordedif the DIFU(13) or DIFD(14) is in an interlocked section and the execution condition for the IL(02) is OFF. When DIFU(13) or DIFD(14) is execution in an interlocked section immediately after the execution condition for the IL(02) has goneON, the execution condition for the DIFU(13) or DIFD(14) will be compared tothe execution condition that existed before the interlock became effective (i.e.,before the interlock condition for IL(02) went OFF).
The ladder diagram and bitstatus changes for this are shown below. The interlock is in effect while 00000 isOFF. Notice that 20000 is not turned ON at the point labeled A even though00001 has turned OFF and then back ON.00000IL(02)00001DIFU(13) 20000ILC(03)AAddress0000000001000020000300004InstructionLDIL(02)LDDIFU(13)ILC(03)Operands000000000120000ON00000OFFON00001OFFON20000OFFPrecautionsThere must be an ILC(03) following any one or more IL(02).Although as many IL(02) instructions as are necessary can be used with oneILC(03), ILC(03) instructions cannot be used consecutively without at least oneIL(02) in between, i.e., nesting is not possible.
Whenever a ILC(03) is executed,all interlocks between the active ILC(03) and the preceding ILC(03) are cleared.When more than one IL(02) is used with a single ILC(03), an error message willappear when the program check is performed, but execution will proceed normally.Flags352There are no flags affected by these instructions.Section 7-12JUMP and JUMP END – JMP(04) and JME(05)ExampleThe following diagram shows IL(02) being used twice with one ILC(03).Address00000IL(02)00001TIM 000#00151.5 sInstruction00000000010000200003LDIL(02)LDTIM00004000050000600007000080000900010LDIL(02)LDAND NOTLDLDCNT00000000110001200013LDOUTILC(03)#00002IL(02)0000300100Operands00004CPRCNT001IR 0100000500003000040010000100001010000050100201002ILC(03)00001000001500002When the execution condition for the first IL(02) is OFF, TIM 000 will be reset to1.5 s, CNT 001 will not be changed, and 01002 will be turned OFF.
When theexecution condition for the first IL(02) is ON and the execution condition for thesecond IL(02) is OFF, TIM 000 will be executed according to the status of 00001,CNT 001 will not be changed, and 01002 will be turned OFF. When the executionconditions for both the IL(02) are ON, the program will execute as written.7-12 JUMP and JUMP END – JMP(04) and JME(05)Ladder SymbolsJMP(04) NDefiner ValuesN: Jump number#JME(05) NN: Jump number#LimitationsJump numbers 01 through 49 may be used only once in JMP(04) and once inJME(05), i.e., each can be used to define one jump only.
Jump number 00 can beused as many times as desired.DescriptionJMP(04) is always used in conjunction with JME(05) to create jumps, i.e., to skipfrom one point in a ladder diagram to another point. JMP(04) defines the pointfrom which the jump will be made; JME(05) defines the destination of the jump.When the execution condition for JMP(04) in ON, no jump is made and the program is executed consecutively as written. When the execution condition forJMP(04) is OFF, a jump is made to the JME(05) with the same jump number andthe instruction following JME(05) is executed next.If the jump number for JMP(04) is between 01 and 49, jumps, when made, will goimmediately to JME(05) with the same jump number without executing anyinstructions in between. The status of timers, counters, bits used in OUT, bitsused in OUT NOT, and all other status bits controlled by the instructions betweenJMP(04) and JMP(05) will not be changed. Each of these jump numbers can beused to define only one jump.
Because all of instructions between JMP(04) andJME(05) are skipped, jump numbers 01 through 49 can be used to reduce cycletime.353JUMP and JUMP END – JMP(04) and JME(05)Section 7-12Jump Number 00If the jump number for JMP(04) is 00, the CPU Unit will look for the next JME(05)with a jump number of 00. To do so, it must search through the program, causinga longer cycle time (when the execution condition is OFF) than for other jumps.The status of timers, counters, bits used in OUT, bits used in OUT NOT, and allother status controlled by the instructions between JMP(04) 00 and JME(05) 00will not be changed. jump number 00 can be used as many times as desired.
Ajump from JMP(04) 00 will always go to the next JME(05) 00 in the program. It isthus possible to use JMP(04) 00 consecutively and match them all with the sameJME(05) 00. It makes no sense, however, to use JME(05) 00 consecutively, because all jumps made to them will end at the first JME(05) 00.DIFU(13) and DIFD(14) inJumpsAlthough DIFU(13) and DIFD(14) are designed to turn ON the designated bit forone cycle, they will not necessarily do so when written between JMP(04) andJME(05).
Once either DIFU(13) or DIFD(14) has turned ON a bit, it will remainON until the next time DIFU(13) or DIFD(14) is executed again. In normal programming, this means the next cycle. In a jump, this means the next time thejump from JMP(04) to JME(05) is not made, i.e., if a bit is turned ON by DIFU(13)or DIFD(14) and then a jump is made in the next cycle so that DIFU(13) orDIFD(14) are skipped, the designated bit will remain ON until the next time theexecution condition for the JMP(04) controlling the jump is ON.TIMH(15) and TMHH(––) inJumpsWhen TIMH(15) or TMHH(––) is programmed between JMP(04) and JME(05),timing will be performed by interrupt if jump numbers 01 through 49 are used buttiming won’t be performed if jump number 00 is used.PrecautionsWhen JMP(04) and JME(05) are not used in pairs, an error message will appearwhen the program check is performed.
This message also appears if JMP(04)00 and JME(05) 00 are not used in pairs, but the program will execute properlyas written.FlagsThere are no flags affected by these instructions.ExamplesExamples of jump programs are provided in 6-3-9 Jumps.354Section 7-13User Error Instructions7-13 User Error Instructions:FAILURE ALARM AND RESET – FAL(06) andSEVERE FAILURE ALARM – FALS(07)Ladder SymbolsFAL(06) NDefiner Data Areas@FAL(06) NN: FAL number# (00 to 99)N: FAL numberFALS(07) N# (01 to 99)DescriptionFAL(06) and FALS(07) are provided so that the programmer can output errornumbers for use in operation, maintenance, and debugging.