DUEMMEGI
MCP 4 – User's manual
Contatto
All counters of MCP4 are in 16-bit format, thus the content of each counter is in the range 0 to 65535.
For the counter function, the following options can be also specified:
➢
AUTORESET/AUTORELOAD
➢
MIN
➢
MAX
➢
Cn,R
copy the counter value to a register (with same identifier)
➢
Variable parameters
The syntax allowing to specify these options is the following (
Vx
may be any allowed point):
Vx
=
Cy,
R > 30, AR, MIN, MAX .........
where:
•
R
means that the counter value is continuously copied in a register (with the same identifier)
•
AR
is the (optional) value for the autoreset and the autoreload, in order to make possible the
automatic zeroing and the automatic loading of the counter: when the forward counting exceeds the
value
AR
, then the counter wil be automatically zeroed, while when the backward counting decrease
below the value 0, then the counter will be automatically reloaded with the value
AR
. This value can
be also the content of a register (see the examples in the following).
Note
: if the autoreset/autoreload
value has not been specified, then the counting will be stopped to 0 (when down counting) and at the
maximum allowed value (when up counting), thus avoiding the underflow or the overflow of the counter.
•
MIN
is the minimum value that can be assumed by the counter; the default value is 0
•
MAX
is the maximum value that can be assumed by the counter; the default value is 65535
The values for the threshold, autoreset, minimum, maximum, step and preset can be also the content of
registers (see the examples in the following).
If one of the options
AR
,
MIN
and
MAX
has been omitted, the default value will be assumed. The described
options must be however separated by commas as in the following examples.
Examples:
V1
=
C0
>300 S(2)
I1.1
& S(-1)
I1.2
Up counting step 2, Down counting step 1, V1 goes
ON when counter is greater than 300.
V1
=
C0
>30,50 S(1)
I1.1
& S(-1)
I1.2
Autoreset/Autoreload: when counter exceeds 50, it is
reset to zero; when the counter goes below zero, it is
reloaded to 50.
V1
=
C0
>30,,5,50 S(1)
I1.1
& S(-1)
I1.2
MIN and MAX: the up counting is stopped to 50 and
the down counting is stopped to 5.
V1
=
C0
>3,5,1 S(1)
I1.1
& S(-1)
I1.2
Autoreset/Autoreload and MIN: when counter
exceeds 5, it is reloaded to 1; when the counter goes
below 1, it is reloaded to 5.
V15
=
C10
,R > 100 S(1)
I1.1
& S(-1)
I1.2
\
Copy Counter to Reg: the value of C10 is copied
& PL(0)
I1.3
to register R10.
V10
=
C1
>
R0
,
R1
,
R2
,
R3
S(
R4
)
I1.1
\
Variable parameters.
& P(
R4
)
I1.3
DUEMMEGI
s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/55213686 –
www.duemmegi.it
Rel.: 1.2 October 2018
Page 19 of 87