RSLogix TON ACC value more than preset.

spandy16

Member
Join Date
Dec 2012
Location
Germany
Posts
58
I am using RSLogix Emulate 5000 to test my program. There are several timers in my application. Whenever I run my program, ACC in one of the TON timer jumps directly or increments to a value which is more than the Preset value. And this happens randomly. Whenever I restart my program and Emulator, TON seems to function normally and after some time same problem occurs. What can be the reason behind this?
 
DISCLAIMER: I don't ever use the Emulator software – but you'll occasionally see this same effect even while using a "real" processor ...

here's the reason:

the TON "timer" doesn't run/advance/tick EXCEPT when the processor executes the TON rung ...

so ...

think of what will happen if the TON has (for example) an ACCUMULATED value which happened to be just a tiny bit less than the PRESET ... if the processor's scan takes "extra" time to get back around to executing the TON rung again, then the TON will add "more than enough" time to the ACCUMULATOR ... this will give exactly the sort of "overrun" condition that you've described ...

in MOST cases, this type of "overrun" won't cause any problems ...

BUT ...

I've helped debug several systems over the years where the programmer had used an EQU (Equal To) comparison instruction based on the timer's ACCUMULATOR value – rather than using the timer's built-in Done bit ...

this can create havoc when the processor happens to take just a little bit too much time to "come around again" and "service" the TON instruction ... and worst of all, the condition will usually be highly intermittent/random in nature – and thus extremely hard to spot – unless you're specifically looking for this type of problem ...

.


TON_overrun.PNG
 
Last edited:
DISCLAIMER: I don't ever use the Emulator software – but you'll occaisionally see this same effect even while using a "real" processor ...

here's the reason:

the TON "timer" doesn't run/advance/tick EXCEPT when the processor executes the TON rung ...

so ...

think of what will happen if the TON had (for example) an ACCUMLATED value which happened to be just a tiny bit less than the PRESET ... if the processor's scan takes more time to get back around to executing the TON rung, then the TON will add "more than enough" time to the ACCUMULATOR – giving the sort of "overrun" that you've described ...

Thanks for this information. So it might happen that the ACC value overruns the PRE value. Actually in my program I have made a calculation task based on the ACC value of TON timer.

Output = Target * (ACC/PRE)

I want the output to increase till the target value in preset time. So if the ACC value is not precise enough to PRE value my output will be more than target value.
 
I'm not 100% sure that I'm following your logic – but from where I sit, it certainly looks like you MIGHT be setting yourself up for some intermittent/random malfunctions - based on the result of that division operation ...

you might want to consider putting a "clamp" rung on the Accumulator's value JUST BEFORE the "math" rung that you've described ...

.

TON_clamp.PNG
 
It looks like you are using a timer to ramp an output.

The solution is simple, immediately before the multiplication put the following in

GRT MyTimer.ACC MyTimer.PRE MOV MyTimer.PRE MyTimer.ACC
 

Similar Topics

Hi, I'm just looking for a simple way to make a button in excel (via VBA I presume) to toggle a bit in RSLogix 5000. I just got FactoyTalkLinx...
Replies
9
Views
553
Hi, I am using the DN bit to stop the timer. However the DN bit doesnt change state. Please see the attached image. Any help is appreciated.
Replies
14
Views
2,832
How do i use the TON command to monitor the number of hours something stays on for? what would the preset value be in this case? Or is there...
Replies
12
Views
4,510
Hi, So I have one push button(non-latch momentary) and would like use it to trigger two function sequences with the short press for primary...
Replies
3
Views
2,006
How can I add the "Go To..." function to the RSLogix 5000's Standard Toolbar?
Replies
9
Views
3,600
Back
Top Bottom