CPM2A_PROGRAMMING MANUAL (W353-E1-2) (986750), страница 62
Текст из файла (страница 62)
(Although 00.00 and 00.01 may be set, 00.00will disable the timer, i.e., turn ON the Completion Flag immediately, and 00.01 isnot reliably scanned.) The decimal point is not entered.Each TC number can be used as the definer in only one TIMER or COUNTERinstruction. TC numbers run from 000 through 255 in the CPM2A/CPM2C PCsand from 000 through 127 in the CPM1/CPM1A/SRM1(-V2) PCs.DescriptionTIMH(15) operates in the same way as TIM except that TIMH measures in unitsof 0.01 second.
Refer to 7-15-1 TIMER – TIM for operational details.PrecautionsTimers in interlocked program sections are reset when the execution conditionfor IL(02) is OFF. Power interruptions also reset timers. If a timer that is not resetunder these conditions is desired, SR area clock pulse bits can be counted toproduce timers using CNT. Refer to 7-15-5 COUNTER – CNT for details.Timers in jumped program sections will not be reset when the execution condition for JMP(04) is OFF. The timer will stop timing if jump number 00 is used, butwill continue timing if other jump numbers are used.Always reset the timer when changing between TIM and TIMH(15) in online editing.
Also, when changing a TIMH(15) instruction with interrupt refreshing, do soonly in PROGRAM mode.Use timer numbers 000 to 003 for TIMH(15). High-speed timers with timer numbers TC 004 through TC 127 (TC 016 through TC 255 in the CPM2A/CPM2C)may not be accurate when the cycle time exceeds 10 ms.PCCPM2A/CPM2CCPM1, CPM1A, andSRM1(-V2)360Interrupt refreshing every10 msTC 000 through TC 003Refreshed when TIMH(015)is executedTC 004 through TC 255TC 000 through TC 003TC 004 through TC 127Section 7-15Timer and Counter InstructionsIn the CPM2A/CPM2C PCs, TC 004 through TC 007 should not be used inTIMH(15) if they are required for TMHH(––). Refer to 7-15-3 VERY HIGHSPEED TIMER – TMHH(––) for details.If the timer’s set value is set to 0000, the Completion Flag will turn ON as soon asthe timer’s execution condition turns ON.
If TIM000 to TIM003 are used, however, there may be a delay before the flag turns ON.If the timer’s set value is set to 0001, the Completion Flag will turn ON somewhere between 0 and 0.01 s after the timer’s execution condition turns ON (i.e.,the timer accuracy will actually determine the time), and may turn ON as soon asthe timer’s execution condition turns ON.Always consider the accuracy of the timer (0 to –0.01 s) in application programs.Indirectly addressed DM word is non-existent.
(Content of *DM word isnot BCD, or the DM area boundary has been exceeded.)FlagsER:ExampleThe following example shows a timer set with a constant. CIO 01600 will beturned ON after CIO 00000 goes ON and stays ON for at least 1.5 seconds.When 00000 goes OFF, the timer will be reset and CIO 01600 will be turned OFF.00000TIMH(15)000Address1.5 s#0150Instruction0000000001LDTIMH(15)0000200003LDOUTTIM 00001600Operands#TIM000000000150000016007-15-3 VERY HIGH-SPEED TIMER: TMHH(––)Ladder SymbolOperand Data AreasN: #TMHH(––)TIM000 to TIM255NSV: Set valueSV000IR, SR, AR, DM, HR, LR, #000Set to 000.This instruction is supported by the CPM2A/CPM2C only.LimitationsEach TC number can be used as the definer in only one TIMER or COUNTERinstruction.
TC numbers run from TIM000 through TIM255. (You must enter“TIM” along with the actual timer number when using TIML(––). The instructionwill not work if only the number is entered.)SV is BCD between 0000 and 9999 (0 to 9.999 s).Set the third operand to 000. (This operand is ignored.)DescriptionTMHH(––) is a decrementing ON-delay timer that times in 1-ms units. The timerset value can be 0 to 9.999 s and the timer has a accuracy of 1 ms.A very high-speed timer is activated when its execution condition goes ON and isreset (to the SV) when the execution condition goes OFF. Once activated,TMHH(––) times down from the SV in units of 1 ms.The timer will time out when the PV reaches #0000 (0 ms).
Once the timer hastimed out, the PV and Completion Flag status will be maintained. The timer canbe restarted by temporarily turning its execution condition from ON to OFF or361Section 7-15Timer and Counter Instructionschanging its PV to a value other than #0000 with an instruction such asMOV(21).The operation of very high-speed timers in jumped program sections dependsupon the TC number used to define the timer, as shown in the following table.TC numberOperation000 to 003,008 to 255The timer will stop when the execution condition for JMP(04) is OFF.This can greatly reduce the accuracy of timers in jumped programsections.004 to 007If jump number 00 is used, the timer will stop timing when theexecution condition for JMP(04) is OFF.
This can greatly reduce theaccuracy of timers in jumped program sections.If any other jump number is used, the timer will continue timingnormally when the execution condition for JMP(04) is OFF.PrecautionsVery high-speed timers with timer numbers other than TC 004 through TC 007may not be accurate when the cycle time exceeds 1 ms. (The cycle time will notaffect very high-speed timers defined with TC 004 through TC 007.)Very high-speed timers in interlocked program sections are reset (to the SV)when the execution condition for IL(02) is OFF.If the timer’s set value is set to 0000, the Completion Flag will turn ON as soon asthe timer’s execution condition turns ON.
If TIM004 to TIM007 are used, however, there may be a delay before the flag turns ON.If the timer’s set value is set to 0001, the Completion Flag will turn ON somewhere between 0 and 1 ms after the timer’s execution condition turns ON (i.e.,the timer accuracy will actually determine the time), and may turn ON as soon asthe timer’s execution condition turns ON.Always consider the accuracy of the timer (0 to –1 ms) in application programs.FlagsER:ExampleIn the following example, CIO 20000 will be turned ON after CIO 00000 goes ONand stays ON for at least 1.5 seconds.
When 00000 goes OFF, the timer will bereset and CIO 20000 will be turned OFF.N is not a valid TC number.00000AddressInstruction0000000001LDTMHH(––)OperandsTMHH(––)TIM004#15001.5 sTIM#000TIM00420000000000000200003LDOUTTIM0041500000004200007-15-4 LONG TIMER: TIML(––)Ladder SymbolOperand Data AreasN: Timer number (see Limitations)TIML(––)TIM000 to TIM255NSV: Set valueSVCIR, SR, AR, DM, HR, LR, #C: Control data000 or 001This instruction is supported by the CPM2A/CPM2C only.362Section 7-15Timer and Counter InstructionsLimitationsEach timer number can be used as the definer in only one TIMER or COUNTERinstruction. Timer numbers run from TIM000 through TIM255.
(You must enter“TIM” along with the actual timer number when using TIML(––). The instructionwill not work if only the number is entered.)SV is BCD between 0000 and 9999 (0 to 9,999 s when C=000 and 0 to 99,990 swhen C=001).C must be 000 (1-s timing units) or 001 (10-s timing units).DescriptionTIML(––) is a decrementing ON-delay timer that can time in 1-s units or 10-sunits.
The timer set value can be 0 to 9,999 s (accuracy 0 to 1 s) when 1-s unitsare used (C=000) or 0.10 to 99,990 s (accuracy 0 to 10 s) when 10-s units areused (C=001).A long timer is activated when its execution condition goes ON and is reset (tothe SV) when the execution condition goes OFF. Once activated, TIML(––)times down from the SV in units of 1 s or 10 s (depending upon the value of C).TIML(––) accuracy is 0 to 1 s with 1-s units or 0 to 10 s with 10-s units.The timer will time out when the PV reaches #0000 (0 s). Once the timer hastimed out, the PV and Completion Flag status will be maintained. The timer canbe restarted by temporarily turning its execution condition from ON to OFF orchanging its PV to a value other than #0000 with an instruction such asMOV(21).Long timers in jumped program sections will not be reset when the executioncondition for JMP(04) is OFF, but the timer will stop timing and the PV will bemaintained. Timing will resume when the execution condition for JMP(04) goesON again.
This can greatly reduce the accuracy of long timers in jumped program sections.PrecautionsTIML(––) may not be accurate when the cycle time exceeds 1 s (C=000) or 10 s(C=001).Long timers in interlocked program sections are reset (to the SV) when theexecution condition for IL(02) is OFF.The timing units in C can be changed while the long timer is timing.
Changing thetiming units during operation reduces the timer’s accuracy by up to 10 s.You must enter “TIM” along with the actual timer number when using TIML(––).The instruction will not work if only the number is entered.If the timer’s set value is set to 0000, the Completion Flag will turn ON as soon asthe timer’s execution condition turns ON. If the timer’s set value is set to 0001,the Completion Flag will turn ON somewhere between 0 and 1 s or between 0and 10 s after the timer’s execution condition turns ON (i.e., the timer accuracywill actually determine the time), and may turn ON as soon as the timer’s execution condition turns ON.Always consider the accuracy of the timer (0 to –1 s or 0 to –10 s) in applicationprograms.FlagsER:N is not a valid timer number.C is not 000 or 001.363Section 7-15Timer and Counter InstructionsExampleIn the following example, CIO 20000 will be turned ON after CIO 00000 goes ONand stays ON for at least 1,500 seconds.
When 00000 goes OFF, the timer willbe reset and CIO 20000 will be turned OFF.00000AddressInstruction0000000001LDTIML(––)OperandsTIML(––)TIM002#01501500 s00000TIM#001TIM002000020000320000LDOUT002015000100220000TIM7-15-5 COUNTER – CNTDefiner ValuesN: TC numberLadder Symbol#CPRCNT NOperand Data AreasSVSV: Set value (word, BCD)IR, SR, AR, DM, HR, LR, #LimitationsEach TC number can be used as the definer in only one TIMER or COUNTERinstruction. TC numbers run from 000 through 255 in the CPM2A/CPM2C PCsand from 000 through 127 in the CPM1/CPM1A/SRM1(-V2) PCs.DescriptionCNT is used to count down from SV when the execution condition on the countpulse, CP, goes from OFF to ON, i.e., the present value (PV) will be decremented by one whenever CNT is executed with an ON execution condition for CPand the execution condition was OFF for the last execution.