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?
STEP 7 Micro/WIN -- System wide configuration -- Synchronizing time
How are the date and time of the S7-200 CPU displayed on a TP170A connected to it?
How do you synchronize date/time between a TP170A / TP170micro / TP177micro 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 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 time/date between a TP170A and an S7-200 CPU with ProTool?
How do you synchronize the date and time between a line or graphics device (TD17, OP5, OP7, OP15, OP17, TP27, OP27, TP37, OP37) and an S7-200 CPU with ProTool?
How do you synchronize the date and time between an OP3 and an S7-200 CPU?
Mobile Panels -- 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 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?
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?
Multi Panel -- Creating HMI configurations -- Setting and editing date and time
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 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 system clock between a Windows-based panel and an S7-200 CPU with WinCC flexible?
Part number:

Instructions:
There are two options for synchronizing the system clock between a Windows-based panel and an S7-200 CPU:

The two methods of transferring date and time between the Windows-based panel and an S7-200 controller are available for downloading at the end of this entry. The two downloads contain two WinCC flexible projects and the associated library.

Warning:
You cannot apply the information in this entry to operator panels TP170A, TP170micro and TP177micro. Information on time synchronization between a TP170A, TP170micro and TP177micro and the S7-200 with WinCC flexible is available in Entry ID: 19323674.

1. Transfer of the CPU system time to the Windows-based panel
You can synchronize the system time on the panel, which is used for time stamping incoming operation and error messages among other things, to the system time of the controller using the area pointer "Date/time PLC" (Fig. 02).
 
No. Procedure
1 Add "READ_RTC" function
In order to be able to read out the system time of the S7-200 you need the "READ_RTC" block from the "Instruction" project tree structure of STEP 7 Micro/WIN.

In your STEP 7 Micro/WIN program you call the "READ_RTC" function for reading the system time. You assign the address of the area pointer to the T parameter.


Fig. 01

2 Create area pointer in the WinCC flexible project
Insert the "Date/time PLC" area pointer by parameterizing the area pointer's connection in the "Area pointer" tab (Fig. 02).
Then define the initial address, e.g. "VB 0", of the area pointer, in which the system time is to be transferred from the S7-200 to the panel.

Via the Acquisition Cycle you define the interval at which the system time in the operator panel is updated with the current system time of the CPU. It is recommended to set an acquisition cycle of at least 10 seconds.


Fig. 02

3

Add date/time field
Display of the current system time on a Windows-based panel can be done via a date/time field (display: Display date / Display time activated) with the "Display system time" property and "Output" mode in a WinCC flexible picture.


Fig. 03

4

Project transfer
Transfer the STEP 7 Micro/Win project to the S7-200 CPU and the WinCC flexible project to the panel, or use the WinCC flexible Runtime.


Fig. 04

2. Transfer of a specified system time from the Windows-based panel to the CPU and the panel

There are two different procedures for synchronizing between a SIMATIC S7-200 controller and a WinCE operator panel.

It is recommended to use the synchronization procedure with the "Date/Time PLC" (Option 2).

Option 1 - Synchronization without "Date/time PLC" area pointer
With this synchronization option without "Date/time PLC" area pointer synchronization is done by controller jobs.

For this synchronization option between operator panel and S7-200 controller you can use the "Time_WinCE" block that is available for downloading in Attachment 1.

This synchronization option requires the two area pointers "Controller Job" and "Date/Time" for synchronizing the system time between a Windows-based panel and the S7-200 controller in WinCC flexible.

  • Area pointer "Job mailbox":
    The "Job mailbox" area pointer is for executing controller jobs. The controller job is specified via the the job number that is entered in the first data word of the "Job mailbox" area pointer. You can specify up to three parameters per job. Transfer of the CPU system time to the Windows-based panel is done with controller job 14 (set time) and controller job 15 (set date). Controller job 40 or 41 transfers the date/time from the operator panel to the controller.
  • Area pointer "Date/time":
    The "Date/time" area pointer is required for executing controller job 40 or 41. Controller job 40/41 reads the current date/time from the operator panel and writes the data to the "Date/time" data area in the controller.

Warning:
The "Job mailbox" and "Date/time" area pointers must lie directly next to each other in the memory area, i.e. first "Job mailbox" and then "Date/time" so that the STEP 7 Micro/WIN block made available can be used.

The following table shows how the implemented global data of the "Time_WinCE" block is divided. The initial address - here VB0 is selected - depends on the defined memory area of the library block (see Fig. 04).
 

Data area

Area pointers

Other data

Length

Global data

VB0 - VB7 Controller job - 4 words X
VB8 - VB19 Date/time - 6 words X
VB20 - VB26

-

System time of PLC 4 words X
Table 01

Sample memory occupancy of the area pointers "Job mailbox" (VB0-VB7) and "Date/time" (VB8-VB19):


Fig. 05

The PLC system time is also realized via the global data (VB20-VB26) of the "Time_WinCE" block. The data area depends on the defined memory area of the library block (see Fig. 04).

