How AB Timers work.

PhilipW

Member
Join Date
Dec 2002
Location
Wellington, New Zealand. Islands on the edge of th
Posts
923
While looking up another item I found this rather interesting article on how timers works and why they are different between PLC/SLC and ControlLogix.

How the TON operates

PLC5
The TON uses an 8-bit time stamp to chart where its accumulated value should be. Whenever the rung with a TON instruction is scanned, the 8-bit time stamp is saved. The next time the rung is scanned, the new time stamp is compared with the old time stamp and the accumulated value of the timer is increased by the difference in the time stamps.
Example:
If the time stamp was at 50 decimal when the rung was scanned and then on the next scan of the ladder the time stamp is now at 150 the difference between the time stamps is 100. The accumulated value of the Timer will increment by one unit. For a 1 second time base, the accumulated value will increase by 1 second. For a 10mS time base, the timer's accumulated value will increase by 100ms. If the difference in the time stamps was 250, then the 1 second time base timer will increment by 2, and the 10mS timer will increment by 250mS.

Since this is an 8 bit time stamp, it has a decimal range of 0 – 255 where 0000 0000 = 0 seconds and
1111 1111 = 2.5 seconds. This is because each bit in the time stamp represents 10mS.
For example
0000 0001 = 10mS or 0.01 Seconds
0000 1010 = 100mS or 0.10 Seconds
0011 0010 = 500mS or 0.50 Seconds
0110 0100 = 1000mS or 1.00 Seconds
1111 1111 = 2550mS or 2.50 Seconds

If the scan time of a program with a timer in it is greater than or equal to 2.5s, then the timer's accumulated value will not be accurate. The time stamp will have wrapped around from its previous location.
Example
If the time stamp is at 50 decimal and it takes 2.5 seconds to scan the program, the next time we get back to the timer rung we will have added 255 to the time stamp. This in effect puts us right back at 50 decimal. The accumulated value of the timer will not increment because it does not see a difference in the old time stamp compared to the new one.

Because of these phenomenon, it may appear that the TON instruction, when placed in a subroutine or not scanned every scan, will appear to hold its accumulated value and pick up where it left off when the rung is scanned again.

CONTROLLOGIX:

The ControlLogix Timer instruction uses a 64 bit time stamp that makes it seem like a seamless count when the timer is in a subroutine or is being jumped over. It will take a long, long time for the time base to wrap using a 64 bit number.

In general, timers are not asynchronous to the controller scan. They keep track of the time stamp when they were last scanned and update their accumulated value by the difference in the current time stamp and the last scan's time stamp.
 

Similar Topics

I'm writing some alterations to an FPWin program and need to see the running value of timers so I can set them correctly. It's my first time with...
Replies
0
Views
119
Hi everyone I am using Winproladder software for programming FATEK FBs PLCs and in programming, we often use Timers for activation of the...
Replies
4
Views
478
Hi all, I have what is likely not a complex issue, but I am working in Automation Studio and want an accumulating/retentive timer when a...
Replies
17
Views
1,833
Dear all, I want to use the interrupt service routine in FATEK PLC using WinproLadder Software. I had configured the interrupt in software as...
Replies
17
Views
1,513
Dear all, I have some query about the use of Timers in Fatek PLC Module by using WinproLadder Software. I am trying to use one timer instance in...
Replies
4
Views
1,146
Back
Top Bottom