![Tecomat TC600 Series Скачать руководство пользователя страница 76](http://html1.mh-extra.com/html/tecomat/tc600-series/tc600-series_manual_1072620076.webp)
Tecomat TC600
TXV 138 08.02
76
10.5.9 Servicing of the Type 3 Counter
Declaration of the counter is performed by the directive
#unit
with the
general structure according to item 10.5.2. Parameter
INITAB
of directive is
mandatory. The initialization table serves for identification of the counter
type. It contains one item only, constant 5.
#table byte IniCNT = 5
;1 x unidirectional counter
;
#unit 0, 0, Count_600_, 3, 3, Xn, Yn, On, IniCNT
;
Parameter
TYP
of directive
#unit
is input symbolically
Count_600_
or
numerically
$30.
Placement of the state and control word (parameters
Xn,
Yn
) depends on the BM type (on occupation of the scratchpad by images of
inputs and outputs).
In the scratchpad memory, the counter occupies 3 bytes in image of in-
puts, and 3 bytes in image of outputs.
The STAT state word is stored in the image of inputs and the current
state of the counter. If the interrupt is allowed, image of inputs is updated
before the P44 process is executed, if the interrupt is prohibited, it is up-
dated in the cycle loop. Zone with the initial address defined by the pa-
rameter
Z_IN
of directive
#unit
has the following structure:
-
-
-
-
STAT
.3
STAT
.2
STAT
.1
STAT
.0
Z_IN
Less significant byte of the counter value
Z_IN+1
More significant byte of the counter value
Z_IN+2
STAT.0 = 1 - reaching of the maximum counter range (65535) in this cycle
STAT.1 = 1 - reaching of the pre-selection in this cycle
STAT.2 = 1 - reaching of the maximum counter range
The bit is set to zero by the zero level of the RESET signal
or from the ascending edge of bit CONT.4
STAT.3 = 1 - reaching of the pre-selection
The bit is set to zero when the counter overflows, by zero
level of the RESET signal or from the ascending edge of the
CONT.4 bit
STAT.4
- state of the RESET input
Image of outputs contains the CONT control word and the value of the
counter pre-selection. State of bits CONT.5 to CONT.7 is accepted by the
system after writing to the scratchpad, state of other bits in CONT as well as
the pre-selection value, is accepted in the cycle loop, or at termination of
the P44 interrupt process, respectively. Zone with the initial address defined
by parameter
Z_OUT
of directive
#unit
has the following structure:
CONT
.7
CONT
.6
CONT
.5
CONT
.4
-
-
-
CONT
.0
Z_OUT
Less significant byte of the counter pre-selection
Z_OUT+1
More significant byte of the counter pre-selection
Z_OUT+2
Declaration of the
type 3 counter
Declaration example
Servicing of the type 3
counter
Image of inputs
The state word
Image of outputs