show the entry list
WinCC flexible ES -- Creating HMI configurations -- Synchronizing date and time
What settings are to be made in Windows 7 in order to change the system time of the PC by means of WinCC flexible Runtime/WinCC Runtime Advanced?
How can you calculate the actual local time (summer time or winter time) in the S7-300/400 CPU and then use it on the panel as system time?
How do you synchronize the data and time between a SIMATIC HMI panel and a SIMOTION controller?
How do you synchronize date/time between a TP170A / TP170micro / TP177micro and an S7-200 CPU with WinCC flexible?
How do you synchronize the date and time between a TP170A and the S7-300/S7-400 controller with WinCC flexible?
How do you synchronize the date and time between an operator panel and an S7-300/S7-400 controller with WinCC flexible?
How do you synchronize the system clock between a Windows-based panel and an S7-200 CPU with WinCC flexible?
How do you do the summer/winter time switchover with WinCC flexible (update to version V1.1)?
How do you change the date format in WinCC flexible?
Touch Panel / Operator Panel -- Creating HMI configurations -- Setting and editing date and time
How do you do the summer/winter time switchover with WinCC flexible (update to version V1.1)?
How do you synchronize the system clock between a Windows-based panel and an S7-200 CPU with WinCC flexible?
How do you synchronize the system clock between a Windows-based panel and an S7-200 CPU with ProTool?
How do you synchronize date/time between a TP170A / TP170micro / TP177micro and an S7-200 CPU with WinCC flexible?
How do you synchronize the date and time between a TP170A and the S7-300/S7-400 controller with WinCC flexible?
How do you synchronize the date and time between a Windows-based operator panel and the S7-300/S7-400 controller with ProTool?
How do you synchronize the date and time between an operator panel and an S7-300/S7-400 controller with WinCC flexible?
How do you change the date format in WinCC flexible?
How do you synchronize the date and time between a TP170A and the S7-300/S7-400 controller with WinCC flexible?
Part number:

Instructions:
The TP170A has an unbuffered system clock should therefore be synchronized at regular intervals with the controller's system clock.

There are two options for synchronizing the system time between the TP170A and an S7-300 or S7-400.

Note:
The two methods of transferring date and time between the TP170A and an S7-300/400 controller are available for downloading at the end of this entry implemented in a STEP 7 project (Attachments 1 and 2).

If the system clock is to be synchronized between a panel and an S7-300/400, you need the "Date/time PLC" area pointer.

Area pointer "Date/time PLC":
The "Date/time PLC" area pointer is for synchronizing the system clock in the PLC and the system clock in the operator panel. Synchronization is periodic depending on the acquisition cycle.

Transferring the CPU system time to the TP170A

You can synchronize the system time on the TP170A, which is used for time stamping incoming operation and error messages among other things, to the system time of the controller using the "Date/time PLC" area pointer. The project for this example is in Attachment 1 at the end of this entry.

  1. Creating the data area for the "Date/time PLC" area pointer in a data block in the controller (DB1)

    In the controller you define a data area consisting of one "DATE_AND_TIME" tag and four tags of the "BYTE" type. For later configuration of the area pointer in the TP170A it is useful to organize this data area in a structure.


    Fig. 01
     
  2. Cyclic transfer of the controller's system time to the data area defined

    You transfer the controller's system time in a one-second cycle to the "DATE_AND_TIME" tag already defined. You can do this in a cyclic interrupt OB such as OB35 or OB32 using the system function SFC1 "READ_CLK".


    Fig. 02

    Note:

    Connection of a DB pointer, for example, to the "CDT" parameter is only symbolically possible.
     
  3. Installing the "Date/time PLC" area pointer in WinCC flexible
    Insert the "Date/time PLC" area pointer and then interconnect it with the structure created in the controller. Via the Acquisition Cycle you define the interval at which the system time in the TP170A is updated with the current system time of the S7 CPU. It is recommended to set an acquisition cycle of at least 10 seconds.


    Fig. 03

    Note:
    The "Date/time PLC" area pointer is available for all Windows-based operator panels, i.e. this type of time synchronization can also be implemented with the other Windows-based panels as well as with the TP170A.

     
  4. Configuring the date/time field
    You can have the current system time of the TP170A displayed in a WinCC flexible picture via the date/time field (display: Display date / Display time activated) with the "Display system time" property and "Output" mode.


    Fig. 04
     

Note:
Note that in the case of changing the system clock via the panel the update time can take several seconds. This depends on the baud rate and the acquisition cycle among other things.

