S7 Timer 300/400

Join Date
Sep 2008
Location
Denmark
Posts
27
Hi
I want to be able to manipulate the value of elapsed time in S7, and I still want it to be as accurate as possible.
It seems to impossible to manipulate with the build in timers.
S_ODT (S5-timer) and IEC Timer(SFB4)(S7-Timer)
I have notice that it is possible to manipulate the STIME in the SFB4, so I have used SFB4 like below, and it looks like it works, but will I ever get a time out on the timer?
And what will happens when it flips over to a negative value? I think the math will be correct?

Who don't want a timer with a negative preset time to predict events? :)

wOli3OrasUjcgAAAABJRU5ErkJggg==
 
Basic I want to have a timer who can be adjusted.
I add the scan time to my "timer" every scan.
Elsewhere I determine if time is elapsed with a compare block.
Start and reset of the timer are not shown in my code, but hopefully you still understand the principle.


Start:
NO before ADD

Reset:
MOVE 0 to "timer"

As a side benefit I get a retentive "IEC timer" if is working.
This block might be elsewhere, but I haven't be able to find it.
 
I would normally make a timer to be adjusted from SCADA as the attached picture.
in the example has been applied pulse from Clock Memory bit (hardware config) and the example used one second pulse.
Greater accuracy is achieved by use of 100ms pulse

timer.jpg Clock Memory.JPG
 

Similar Topics

i am new at siemens plc . i used to work with AB plc where timers were very easy. Here i am confused with s7 timers. i want to create free...
Replies
5
Views
2,123
First off, thanks for the patience with my post. Rookie to Siemens. I am trying to use a Retentive timer and it has to be around 24hours. Thus...
Replies
2
Views
1,883
Expert S7 300 PLC coding experience needed. I am looking for the 1/2hour average that this Urea panel PLC program is clocked from - I want to make...
Replies
2
Views
1,794
kindly help me to make a timer inside the FB S7 300
Replies
8
Views
4,493
Back
Top Bottom