S7 clock thought´s

Hello Berra;

Alternatively, you can use OB10 (or any other Time-of-Day interrupt available in your CPU); set up the time parameters in the CPU properties in HWConfig, and SET the bit you need in the OB10 block (remember to RESET it in your program, in OB1 for example).

Hope this helps,
Daniel Chartier
 
I just extract the time as integers and use compare instructions to set up the event trigger(s).

It makes it a lot easier for other users to see what your program is doing...
 
You could use the following in OB1:

Code:
	 LAR1 P##OB1_DATE_TIME
	 L	 B [AR1,P#3.0]
	 L	 13
	 ==I 
	 =	 M	 2.0

or use the more general version posted above.
 
Ok,thanks
but now i must configure the Plc clock so i get the date and time right.
Where do i configure the PLC clock??
 
Coding error corrected, BTI needed to convert from BCD to integer.

Code:
	 LAR1 P##OB1_DATE_TIME
	 L	 B [AR1,P#3.0]
	 BTI
	 L	 13
	 ==I 
	 =	 M	 2.0
 
So if i use your Exemple L D[AR2",p#0.0] i get M2.0 active the hole hour ??

But if i whant m2.0 activate more then 1 hour how does a type the code??
 
My example gives M2.0 on whilst the hour = 13
i.e. on from 13:00:000 until 13:59:999. Do you you need to specify the minutes as well ?
 

Similar Topics

We recently purchased a IC693CPU352 module and it appears the internal time clock is static. I can set the time and date but once set it does not...
Replies
5
Views
168
Hello. I cannot change the SendClock settings for a PROFINET IO device. I need to slow down the CODESYS PROFINET IO controller. What am I doing...
Replies
0
Views
198
Hello everyone, I am not a programmer, but I can do some simple programming. So now I want the time to be recorded every time a pump turns on. I...
Replies
35
Views
2,701
Hello, I am trying to create an AOI that will retrive the clock datetime bits from a master plc through a generic message read instruction and...
Replies
2
Views
489
I was online a SLC5/04 yesterday and one thing I did was go to processor properties and set the date and time to get the PLC clock current. It...
Replies
4
Views
721
Back
Top Bottom