Operating hours counter
Couldn't load pickup availability
Description
The FB_OperatingHoursCounter function block records current operating hours at hourly intervals based on an active run state ( #Run
). Counting is performed by an internal timer that adds every full hour. Additionally, normally closed and normally closed contacts (13–14 / 21–22) are controlled via enabled inputs to simulate the current run state.
Note: This logic serves as a template. Before productive use, it must be integrated, tested, and approved by qualified personnel. Missing or incorrect integration can lead to incorrect time values or unexpected switching behavior.
How it works
Reset
#Reset
resets the internal hour counter and the accumulation timer. The total operating time ( #Hours
) starts again at zero.
Disabled
If #Enable
is not set, the counting is stopped, the outputs are deactivated, and the block is idle. Timers and contacts are inactive.
Counting operating hours
As long as #Run
is active, the internal accumulation timer runs. After each full hour ( #accTimer.Q
= TRUE), this value is added to #Hours
and the timer is reset to count the next hour.
Contact logic
The simulated contacts transmit the running status, provided the respective enable inputs are set:
-
#NO_13_14
(normally closed) is active when#Run
is running and#Input_13
is enabled. -
#NC_21_22
(normally open) is active when#Run
is not running and#Input_21
is enabled.
Technical details
-
Inputs:
#Enable
,#Reset
,#Run
,#Input_13
,#Input_21
-
Timer:
#accTimer
– Accumulation in hours (1h interval) -
Internal state:
#Hours
– accumulated operating time -
Outputs:
#NO_13_14
(run active),#NC_21_22
(run inactive) -
Status & Diagnosis:
#Error
,#Status
,#DiagnosticCode
- Modes: Reset, Disabled, Running
Possible applications
- Recording machine operating times for maintenance planning
- Visualization of the running status via simulated contacts
- Integration into higher-level control or documentation systems
- Pre-checking and testing runtime conditions without physical sensors
Note: Before productive use, a technical inspection and approval by qualified personnel is required.
compatibility
- Can be used in PLC systems with SCL support (e.g. Siemens TIA Portal)
- Modular integration into process, maintenance and diagnostic architectures
- Simulatable status output without physical contacts through virtual inputs
- Safe basic state when deactivated
Scope of delivery
You will receive:
- An SCL file with the implemented function block FB_BetriebsstundenZaehler
- Complete declaration of all inputs, outputs and timer instances
- Annotated structure for quick integration
- Short guide for integration into an existing PLC project
The download link will be provided after purchase.
Support
I support you with:
- Adaptation of runtime logic and interval definitions
- Integration into maintenance and evaluation systems
- Validation without real operating condition
- Extensions for individual requirements
Contact is possible via shop message or email. Customized adjustments are available as an option.