RTC (FB)ΒΆ
FUNCTION_BLOCK RTC
Calculates the elapsed time since a given start time
Usage Examples:
This function block can be used as an operation hour counter, when
PDTis set toDT#1970-01-01-00-00:00, or is simply not connected.This function block can be used to return the current date and time, by adjusting the FB to the current local time. Just, set the input
PDTto the current local time, on the rising edge ofEN.
Bemerkung
This counter will have an overflow at the 7th February, 2106.
(* Example in ST *)
RTC(EN:=VarBOOL1, PDT:=DT#2006-03-30-14:00:00, Q=>VarBOOL2, CDT=>VarTimeCur);
- InOut:
Scope
Name
Type
Comment
Input
ENBOOLRising edge:CDTis set toPDTandCDTstarts increasing.Falling edge:CDTis set toDT#1970-01-01-00:00:00.PDTDTPreset date and time
Output
QBOOLTRUEas long asCDTis countingCDTDTDate and time, elapsed since
PDT