Technical data

Table Of Contents
System Software for S7-300/400 System and Standard Functions - Volume 1/2
A5E00709327-01
5-1
5 SFCs for Handling the System Clock
5.1 Setting the TOD with SFC 0 "SET_CLK"
Description
With SFC 0 "SET_CLK" (set system clock), you set the time and the date of the
CPU clock. The SFC 0 call starts the clock. The clock then runs starting from the
set time and set date.
If the clock is a master clock, the CPU also starts to synchronize the time when
SFC 0 is called. You set the synchronization intervals using STEP 7.
Parameter Declaration Data Type Memory Area Description
PDT INPUT DT D,L At the PDT input, you enter the date and time
you want to set.
RET_VAL OUTPUT INT I, Q, M, D, L If an error occurs during the execution of the
function, the return value contains an error
code.
Date and Time
You enter the date and time as data type DT. As an example: for January 15th,
1995, 10:30 a.m. and 30 seconds you would enter: DT#1995-01-15-10:30:30. The
time can only be entered with a precision of seconds. The day of the week is
calculated by SFC 0 "SET_CLK" from the date.
You can create the data type DT with FC 3 "D_TOD_DT" (see time-of-day
functions: FC 1, FC 3, FC 6, FC 7, FC 8, FC 33, FC 34, FC 35, FC 40).
Error Information
Error Code (W#16#...) Explanation
0000 No error
8080 Error in date
8081 Error in time
8xyy General error codes, see Evaluating Errors with Output Parameter
RET_VAL