RSlogix 5k Timers question

briana banks

Member
Join Date
Jul 2005
Posts
242
Hi All

In my program ladder i have a routine called from main:

main
---------------JSR MyFunc

MyFunc

Cond
--||----------RET

--------------TON

If Cond = True, the routine returns and the timer stops
however when Cond = False TON should continue from the point
it stopped,but that doesnt happen.
It seems that it continues to count and when Cond = False
it shows the time already past.

Why?
 
Last edited:
You always need to be a little careful of timers in conditional subroutines, or more correctly in your case, an unconditional subroutine with a conditional return.

A timer programmed this way will never be updated as false. the timer instruction needs to see at least one scan where the input conditions to itself are false in order to properly set the enable bit. Since you are leaving the subroutine the timer instruction never sees the false input case. So it continues on as if it is still running.

There is a limit to how long you can go between timer services and still maintain accuracy. I don't know that value off the top of my head but it is out there.

Keith
 
If you want the timer to start from where it left off you should use a RTO instead of a TON. A Retentive timer will pick up where it left off.
 
Hi

RTO wont work in this case (i tried it) since the difference
between RTO and TON is valid whilst there is a condition in the input.

The solution is to keep the value of .ACC before returning.
 
Hi

I see that keeping the .ACC value before returning doesnt work
either.

The purpose of this was to skip doing the folowing rungs
when a condition term apply.
 

Similar Topics

I haven't used used timers and STL together, so thought I'd try them on my next project! I have the following code example: So basically I was...
Replies
5
Views
3,111
Hello all, I have not used many timers in logix and was wondering what is the best method to do the following? I would like to start an agitator...
Replies
5
Views
2,633
I have a problem and can't find an answer anywhere. I have a ladder logic aoi to control motors. In the routine there is an alarm for failure to...
Replies
15
Views
5,712
I have a merge program that a co-worker was working on before he quite recently. In the past month the merge logic grew from 17 rungs to now 49. I...
Replies
8
Views
2,742
Hello, I am trying to have 1 timer turn on a horn 4 times for a total of 120 sec. Is it possible to split a TON up into 4 times or do I split...
Replies
10
Views
2,842
Back
Top Bottom