How do you synchronize time/date between a SIMATIC HMI panel and a SIMOTION controller?
Date and time synchronization between ProTool and SIMOTION Scout takes place via external tags. The SIMOTION system time is read out cyclically in a SIMOTION program and transferred into ProTool via the configured tags. Synchronization takes place via script functions in both directions.
Create a SIMOTION project:
Creating/importing a structured program in SIMOTION:
|3||Create global tags and program:|
Global tags are required for data exchange between ProTool and the SIMOTION Scout. The system time can be read or set with the aid of the ReadClock and SetClock functions which are created.
ReadClock( FALSE, TRUE, DT#2005-01-01-0:0:0 );
|4||Define the program call in the runtime system:|
The program which is created in or imported into SIMOTION Scout also has to be defined as a background task in the execution system.
You can then compile your SIMOTION configuration and transfer it to the SIMOTION device.
|5||Create a SIMOTION connection in ProTool:|
The connection with the SIMOTION device must be defined in ProTool.
Create "Controllers" in the project tree (1) by double-clicking a new connection and selecting the "SIMOTION V6.0" driver. Click the "Parameters..." button (2) in the selection window.
The "Connect OP to network" dialog window now opens. In it select the PROFIBUS subnet (3) to which the panel is connected as hardware. The select the SIMOTION device in the selection field (4) "Choose a communication peer/symbol list".
|6||Add variables for time synchronization:|
Create all the requisite tags in the project tree under "Tags":
|7||Create a script:
The system time of the panel can be changed via the (CMD) console with the "Date" and "Time" operating system functions in Windows. The Windows console is called via the script functions "Call" and "Start_PtFct.Program".
Description of the "Start_program" function:
PtFct.Start_Program (<ProgName>, <Param>, <Layout>, <Wait>)
Create a further script:
The "Now" function delivers the current system date and time for the panel or PC.
|9||Create pictures and objects:|
Create two buttons, two date-time fields, as well as (optionally) an alarm view with system messages as an alarm event in a new picture.
The alarm view is merely used as a configuration aid. Among other things, the system message, which must be explicitly configured, appears in this display to indicate whether the SIMOTION device is connected to the panel.
Then connect the upper date/time field to the "Uhr.time_plc" tag which you created previously. Select the "System Time" in the lower date/time field.
|11||Link the script to the buttons:
You can now transfer the configuration to the panel or start the PC runtime.
Uhr.zip ( 508 bytes )
Download the sample project:
The packed file contains the SIMOTION ProTool project which is described in the instructions. The ProTool project requires ProTool version V6.0 SP3.
Simotion_ProTool.zip ( 450 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|
|PC operating system||Microsoft Windows XP SP2|
|Engineering Tools||SIMOTION Scout V 3.2.1|
|HMI Software||ProTool V6.0 SP3|
Date synchronization, Time synchronization