S7300 Time Synchronisation

Kidblue

Lifetime Supporting Member
Join Date
May 2003
Location
Worcester
Posts
698
Hi all, was wondering if anyone could guide me on how to setup the PLC clock within my project. This is my first S7-300 and have learnt an awful lot, but am still a little hazy on some issues!

My system is acting as Modbus Master in one scenario to control a couple of compressors, and is a Modblus Slave to a Honeywell DCS system which is really only reading in Alarm/Status information. The only data they write to me is for the time synchronisation for Alarm Time stamping. I have mapped 6 DB addresses to receive the fields (Year/Month/Day....etc), and just need to assign them to the PLC and HMI clocks. There are 2 x 315-2DP CPU's (for Redundancy) and an MP370 (15"), any help appreciated.
 
SFC 0 (System function call) lets you set the system clock.

It uses the DT format for the input parameter.

FC3 (In the IEC library) lets you combine Date and Time of day variables into the DT format.
Some other FCs in te IEC libary lets you add/subtract time periods etc..

Date: Size word, days since 1-1-1990 (I beleive or 1991, you can play with this by using say MW200 in the variable monitor table, and flip its representation between Decimal and date format.
TOD: Size DWord, miliseconds since midnight.
 
Thanks USDutchman, i've had a look through the instructions, and i'm still not that clear on where to start with this. Basically, i have 6 WORDS coming from a DCS system via Modbus (DB20.DBW0/2/4/6/8/10) - i'm trying to write these values to the PLC clock, then sync with the MP370. I think i need to setup a 'PLC Job' within the HMI to initiate the update, it's the converting of the DB addresses to the DT format where i'm struggling to grasp things............... :confused:
 
Listen to Floyd for the answers

Remember

Time is linear
Memory is a stranger
History's for fools

(Pink Floyd - Perfect Sense)


Converting from h:m:s to TOD (Time) is simple

((((H*60)+M)*60)+S)*1000

Date format is a little trickier.

For the math goto

http://www.ortelius.de/kalender/calc_en.php

(Who can remember this one, Siemens uses an adapted Julian date format: History's for fools)

Then when you have both, use library function FC3 out of the IEC library. (couldn't find any docu on how Siemens stores the combined values).

Off course you could use the included library (I had to give this a try myself, since I wasn't very busy this week anyway).

Caution: I did very minimal testing (but it worked!)
Used somebody elses magic formula though. May want to check a couple of leap year values (2100 is NOT a Leap year, so maybe it fails, but then again, who of us is still working by then?)
All Inputs are considered integers.
 

Similar Topics

How can I integrate my S7-300 Simatic with the IFM AS-i Master AC1335 and its slave IOs, such as 2411 and Airbox 2041, into Simatic Manager?
Replies
0
Views
121
Hello everyone, One of our machine we use Siemens Cpu315-2dp. And this cpu communicate with 4 Lenze servo drives series 9300 via profibus. Also...
Replies
0
Views
184
Hi guys, I'm having problems converting WinAC (WinLC RTF F application) to S7 300 project based on CPU 319F-3PN or S7 400/416F-3PN. The problem is...
Replies
0
Views
619
Hi Any one here please helpmein simulation of s7 300 plc program with factory io. how to connect. plcsim 5 doesnot have option of s7 300 ..:
Replies
2
Views
1,014
Hi to all, Our company does not usually use Siemens PLCs, but have a press with one in it. We are trying to change the IP address in our Simatic...
Replies
2
Views
1,071
Back
Top Bottom