On a S7-300, how do you use the clock

Use one of the special OB's. Go to the HW-configuration and activate the OB, think it is called 'time-of-day'. Sorry, but I do not remember the OB-number.

Then program the reaction of the OB. The OB will run automatically, no need to call it in OB1. Send it to the cpu. But watch out the 'time-of-day'-OB is only one cyclus active.
 
Another posibility is to use System function (Get system time) and data type Time of day ... and easy comparator.
 
You should use system function "READ_CLK" (I dont know number), the output from it is data type DATE&TIME (you can put it to temporary).
After that you have to use "DT_TOD" (it like Date&Time to Time of day converter) so the input is DATE&TIME and output TIME_of_DAY.
After that comprataror IF TIME_of_DAY > TOD#8:0:0.0 (constant of TOD) = deaktivate output !
 
Here's an example project that allows you set up 16 different TOD's in a DB. As each TOD is reached , a bit in the DB comes on for one scan which you can then use to turn things off/on etc. I've simply used a counter in my example for test purposes.
 

Similar Topics

Hi all, Got a new project with a Siemens S7-300 (CPU 312). I've just tried to copy in my motor control FB's from an S7-1200 project I did earlier...
Replies
5
Views
5,351
Hi All, I have a simple question about PLC siemens S7300 CPU315-2PN/DP and I would be grateful if you could help me. In which way I can get a...
Replies
3
Views
2,620
I've a few time based processes in an s7-300 program that seem to be slightly off due to the system clock not being completely accurate. I set the...
Replies
1
Views
3,229
Further to a post yesterday regarding access to the PLC's real time clock in an S7 300 PLC, I have followed the advice of the forum and used the...
Replies
4
Views
14,827
How do you access the real time clock in a Siemens S7-300 or 400 PLC?
Replies
2
Views
4,663
Back
Top Bottom