Retentive On-delay Timer for S7-300

Join Date
Apr 2003
Posts
25
It seems to be a very straightforward question but I need a help.For S7 200 Micro PLCs there is a Retentive On-Delay timer(TONR)
that satisfies the application I want to implement, but in S7 300
PLC I can not find this type of Timer.What I want to do is start timing a timer and if for some reasons the input to the timer goes off it will stop timing and when the input goes on again the timer continues timing from the time it was stopped.Your suggesstions are appreciated.

Thanks,
Eduardo.
 
Eduardo,

The S7-300 proably doesn't have the Retentive Timer. You can simulate the same thing however, using a regular timer and an extra memory location.

Here is what to do:

1. When your timer enable input is ON, continually store the Timer Accumulated Value to a memory location (call it "M0.0"), in a rung branch or another rung right under the timer rung.

2. When the timer enable bit goes OFF, the Timer will reset to 0. Now, add a rung with the timer enable bit as an input, followed by a one-shot (do only one time), then a Move command to move the value stored in "M0.0" to the Timer Accumulated Value.

Now when your timer stops, its value will be saved in M0.0, and when it restarts, M0.0 will be moved back to the timer accumulated value. Thus you now have you a Retentive timer! You have to make sure that the accumulated time value never gets bigger than what the timer maximum value will accept, otherwise you will cause a fault.
 
Another common way to do this, without a retentive timer, that I have come accross & started using myself is cycling a 1 second timer whenever the inpt is on, and when that timer's Done bit is set, have a counter count up 1, then interrrupt the timer with a XIO:Timer/DN.

When you get to the needed total time in seconds (i.e. - Count/ACC=90 or Count/Done=1) have your logic start/stop as if the timer ran out & Reset the Counter when done.

An example below. Just add whatever else you need to happen during the time, or before the time re-starts for your application.

Greg

p.s. - I just uploaded the RSLogix500 file to the AB section of the Download section. http://www.plcs.net/downloads

count as timer.jpg
 
Last edited:
Very good point, CNR and seppoalanen

I have used a Counter like that myself, and it works very well to keep up with a recurring event. Seppoalanen, I do wish the RSLogix program had an UP/DOWN Counter, similar to Automation Direct and other brands. In RSLogix, I have had to harness two counters together to track the position of a cart that has both forward and reverse travel directions.
 
Godfrey wrote: The S7-300 does have the command you want.
It is called S_ODTS Retentive On-Delay S5 Timer.
Godfrey,

I don't believe this timer is what is needed, at least it's noet the same as the TONR in S7-200. When the input of S_ODTS timer goes OFF, the timer continues to run. The function wanted (TONR in S7-200) was for the timer to stop running when the input goes OFF and to continue when the input goes ON again.

Kind regards,
 
Hola Sr. Pelegrin;

When programming a S7-200 CPU, always keep in the back of your mind that it was developped for Siemens USA by originally TI-505 engineers (after Siemens bought TI). This is basically the reason of the different styles of programming between S7-200 (TI style) and S7-300/400 (S5 style)PLCs.

So, when you find a function in a S7-200 that is different or not supported in S7-300/400, open the "TI-S7 converting blocks" library (in the Step7 programming editor) and you just might be surprised at what you find: drums, decoding blocks, table move instructions...
In your case, there is a FC80 available, named TONR, that seems to do exactly what you want. Just insert it in a cyclic OB (OB1 comes to mind) in your S7-300 program. If you already have a FC80 defined, you can rename it without problem.
Look up detatils in the online help, or on the TI-S7 conversion PDF file included in the Step7 documentation.
Hope this helps,
Daniel Chartier
 
Example for S7. 7212B32 could be "Roll is coming"...
and ZV must be CD (ZR) and ZR must be CU (ZV)
The Roll must be gone from the Conveyor when Counter ACT-value is zero.

rtu.jpg
 
Last edited:
Greg,
You completely missed my point. What I said was:

"I do wish the RSLogix program had an UP/DOWN Counter"

Maybe I should have put the emphasis on the "AN". I am talking about only ONE counter here, a counter function on one rung that has two inputs, one for counting UP and a second one for counting DOWN. Of course I know that RSLogix has TWO counter functions , but does it have a combination counter that will do both functions? Many other PLC brands DO have this neat feature, and I have used it many times. Whereas in RSLogix, I am forced to make do with two functions on two different rungs.
 
Lancie1 said:
Eduardo,

The S7-300 proably doesn't have the Retentive Timer. You can simulate the same thing however, using a regular timer and an extra memory location.

Here is what to do:

1. When your timer enable input is ON, continually store the Timer Accumulated Value to a memory location (call it "M0.0"), in a rung branch or another rung right under the timer rung.

2. When the timer enable bit goes OFF, the Timer will reset to 0. Now, add a rung with the timer enable bit as an input, followed by a one-shot (do only one time), then a Move command to move the value stored in "M0.0" to the Timer Accumulated Value.

Now when your timer stops, its value will be saved in M0.0, and when it restarts, M0.0 will be moved back to the timer accumulated value. Thus you now have you a Retentive timer! You have to make sure that the accumulated time value never gets bigger than what the timer maximum value will accept, otherwise you will cause a fault.

Sorry to bring back and old post, but does anyone have a picture of what this kind of setup would look like ? I am trying to get some S7 Delay-on timers to work as retentive timers but i can't seem to get it to work correctly.

Any help would be appreciated :)
 
No worries for un-tapping an old thread my friend. We are here to help. It's great to see that you searched for the info first before just posting again. Keep up the good work and soon the tape will come off your basment windows as well.

Cheers.
 

Similar Topics

Hello guys, I am currently looking through some examples of how timers work, but this ladder logic diagram gets me really confused. Once I:1/0 is...
Replies
2
Views
1,840
Can you give me a suggestion for using a retentive on-delay timer within a function block that will have multiple instances? I have found two...
Replies
12
Views
6,283
Hello Again, I am in need of some guidance again. I am kind of stuck.I can not seem to come up with a solution yet.It is a class assignment.It...
Replies
11
Views
3,159
C
I NEED SOMEONE TO PLEASE HELP ME OR AT LEAST SOME HINTS ON HOW TO GET LOW VOLTAGE PROTECTION WITH THE DONEBIT BEEN TRUE ALL THE TIME IT SEEMS HARD...
Replies
16
Views
8,823
Back
Top Bottom