In the following we explain the configuration of the "Time_WinCE" block for synchronizing between S7-200 and operator panel.
 
No. Procedure
1 Import the "Time_WinCE" block into the STEP 7 project
Import the library in STEP 7 Micro/WIN (Attachment 1).  Information on inserting libraries in STEP 7 Micro/WIN is available in Entry ID: 16689345.

Define the global memory area for the synchronization area by opening "File > Library Memory...". Select the "Time_WinCE" block and enter the initial address, e.g. "VB 0".


Fig. 06

2 Add the "Time_WinCE" block to the "MAIN" program
Integrate the time synchronization block into the program (e.g. "MAIN (OB1)") and define the parameters (variables) for the block. You activate the block via the input "EN" that must be interconnected in the S7-200 program, e.g. with "LD SM0.0".
 
Tag Parameter Parameter type
M1.0 CLOCK_TO_OP Input/Output
M1.1 READ_RTC Input/Output
M11.0 CLOCK_TO_PLC Input/Output
M11.1 SET_RTC Input/Output
M0.1 Memory Input/Output
Table 02 - Parameters of the "Time_WinCE" block

Time synchronization between operator panel and CPU is triggered via the input parameters "CLOCK_TO_OP" and "CLOCK_TO_PLC", which are WinCC flexible tags.

The parameters "READ_RTC" and "SET_RTC" on the block (see Fig. 05) are required for processing the block. You must reserve these two bits for the block and must not use them in any other way in the program. The "Memory" parameter is required for internal operations.


Fig. 07

3 Create area pointers
Activate the two area pointers "Date/Time" and "Job Mailbox" in your WinCC flexible project. For both area pointers use the same data area that you used for the block's global data in STEP 7 Micro/Win (Fig. 06 and Table 01).

Note:
Make sure that the data areas of the two area pointers "Job mailbox" and "Date/time" of the "Time_WinCE" block are directly next to each other.


Fig. 08

4 Create tags
In WinCC flexible you define two tags of the "Boolean" data type, with which the time synchronization is to be triggered.

You also have the option of having the the PLC system time displayed on the operator panel via the global data of the Micro/Win library. The tag addresses depend on the address area of the library - see Table 01 and Fig. 06.


Fig. 09

5

Add buttons
By configuring two buttons you can set and reset the two tags. The "CLOCK_TO_OP" tag only has to be set in WinCC flexible, because this tag is reset by the controller. In contrast, the "CLOCK_TO_SPS" tag must be set explicitly for the "Print" event and reset when the key is released.


Fig. 10

6 Configure date/time field
Input of the current system time on a Windows-based panel can be done via a date/time field (display: Display date / Display time activated) with the "Display system time" properties and the "Input / Output" mode.


Fig. 11

7 Optional: Job scheduler
If you wish to match the controller's current system clock with the system clock automatically, you can use the "SetBit" system function to have the WinCC flexible tag "Clock_TO_SPS" updated/synchronized every minute, for example, in the WinCC flexible job scheduler. 


Fig. 12

