Extra Functions
Section 3-7
55
3-7-2
Initial Counter Value
Every Counter is equipped with the Initial Counter Value (double word) in DM. At
a transfer of the DM-settings from the CPU to the Unit (triggered by a Power Up or
Restart of the Unit) the Initial Counter Value is also transferred. The Initial Counter
Value overwrites the Counter Value and becomes the new Counter Value.
The Initial Counter Value is very useful in case the Power of the PLC-system fails.
If the Power of the PLC-system fails, the application that is controlled by the Coun-
ter Unit will come to rest, and the Counter Values will be reset to zero. After the
system has been Powered Up again, the application has to be reset, since it has
lost the position data with the resetting of the Counter Values.
To overcome this trouble, the Power OFF Interrupt Task of the PLC can be used to
detect the failing system Power. You can use this Power OFF Interrupt Task to pro-
gram a transfer of the Counter Values of every Counter (in CIO) to the correspond-
ing Initial Counter Value of that Counter in DM. The data in DM is retained when
the Power is OFF. Therefore, Powering Up the system again, results in a transfer
of the DM-settings from the CPU to the Unit and the Counter Value is overwritten
by the Initial Counter Value, allowing your application to continue from where it
was at the moment of failing Power.
Note
1. The Power OFF Interrupt Task that takes care of saving the Counter Values to
the Initial Counter Values can also be used to detect a Power OFF that has
been done on purpose.
2. The Initial Counter Value can also be set, independent of a Power Failure, to
load the Counter Value with an Initial Value instead of zero.
3. The Present Value stored by the interrupt task must be used considering the
possibility of a power interrupt to the Encoder and interrupt processing execu-
tion timing.
y
q
15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
CNT3:
CNT4:
m+57
m+77
m+58
m+78
Initial Count Value:
Set between 00000000
H
and FFFFFFFF
H
(Circular Counter)
Set between 80000000
H
and 7FFFFFFF
H
(Linear Counter)
By default the Initial Count Value is equal to 0.
CNT1:
CNT2:
m+17
m+37
m+18
m+38