Download User`s Guide Part I

Transcript
CNT
Connect blocks to counter
Format:
CNT counter { preload }
Description:
This instruction takes two logic blocks and connects them to the given 'counter'. The first
block is connected to the 'clock' coil and the second block is connected to the 'reset' coil.
There are eight global PLC counters. An error will be generated if there are not exactly
two logic blocks open at that point in the PLC program.
The optional 'preload' argument sets the counter preload parameter when the instruction
is stored in the PLC. If the preload is not specified, the system parameter remains
unchanged. When the PLC is listed, the CNT instruction will reflect the current counter
preload setting if it has been changed by a direct parameter setting.
A counter decrements once on every rising edge of its clock input until it reaches zero.
The counter produces an output when the count is zero. When the reset input of a
counter is turned on, the counter is reset to its preload value and the output turns off.
Clock inputs are ignored while the reset input is on. Both the current count and preload
are retained in battery backup memory during power down.
When a PLC program is run, the program is scanned to make sure that the individual
counters are not being controlled by multiple CNT instructions. Duplication checks are
only done within a PLC program, not across multiple PLC boundaries. Counter output
contacts can be used any number of times.
Related Information:
The following table outlines parameters and bit flags related to PLC counters. These can
be used by normal programs to control and monitor counters with or without any PLC
programs running. Note that if counters are to be used without PLC programs, the PON
command must still be executed to enable updating of the counters.
Counter
0
1
2
3
4
5
6
7
Table 5.4
420
Preload
P6662
P6678
P6694
P6710
P6726
P6742
P6758
P6774
Count
P6663
P6679
P6695
P6711
P6727
P6743
P6759
P6775
Output
BIT1556
BIT1588
BIT1620
BIT1652
BIT1684
BIT1716
BIT1748
BIT1780
Clock
BIT1557
BIT1589
BIT1621
BIT1653
BIT1685
BIT1717
BIT1749
BIT1781
Reset
BIT1558
BIT1590
BIT1622
BIT1654
BIT1686
BIT1718
BIT1750
BIT1782
PLC counter cross-reference
Acroloop Motion Controller User’s Guide Part I