show the entry list
ProTool -- System-wide configuration -- Synchronizing time
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 date/time between a line/graphics operator panel (TD17, OP5, OP15, OP17, TP27, OP27, TP37, OP37) and an S7-300/400 controller 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 S7-300/400 and OP3 (C7-621) with ProTool?
How do you synchronize date and time between a TP170A and an S7-300/400 controller 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?
How do you synchronize the system clock between a Windows-based panel and an S7-200 CPU with ProTool?
How are the date and time of the S7-200 CPU displayed on a TP170A connected to it?
How do you synchronize time/date between a SIMATIC HMI panel and a SIMOTION controller?
How does time synchronization work between S5 and a Windows-based operator panel?
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?
Micro Panels -- Creating HMI configurations -- Setting and editing date and time
How do you have specific language character sets (e.g. Cyrillic) displayed in S7-200 Text Displays?
How do you do a multilingual configuration of S7-200 Text Displays?
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?
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 ProTool?
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:
This entry cannot be used for the TP170A. Information on time synchronization between a TP170A and the S7-200 with ProTool is available in Entry ID: 18630804.

1. Transfer of the CPU system time to a Windows-based panel

You can use the area pointer "Date/time PLC" (Fig. 01) to 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.
 
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.
Configuring in STEP 7 Micro/WIN
In your STEP 7 Micro/WIN program you call the "READ_RTC" function for reading out the system time. You assign the address of the area pointer to the T parameter.


Fig. 01

2

Create area pointer in ProTool
Insert the "Date/Time PLC" area pointer by double-clicking "Area Pointers" in the project tree structure (Fig. 01). Then define the initial address, e.g. "VW 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

Note:
Make sure that you have created the right connection before creating the area pointer. The "V" are is only available with the "SIMATIC S7-200 V6.0" protocol.

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: date and time enabled) with the "System time" data source. The parameter under the "Editing permitted" field type should be disabled.


Fig. 03
4 Project transfer
Transfer the STEP 7 Micro/Win project to the S7-200 CPU and the ProTool project to the panel, or use the ProTool Runtime.


Fig. 04

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 "Job Mailbox" and "Date/Time" for synchronizing the system time between a Windows-based panel and the S7-200 controller in ProTool.

  • Area pointer "Job Mailbox":
    The "Job Mailbox" area pointer is for executing controller jobs. The job mail box specifies the controller job via the job number that is entered in the first data word. 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 - depends on the defined memory area of the library block (see Fig. 04).
 

Data area

Area pointers Other data

Length

Global data

VB0 - VB7 Job mailbox - 4 words X
VB8 - VB19 Date/time - 6 words X
VB20 - VB26

-

System time of PLC 4 words X
Table 01 - Global data of the "Time_WinCE" block

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 Importing 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 Adding 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".

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

Note:
This example can be used for all S7-200 CPUs and all Windows-based systems except the TP170A.

3 Create area pointers
Insert the two area pointers "Date/Time" and "Job Mailbox" in your ProTool project. For both area pointers use the same data area that you used for the block's global data in STEP 7 Micro/WIN (see Fig. 06 and Table 01). 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.

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 Creating tags
In ProTool 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 Adding 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: date and time enabled) with the "System time" data source and the "Editing permitted" field type in a ProTool picture.


Fig. 11

7 Optional: scheduler
If you wish to match the controller's current system clock automatically with the system clock, you can use the "Set_bit" system function to the have the ProTool tag "CLOCK_TO_SPS" updated/synchronized every minute, for example, in the ProTool 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 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 synchronizing the time between the operator panel and the CPU is available in the manual "SIMATIC HMI Communication for Windows-Based Systems" in Entry ID: 1405528.

 Option 2 - Synchronization via the "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 Job mailbox 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 Importing the "Timesync_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 "Timesync_WinCE" block and enter the initial address, e.g. "VB 0".


Fig. 14

2 Adding 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.

Note:
The controller job is always only started when there is no controller job present, i.e. the system time of the PLC is not set as soon as another controller job is active.


Fig. 15

Note:
This example can be used for all S7-200 CPUs and all Windows-based systems except the TP170A.

3 Inserting area pointers
Insert the three area pointers "Date/time PLC", "Date/Time" and "Job Mailbox" in your ProTool project. 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 also Fig. 14 and Fig. 15 and Table 03). Via the Acquisition Cycle of the "Date/time PLC" area pointer 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.

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


Fig. 16

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


Fig. 17

5 Configuring 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: date and time enabled) with the "System time" data source and the "Editing permitted" field type in a ProTool 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.

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 synchronizing the time between the operator panel and the CPU is available in the manual "SIMATIC HMI Communication for Windows-Based Systems" in Entry ID: 1405528.

The STEP 7 Micro/WIN library and the ProTool projects 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. From ProTool V6.0 SP 3 onwards you can open the ProTool project and adapt it to your requirements (e.g. with "File > Convert > Start").

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

Notes:

  • 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 the sample ProTool project (TP170B) of Option 1.

Attachment 1: Time_WinCE_1_1.zip ( 27 KB )

Attachment 2 contains the library with the same name and the sample ProTool project (MP270B) of Option 2.

Attachment 2: Timesync_WinCE_1_2.zip ( 31 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 ProTool/Pro V6.0 SP3 HF3
HMI system TP170B, MP270B

Keywords:
MicroWin library, TP170B, OP170B, MOBILE PANEL 170, TP270, OP270, MP270, MP370, Set time/date, System time.

 Entry ID:18644602   Date:2008-03-10 
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