
285
Timer and Counter Instructions
Section 3-6
Example 1:
Long-term Timers
The following program examples show three ways to create long-term timers
with standard TIM and CNT instructions.
Two TIM Instructions
In this example, two TIM instructions are combined to make a 30-minute
timer.
TIM and CNT Instructions
In this example, a TIM instruction and a CNT instruction are combined to
make a 500-second timer.
TIM 0001 generates a pulse every 5 s and CNT 0002 counts these pulses.
The set value for this combination is the timer interval
×
counter SV. In this
case, the timer SV would be 5 s
×
100 = 500 s. With this combination, the
long-term timer’s PV is actually the PV of a counter, which is maintained
through power interruptions.
Clock Pulse and CNT Instruction
In this example, a CNT instruction counts the pulses from the 1-s clock pulse
to make a 700-second timer.
If the First Cycle Flag (A20011) is ORed with the counter’s reset input
(CIO 000001), the counter’s PV will be reset to the SV (0700) when program
execution begins rather than resuming the count from the previous PV.
000000 LD
000000
000001 TIM
0001
#9000
000002 LD
T0001
000003 TIM
0002
#9000
000004 LD
T0002
000005 OUT
000200
000000
T0001
T0002
Instruction Operands
Address
000000 LD
010000
000001 LD
000001
000002 CNT
0002
#0100
000003 LD
000000
000004 AND
NOT 010000
000005 AND
NOT C0002
000006 TIM
0001
#0050
000007 LD
T0001
000008 OUT
010000
000009 LD
C0002
000010 OUT
000201
Instruction Operands
Count up
Address
Start
Содержание SYSMAC CS Series
Страница 2: ......
Страница 4: ...iv ...
Страница 30: ...xxx ...
Страница 186: ...146 List of Instructions by Function Code Section 2 4 ...
Страница 194: ...154 3 35 4 MOVE BIT MOVBC 568 1273 3 35 5 BIT COUNTER BCNTC 621 1275 3 35 6 GET VARIABLE ID GETID 286 1277 ...
Страница 1320: ...1280 Model Conversion Instructions Unit Ver 3 0 or Later Section 3 35 ...
Страница 1390: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...
Страница 1391: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits ...
Страница 1392: ...1352 ASCII Code Table Appendix A ...
Страница 1404: ...1364 Revision History ...