RTCΒΆ

Provided by Standard Library.

Timer function block RunTime Clock, returns, starting at a given time, the current date and time.

Inputs:

EN : BOOL; At a rising edge starts counting up the time in CDT.

PDT : DATE_AND_TIME; Date and time from which the counting up should be started.

Outputs:

Q : BOOL; Is TRUE as long as CDT is counting up.

CDT : DATE_AND_TIME; Current state of counted date and time.

VarBOOL2:=RTC(EN, PDT, Q, CDT) means:

When EN is FALSE, the output variables Q and CDT are FALSE respectively DT#1970-01-01-00:00:00.

As soon as EN becomes TRUE (rising edge), the time given by PDT is set, is counted up in seconds and returned in CDT as long as EN is TRUE. As soon as EN is reset to FALSE, CDT is reset to the initial value DT#1970-01-01-00:00:00.

Example in IL:\ \ \ \

../_images/5321ef1f1e8f82e9c0a8640e01947982

Example in FBD:\ \ \ \

../_images/78a7459f1e8f823cc0a8640e01947982

Example in ST:\ \ \ \

RTC(EN:=VarBOOL1, PDT:=DT#2006-03-30-14:00:00, Q=>VarBOOL2, CDT=>VarTimeCur);