Time and Sync

SUMMARY

This document gives information to System Time and Syncronisation.

CONTENTS

  1. System Time
  2. Synchronization

System Time

Like the original SIMATIC S7 the SoftPLC7 has an internal clock too. On start-up it gets the time from the PC. Depending on the setup "[Startup] S7Clock=..." in the 'SoftPLC.ini' it runs on LT (Local Time) or UT (Universal Time).

After the SoftPLC7 started the system time of the SoftPLC7 can only be read or modified via the system functions SFC 0 'SET_CLK' and SFC 1 'READ_CLK' or the pull-down menu 'Extras' item 'Date and time'.

Synchronization

Having more SoftPLC7s, one may be defined as master. Such a master CPU sends its own time periodically.
It is recommended to choose a Multicast-Address as IP-Address: Range 224.0.1.0 to 239.255.255.255.
By using Multicast-Addresses sub networks can be created with the advantage that different test pools does not interfere with each other.
Any SoftPLC7 to receive time information from a Master-CPU has to be defined as a Slave.


Example:
In a network of 4 CPUs:
CPU1 should synchronize CPU2 and CPU3, CPU4 should run independent.

The following entries has to be made in the relevant SoftPLC7.ini files

For CPU1:

[CPUSync]
IP=255.1.2.3 (or any other free Multicast-Address)
Port=2000
Type=M       (Master)
Cycle=500    (a telegram is send every 500 ms)
                  
For CPU2 and CPU3:
[CPUSync]
IP=255.1.2.3 (must match with that of CPU1)
Port=2000    (must match with that of CPU1)
Type=S       (Slave)
Cycle=       (not relevant)
                  
For CPU4:
No inputs
                   


If a CPU is defined as a master, time synchronization can be done via SFC48.

Via pull-down menu 'Extras' item 'Time synchronisation..' the settings may be checked, as well as the number of sent and received time-telegrams.