Synchronization can be triggered by setting a marker by pressing a key. Controller jobs 40 and 41 are available for transferring the date and the time from the operator panel to the controller. The two controller jobs read the current date / current time from the operator panel and write them to the defined data area in the controller (area pointer: "Date/time). The controller's clock is then set with the data transferred via the "SET_RTC" system function.

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 among other things.

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

Option 2 - Synchronization with "Date/time PLC" area pointer

When synchronizing time with an area pointer, synchronization is done periodically without having to do much configuration.

If you want to synchronize the system clock between a panel and an S7-200 and you also want to change the system time via the panel, you use the "Timesync_WinCE" block that is contained in Attachment 2 at the end of this entry.

For this synchronization procedure you need three area pointers and the controller job 41 when implementing the "Timesync_WinCE" library block.

  • 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.
  • Area pointer "Date/time"
    The "Date/time" area pointer is required for executing controller job 40/41. Controller job 40/41 reads the current date/time from the operator panel and writes the data to the "Date/time" data area in the controller.
  • Area pointer "Job mailbox":
    The "Job mailbox" area pointer is for executing the controller jobs. The controller job is specified via the the job number that is entered in the first data word of the "Job mailbox" area pointer. You can specify up to three parameters per job in addition. Only controller job 41 is required to transfer the system time of the operator panel to the controller.

Warning:
When implementing the "Timesync_WinCE" library block that is made available, both data areas of the two area pointers "Date/time PLC" and "Date/Time" must be adjacent.

The following table shows how the implemented global data of the "Timesync_WinCE" block is divided and how the "Job mailbox" area pointer is integrated via the externally configured parameter of the block.
 

Data area

Area pointers

Length

Global data

VB0 - VB11 Date/time PLC 6 words X
VB12 - VB23 Date/time 6 words X
VW26 - VW33 Controller job 4 words -
Table 03 - Global data of the "Timesync_WinCE" block including job mailbox

Sample memory occupancy of the two area pointers "Date/time PLC" (VB0-VB11) and "Date/time" (VB12-VB23):


Fig. 13

In the following we explain the implementation of the "Timesync_WinCE" block for synchronizing between S7-200 and panel.
 
No. Procedure
1 Import the "Timesync_WinCE" block into the STEP 7 project
Import the library in STEP 7 Micro/WIN (Attachment 2). Information on inserting libraries in STEP 7 Micro/WIN is available in Entry ID: 16689345.

Define the global memory area for the synchronization area by opening "File > Library Memory...". Select the "Timesync_WinCE" block and enter the initial address, e.g. "VB 0".


Fig. 14

2 Add the "Timesync_WinCE" block to the "MAIN" program
Integrate the time synchronization block into the program (e.g. "MAIN (OB1)") and define the parameters (variables) for the block. You activate the block via the input "EN" that must be interconnected in the S7-200 program, e.g. with "LD SM0.0".
 
Address Parameter

Parameter type

V40.0 I_Set_Time Input
VW26 IO_Task Input/Output
V50.0 IO_Request Input/Output
V50.1 IO_Response Input/Output
M1.0 IO_Memory_1 Input/Output
M1.1 IO_Memory_2 Input/Output
Table 04 - Parameters of the "Timesync_WinCE" block

The tag VW26 used in this example at the "IO_Task" input/output of the "Timesync_WinCE" block is written into the job number of the controller job. Tags V50.0 and V50.1 are for internal updating of the CPU system clock. Markers M1.0 and M1.1 are required for internal operations.


Fig. 15

3 Create area pointers
In your WinCC flexible project you enable or configure the three area pointers "Date/time PLC", "Date/time" and "Job mailbox". For the area pointers use the same data area that you used for the block's global data and "IO_Task" parameter in STEP 7 Micro/WIN (see Fig. 13/14 and Table 02).

Note:
Make sure that the data areas of the two area pointers "Datum/Uhrzeit Steuerung" and "Datum/Uhrzeit" of the "Timesync_WinCE" block are directly next to each other.


Fig. 16

4 Create tags
In WinCC flexible you define three tags of the "Boolean" data type for synchronizing between panel and S7-200 controller. The "Time_To_PLC" tag (V40.0) activates controller job 41 in the PLC and transfers the current system time of the panel to the PLC via the "Date/time" area pointer. You also need the tags "Request" (V50.0) and "Response" (V50.1) of the "Boolean" type.


Fig. 17

5 Configure change of value
After transfer, the "Request" tag (V50.0) is set to High by the PLC. Through the "Change value" property in WinCC flexible under "Events", the "Response" tag (V50.1) is also set to "High" with the system function SetBit. Only then is the system clock of the controller set to the system time of the panel. The two tags are reset in the controller.


Fig. 18

6 Configure date/time field
Input of the current system time on a Windows-based panel can be done via a date/time field (display: Display date / Display time activated) with the "Display system time" properties and the "Input / Output" mode in a WinCC flexible picture.


Fig. 19

Synchronization takes place via the "SetBit" system function of the "Time_To_PLC" tag. Periodic synchronization of the panel's system clock is done automatically by integrating the "Date/time PLC" area pointer.

Notes:

  • 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 among other things.
  • 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.

The STEP 7 Micro/WIN library and the TP170B project as archive file Copy the "Time_WinCE.zip" or the "Timesync_WinCE.zip" file into a separate directory and then unpack the file. You can then integrate the library, which can be used in version V4.0.6.35 and higher of STEP 7 Micro/WIN, into your S7-200 project. You can open the WinCC flexible project with WinCC flexible 2007 (as from the Compact Edition) and edit it as you wish to suit your requirements (e.g. with "Change device").

Information on inserting libraries in STEP 7 Micro/WIN is available in Entry ID 16689345.

Note:

  • For STEP 7 Micro/WIN V4.0 the SP6 is available for downloading free of charge in Entry ID: 27207727 .

Download:
Attachment 1 contains the library with the same name and two sample WinCC flexible projects (OP77B and TP170B) of Option 1.

Attachment 1: Time_WinCE_1_1.zip ( 3642 KB )

Attachment 2 contains the library with the same name and two sample WinCC flexible projects (OP77B and MP277) of Option 2.

Attachment 2: Timesync_WinCE_1_2.zip ( 3605 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
Controller S7-200 CPU 226
Standard tools -
Engineering tools STEP 7 Micro/WIN 4.0.6.35
HMI software WinCC flexible 2007
HMI system OP77B, TP170B, MP277

Keywords:
OP77B, TP170B, TP177A, TP177B, OP170B, MOBILE PANEL 170, MOBILE PANEL 177, MOBILE PANEL 277, TP270, TP277, OP270, OP277, MP270, MP270B, MP277, MP370, MP377, Set date/time, Synchronization, System time

 Entry ID:19322242   Date:2008-03-14 
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 
Topics
Help
Online Help
Guided Tour