Note:
More information on time synchronization between operator panel and S7 CPU is available in the manual "WinCC flexible Communication Part 1" in Entry ID: 18797552.

Transferring a user-defined system time to the S7 CPU and TP170A

The function block "** SYS_CLK_TP170A" in Attachment 2 at the end of this entry synchronizes the controller's system clock periodically with the display device. The panel's and the controller's system clocks can also be set.

Below is an explanation of how to synchronize between the controller and WinCC flexible using the "** SYS_CLK_TP170A" block.

  1. Importing the "** SYS_CLK_TP170A" block into the STEP 7 project

    Once you have imported the block you generate the associated instance data block of the function block. Connect the "IO_SetTime" block parameter for setting the S7 CPU's system clock with a marker, e.g. M10.0.


    Fig. 05
     
  2. Configuring the area pointer in WinCC flexible
    Insert the "Date/time PLC" area pointer in your WinCC flexible project by defining the connection and the address. For the area pointer use the same data area defined in the generated instance data block.


    Fig. 06

    The memory area for the "Date/time PLC" area pointer is reserved as from address 10.0 of the instance data block. The area pointer contains at least 6 words so that you need another four bytes in addition to the DATE_AND_TIME data type.

    Note:
    The last four bytes of the area pointer must be in the data area to ensure a data format match with WinCC flexible and to avoid reading the wrong data. The DATE_AND_TIME data type makes the symbolic connection of the area pointer in WinCC flexible possible.

    Insert the "Date/time PLC" area pointer in your WinCC flexible project by defining the connection and the address.
     

    Fig. 07

    Via the Acquisition Cycle you define the interval at which the system time in the TP170A is updated with the current system time of the CPU It is recommended to set an acquisition cycle of at least 10 seconds.
      
  3. Configuring tags in WinCC flexible

    In WinCC flexible you create the "SetTime" tag of the BOOL type and the "DateTime" tag of the DATE_AND_TIME type. For the first tag use the same memory area that you defined in Point 1 (e.g. M10.0). The memory area of the second variable is already integrated in the instance data block as from address 2.0 (see Fig. 06).


    Fig. 08
     
  4. Configuring the date/time field
    You can have the current system time of the TP170A displayed in a WinCC flexible picture via the date/time field (display: Display date / Display time activated) with the "Display system time" properties and the "Output" mode.


    Fig. 09

    You can also input the current system time via an input field. However, you must not select the option "Display system time", but use a tag of the DATE_AND_TIME type. In Point 3 you have already created the relevant "DateTime" tag for setting the system time. Select the "Input / output" display mode for entering the system time.
     
  5. Adding the button for setting the system clock

    You can realize setting of the system clock via a button under the "Press" event using the "SetBit" system function.


    Fig. 10

    Use the "SetTime" control tag that you have already created in the tag editor. The control tag is reset in the block after the system clock has been set. Periodic synchronization of the panel's system clock is done automatically by integrating the "Date/time PLC" area pointer.

Note:
Note that in the case of changing the system clock via the panel the update time can take several seconds. This depends on the baud rate and the acquisition cycle among other things.

Note:
More information on time synchronization between operator panel and S7 CPU is available in the manual "WinCC flexible Communication Part 1" in Entry ID: 18797552.

Downloading the STEP 7 projects with the integrated WinCC flexible project:
Copy the "Time_TP170A_flexible_Ax.zip" file into a separate directory and unpack the file. Then you can use the SIMATIC Manager to open and if necessary edit the STEP 7 project with integrated HMI station. You can open the integrated WinCC flexible project with WinCC flexible 2005 SP1 (as from the Compact Edition).

Note:
Service Pack 1 for WinCC flexible 2005 is available for free downloading in Entry ID: 23059737 .

Download:
The download in Attachment 1 contains the blocks described above for transferring the CPU system time to the TP170A.

Attachment 1: Time_TP170A_flexible_A1.zip ( 5416 KB )

The download in Attachment 2 contains the blocks described above for transferring a user-defined system time to the CPU and the TP170A.

Attachment 2: Time_TP170A_flexible_A2.zip ( 2518 KB )

Runnability and test environment:
The following table lists the components that have been used to create this entry and verify the functions described.
 
Components Product and version designation
PC operating system Microsoft Windows XP SP2
Standard tools -
Engineering tool STEP 7 V5.3
HMI software WinCC flexible 2005 SP1
HMI system -

Keywords:
Setting time, Synchronize, Windows-based devices, WinCE, Windows CE

 Entry ID:24106357   Date:2006-10-30 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour