B.4 Operating Hours Counter - Siemens CP-8000 User Manual

Sicam a8000 series
Hide thumbs Also See for CP-8000:
Table of Contents

Advertisement

B.4
Operating Hours Counter
A clock pulse generator (TCLK_PULSE) is running with a frequency of 30s logical
logical 0. The edge change from
(CTU_COUNTER.CU) and the counter will be incremented with 1 per minute.
The sum of the operating hours results of two values:
·
Current counter score (CTU_COUNTER.CV)
·
Counter score before the last power down (MR_DINT_MINUTES)
The score will be saved in a retaining flag (M_DINT_MINUTESOLD). This means, after a
power down (startup) the counter will continue with incrementing based on the last value.
The hours result by minutes devided by 60. The hours always will be recalculated based on
the minutes, the same after a power down.
PLC_RESET:
LD
10
ST
PLC_CYCLETIME
PLC_INIT:
LD
MR_DINT_MINUTES
ST
M_DINT_MINUTESOLD
PLC_START:
(*Operating hours counter*)
LD
PLC_SYSTIME.SEC
ST
M_DINT_SEC
LD
M_DINT_SEC
EQ
0
ST
CTU_COUNTER.CU
CAL
CTU_COUNTER
LD
CTU_COUNTER.CV
ST
ADD.IN0
LD
M_DINT_MINUTESOLD
ST
ADD.IN1
CAL
ADD
ST
MR_DINT_MINUTES
ST
DIV.IN0
LD
60
ST
DIV.IN1
CAL
DIV
ST
M_DINT_HOURS
To reset the counter score it is necessary to reset the counter (CTU_COUNTER.R) as well as
the flag with the retained value (M_DINT_MINUTESOLD).
SICAM A8000 / CP-8000 • CP-8021 • CP-8022 Manual
DC8-037-2.02, Edition 10.2017
0
to
1
is switched to the CU Input of the upward-counter
(*cycle time in ms*)
(*load power-fail safe value*)
(*freeze in a flag as old value*)
(*fetch second value of the system time*)
(*and store in variable*)
(*current second*)
(*compare with second 0*)
(*HIGH always at the second 0, required*)
(*edge detection is implemented within*)
(*the counter*)
(*increments the counter*)
(*load current counter score*)
(*store at input 0 for ADD function*)
(*load old value*)
(*store at input 1 for ADD function*)
(*call ADD function*)
(*store sum of operating minutes in a*)
(*retaining flag, after startup the*)
(*old value will be added to the*)
(*current counter score*)
(*store at input 0 for DIV function*)
(*load constant for 60 minutes*)
(*store at input 1 for DIV function*)
(*call DIV function*)
(*sum of operating hours = minutes*)
(*divided by 60*)
Unrestricted
Examples for Instruction Lists (IL)
1
and 30s
547

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cp-8021Cp-8022

Table of Contents