How can you set the time of an S7-300 via Industrial Ethernet?
Instructions:Generally you have two options for this. You can do this either with a CP343-1 IT or a different CP (e.g.: CP343-1) and use S7 communication or UDP communication.
- Here you should always use a CP343-1 IT (6GK7343-1GX20-0XE0) as communications processor, because it sets the time of the CPU via the SIMATIC procedure or via the NTP (Network Time Protocol).
- If you don't have a CP343-1 IT (6GK7343-1GX20-0XE0), then proceed as described below:
You need an S7-400 (time synchronized, e.g. via SICLOCK) which as time master provides the time to S7-300 via relevant block calls, e.g. PUT (S7 communication PUT, see point A) or AG_LSEND/AG_LRECV (UDP communication, see point B).
Configuration with SICLOCK as time master.
- Example for setting the time in an S7-300 with S7 communication
|1||First configure a data block with the structure "DATE_TIME" for reading the CPU basic time in the S7-400.|
|2||Read out the basic time of the CPU using SFC1 ("READ_CLK"). Fig. 03 shows the function call with SFC1 "READ_CLK"|
|3||Transfer the time into a target area of the S7-300 using the S7 function call "PUT".|
A sample program for S7 communication is available in Entry ID: 1819293.
|4||Set the time in the S7-300 with the values transferred. Fig. 04 shows the function call SFC0 "SET_CLK".|
- Example for setting the time in an S7-300 with UDP communication
|1||Read out the CPU basic time in the S7-300 (as described under A).|
|2||Configure a connection for the UDP communication. Configuration instructions for UDP connections are available in Entry ID: 19065614.|
|3||In the S7-300 you program the block AG-LRECV (FC60). For S7-400 the block AG_LSEND (FC50).|
A detailed sample program is available in Entry ID: 18513371.
|4||Set the time in the S7-300 with the values transferred (as described under A).|
The NTP procedure (network time protocol) is also supported by the CPU's integrated interfaces and the distribution for Send/Receive can be implemented with the integrated interfaces and also with every other Industrial Ethernet CP.