Timer Base

bioplc

Member
Join Date
Jul 2005
Location
tampa
Posts
97
Hello All,

Can anyone please explain me..is there any difference between these two timers here

T4:1
timer Base 0.01
Preset 300
Acc 0


T4:2
timer base 1
preset 3
Acc 0

from my understanding both timers are same other than T4:1 ticks for every .01 sec and where as T4:2 for every sec. So, programmers which one u suggest more. Will there be a differece in scantime or output.

Please help.

Regards
 
The first one is more accurate. The only difference is the step. so I prefer first one. if you want to timing 10 minutes or some very long time, you can only choose time base = 1s.

In RSLogix5000, all the time base is set to 1ms. and .PRE and .ACC become DINT.
 
Time base .01 can count up to 327.76 seconds.

Time base 1 can count up to 32767 seconds.

A note on timer accuracy: The timer accuracy is determined by the scan time, not by the time base. A 0.01 time base has more RESOLUTION, but it is no more accurate that a 1 second time base timer in the same program. As long as a timer is executed once every 2.5 seconds it's true worst case pperiod will be PRE + Scan time. For example, If the scan time is 5 milliseconds then a 1 second time base timer with a 10 preset, and a .01 second timer with a 1000 preset will both be accurate to 10 seconds +.005, -.000. This is the worst case. There are however additional considerations that on rare occasion must be accounted for, such as IO response time, actuator response time, etc.


In the unlikely event that you have a very long program with a scan time (or a subroutine call rate) that is greater than 2.5 seconds, then you must program in an extra rung to execute another timer instruction on the same timer address again in the same program.


B3/0 B3/1
-----] [---]\[ --+---------+
| TON |--(EN)-
| T4:0 |
| PRE 100 |--(DN)-
| ACC ??? |
+---------+
.
.{Very long executing code between}
.
T4:0/EN
-----] [---------+---------+
| TON |--(EN)-
| T4:0 |
| PRE 100 |--(DN)-
| ACC ??? |
+---------+
.
. {more code}


'

The first time a timer instrucion is executed on a false/true rung the low order byte of the timer word 0 (T4:0.0) is updated with the system time reference, an 8 bit millisecond time value. Each subsequent scan that the rung evalutes true the value stored in the low order byt of word 0 is subtracted from the new current time reference (accounted for roll over) to determine the elapsed time and the time counts in the ACC are updated by the appropriate amount. Then the new time reference is stored in the low order byte. This way timer accuracy doesn't drift. If however the timer execution time exceeds 2.56 seconds then more than one roll-over has occured and the timer will be off by two and a half seconds. You can actually simulate this by placing an unconditional timer in a subroutine and only calling the subroutine at some time period greater than 2.56 seconds.

(Correct me if I am wrong, but on the PLC/5s I think you have to execute the timer at least once every 1.28 seconds.)
 
Alaric said:
Time base .01 can count up to 327.76 seconds.

Just fixing my typo. If I try and edit the previous post it will screw up my ladder tags.

That should read:
Time base .01 can count up to 327.67 seconds
 
NO, we need to use the EN bit. The EN bit will mirror the rung status of the rung which first executes the timer. Alternatively, we could put the exact same logic on both rungs, but then what if someone comes along and changes one but not the other?
 
If your second rung is "XIC T4:0/EN TON T4:0 100", it will always be actived, even B3/0 goes off or B3/1 goes on. what I suggest before is
"XIC T4:0/EN XIO T4:0/DN T4:0 100" for second rung, after timer is done, the .EN bit can still stays depends on conditions.
 
Alaric said:
A note on timer accuracy: The timer accuracy is determined by the scan time, not by the time base. A 0.01 time base has more RESOLUTION, but it is no more accurate that a 1 second time base timer in the same program. As long as a timer is executed once every 2.5 seconds it's true worst case pperiod will be PRE + Scan time. For example, If the scan time is 5 milliseconds then a 1 second time base timer with a 10 preset, and a .01 second timer with a 1000 preset will both be accurate to 10 seconds +.005, -.000. This is the worst case. There are however additional considerations that on rare occasion must be accounted for, such as IO response time, actuator response time, etc.


This isn't quite right - the time base is a key determining factor for accuracy according to the PLC-5 manual:

Timer accuracy refers to the length of time between the moment the processor enables a timer instruction and the moment the processor completes the timed interval. Timer accuracy depends on the processor clock tolerance and the time base. The clock tolerance is +/-.02%. This means that a timer could time out early or late by 0.01 seconds (10ms) for a .01 second time base or 1 second for a 1 second time base.

The 0.01-second timer maintains accuracy with a program scan of up to 2.5 seconds; the 1-second timer maintains accuracy with a program scan of up to 1.5 seconds. If your programs can exceed 1.5 or 2.5 seconds, repeat the timer instruction rung so that the rung is scanned within these limits.
 
douyi said:
If your second rung is "XIC T4:0/EN TON T4:0 100", it will always be actived, even B3/0 goes off or B3/1 goes on. what I suggest before is
"XIC T4:0/EN XIO T4:0/DN T4:0 100" for second rung, after timer is done, the .EN bit can still stays depends on conditions.

Then the second rung will cause the timer to reset the instant it is done, clearing both the DN bit and the EN bit and then the timer will repeat timing from zero as soon as the first rung is executed on the next scan.

As soon as the logic on the first instance of the timer rung evaluates false then the EN bit will clear, IOW, the EN bit mimics the rung state of the first rung, and the second rung timer will not be exeuted because when it is evalutated EN is false.

The following functionally equivalent logic might help clarify it.

XIC B3/0 XIO B3/1 OTE B3/2
XIC B3/2 TON T4:0 1 10 0
.
.{intermediate long code}
.
XIC B3/2 TON T4:0 1 10 0.

The EN bit in the first logic functions exactly the same way that B3/2 functions in the logic above, and T4:0/EN will always equal B3/2. The first method just uses fewer instructions.


edit to add:
msinclair, thanks for the snip from the manual.
 
Last edited:
Then the second rung will cause the timer to reset the instant it is done, clearing both the DN bit and the EN bit and then the timer will repeat timing from zero as soon as the first rung is executed on the next scan.

Once .DN is set, the second rung will go false, but the first rung still remain true, it will not reset .EN bit. there is no problem of that.

But after think about the logic, it works without "XIO T4:0/DN". Your logic is right.
 

Similar Topics

I have a timer in an old micrologix that has a time base of 0.01 and a preset of 75. Am I correct in saying that in contrologix that would be a...
Replies
2
Views
1,613
Does anyone know of a RSLogix 5000 add on timer instruction that as the time base option as did the RSLogix 500 timer.
Replies
4
Views
6,826
Hey, Can someone tell me what the default time base is for TON timers in RSLogix 5000? In the TON timer I don't see the option anywhere to edit...
Replies
9
Views
43,024
Anybody out there know exactly where a timer's time base data is stored in memory for a SLC 500? Is it in the reserved portion of the timer...
Replies
5
Views
5,049
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
213
Back
Top Bottom