OperatingHours (FB)¶
FUNCTION_BLOCK OperatingHours
Short Descritpion¶
Counter for operating hours and switch-on procedures
Portrayal¶
Interfaces¶
Inputs¶
Name Datatype
Range
Init-Value
Function
xFb BOOL Counter - input
xReset BOOL FALSE Enable - Input - Reset
Outputs¶
Name Datatype
Range
Init-Value
Function
udiOperatingHours UDINT Counter - output - operating hours
udiCountFb UDINT Counter - Output - Switching on
dtLastFb DATE_AND_TIME Date/time of the end of the last counting process
Functional Description¶
General¶
This function block is used to record the operating hours and switch-on procedures at the counter input xFb.
The outputs udiOperatingHours and udiCountFb are reset to 0 as soon as a rising edge is detected at input xReset.
The counting process is active as soons as the counter input xFb is TRUE.
The output udiOperatingHours shows the cumulated time duration of the time counting process since the last reset operation in hours.
The udiCountFb output is incremented with each rising edge at the xFb input.
The output dtLastFb provides the current date/time during the counting process.
At the output dtLastFb, the date/time at the end of the last counting process is available outside the counting process.
The output dtLastFb outputs the initialization value DT#1970-1-1-1-0.0.0 before the first counting process.
Value ranges of the outputs udiOperatingHours and udiCountFb
Valid counter readings are within the limits 0 and 4294967295.
The incrementation of the counter reading 424294967295 resets the counter reading back to 0.
The counter reading is then incremented again continuously.
Visualization¶
Information¶
Element Authors
Date
Version Notes
Function
Adam Bartod 04.2016 1.0 Initial version
Programming
Adam Bartod 04.2016 1.0 Initial version
Test Jochen Reu 05.2017 1.0 Initial version
Documentation
Jochen Reu 10.2017 1.0 Initial version
Codesys¶
- InOut:
Scope Name Type Initial Comment Input xFb BOOL Counter input, activates the time measurement
xReset BOOL FALSE Reset operation
Output udiOperatingHours UDINT Operating hours
udiCountFb UDINT Activations
dtLastFb DT Date/time of the end of the last counting process