Date and time instructions
295
Part II IEC Instructions
SET_RTC_DT
Set the Real-Time Clock
PLC types Availability of SET_RTC_DT (see page 1330)
Data type I/O Function
DATE_AND_TIME input date and time
Description
SET_RTC_DT sets the real-time clock value in the PLC for the clock/calendar function. If the PLC
has no real-time clock or if the real-time clock is not functioning, the result is an invalid date and
time value.
Data types
Example
In this example the function has been programmed in ladder diagram (LD) and structured text (ST).
POU header
All input and output variables used for programming this function have been declared in the POU
header.
LD
ST
When programming with structured text, enter the following:
IF DF(bSetEdge) THEN
SET_RTC_DT(DT_value);
END_IF;