Loading... Please wait...

RsLogix Lesson - Timers - TON, TOF, and RTO explained

mlbuy.jpgThis explains RsLogix 500 instructions: TON (Timer on delay), TOF (Timer off delay), and RTO (Retentive Timer On).  Our program uses the Micrologix PLC but other Allen Bradley PLCs are similar.

This lesson works very well with our line of PLC trainers.

Rung 0

A TON instruction will time as long as the instructions preceding it on the rung are true and the accumulated value is less than the preset.

When the TON is true, it will write a "1" to the EN (Enable). If the TON is true and the ACC (Accumulated) is less than the PRE (Preset), the TON will write a "1" to the TT (Timer Timing) bit and a "0" to the DN (Done) bit. If the TON is true and the ACC (Accumulated) is greater than the PRE (Preset), the TON will write a "0" to the TT (Timer Timing) bit and a "1" to the DN (Done) bit.

When a TON is false, it will write a "0" to the accumulated value, EN (Enable), TT (Timer Timing), and the DN (Done) bit.

timer1a.png

Rung 1

The EN (Enabled) bit will be true when the rung conditions preceeding the TON are true and off when the rung conditions preceeding the TON are false.

timer2.png

Rung 2

If the TON is true and the ACC (Accumulated) is less than the PRE (Preset), the TON will write a "1" to the TT (Timer Timing) bit.
If the TON is true and the ACC (Accumulated) is greater than or equal to the PRE (Preset), the TON will write a "0" to the TT (Timer Timing) bit.
If the TON is false, the TON will write a "0" to the TT (Timer Timing) bit.

timer2b.png

Rung 3

If the TON is true and the ACC (Accumulated) is less than the PRE (Preset), the TON will write a "0" to the DN (Done) bit.
If the TON is true and the ACC (Accumulated) is greater than or equal to the PRE (Preset), the TON will write a "1" to the DN (Done) bit.
If the TON is false, the TON will write a "0" to the DN (Done) bit.

timer3.png

Rung 4

Most explanations of timers end with the explanations contained in the rungs above, leaving the timers internal operation somewhat of a mystery. As you read more of our lessons you will find that we don't believe there are any mysteries to how a PLC function.

While it is feasible for the processor to be able to update the TON's accumulated value when the timebase is .01, it never made sense to me how the TON instruction could keep track of 32767 seconds when it has a time base of 1 second.

One reason we chose the Micrologix 1000 for this project is it allows the copying of the T4 data table to the N7 data table. 
1. On the left hand pane, right click the "Data Files" folder and select properties. You can see we have 40 elements that take up 120 words. That means each timer consumes 3 words.
2. Now open the "T4 TIMER" data file. We see the the ACC (Accumulated) and PRE (Preset) take up a word each (16 bits each). But the other word only identifies the EN (Enable), TT (Timer Timing), and DN (Done) bits. That only accounts for 3 or the 16 bits of that word.
3. To study these mystery bits further, we have copied T4:0 to N7:0 and additionally have masked the known bits, 13, 14, and 15 and placed the remainder in N7:5. Also we have placed S2:4, the free running clock's value the instant the timer was enabled in N7:4.
4. Practice toggling the I:0/0 input. Note that our mystery N7:5 word changes along with the accumulated value although their values are probably not the same. Each time you enable it, our mystery value is different.
5. Now with I:0/0 ON, switch the PLC to "Program" mode and then back to "Run" mode. Observe that our mystery bits in N7:5 are now in sync with our T4:0 accumulated value.

We will go into more detail about this in our "What makes a TON timer tick" article but we hope this is enough to convince you that there are no additional mysterious steps for a PLC to properly track the accumulated value of a timer.

timer4.png

Rung 5

Rungs 5-8 describe the TOF instruction.

A TOF instruction will time as long as the instructions preceding it on the rung are false and the accumulated value is less than the preset.

When the TOF is false, it will write a "0" to the EN (Enable). If the TOF is false and the ACC (Accumulated) is less than the PRE (Preset), the TON will write a "1" to the TT (Timer Timing) bit and a "1" to the DN (Done) bit. If the TOF is false and the ACC (Accumulated) is greater than the PRE (Preset), the TOF will write a "0" to the TT (Timer Timing) bit and a "0" to the DN (Done) bit.

When a TOF is true, it will write a "0" to the accumulated value, a "1" to the EN (Enable), a "0" to the TT (Timer Timing), and a "1" to the DN (Done) bit.

timer5.png

Rung 6

If the TOF is false, the EN (Enable) bit will be false. 
If the TOF is true, the EN (Enable) bit will be true. 
THIS IS IMPORTANT! The TOF EN (Enable) does not signify that the timer is operating, timing, etc. In fact the ACC (Accumulated) value increments when the timer is not enabled.

timer6.png

Rung 7

If the TOF is false and the ACC (Accumulated) is less than the PRE (Preset) then the TOF will write a "1" to the TT (Timer Timing) bit.
If the TOF is false and the ACC (Accumulated) is greater than or equal to the PRE (Preset) then the TOF will write a "0" to the TT (Timer Timing) bit.
If the TOF is true then the TOF will write a "0" to the TT (Timer Timing) bit.

timer7.png

Rung 8

If the TOF is false and the ACC (Accumulated) is less than the PRE (Preset) then the TOF will write a "1" to the DN (Done) bit.
If the TOF is false and the ACC (Accumulated) is greater than or equal to the PRE (Preset) then the TOF will write a "0" to the DN (Done) bit.
If the TOF is true then the TOF will write a "1" to the DN (Done) bit.

timer8.png

Rung 9

A RTO instruction will time as long as the instructions preceding it on the rung are true and the accumulated value is less than the preset.

When the RTO is true, it will write a "1" to the EN (Enable). If the RTO is true and the ACC (Accumulated) is less than the PRE (Preset), the RTO will write a "1" to the TT (Timer Timing) bit and a "0" to the DN (Done) bit. If the RTO is true and the ACC (Accumulated) is greater than the PRE (Preset), the RTO will write a "0" to the TT (Timer Timing) bit and a "1" to the DN (Done) bit.

When a RTO is false, it will write a "0" EN (Enable) and TT (Timer Timing) bits.

timer9.png

Rung 10

The EN (Enabled) bit will be true when the rung conditions preceding the TON are true and off when the rung conditions preceding the TON are false.

timer10.png

Rung 11

If the RTO is true and the ACC (Accumulated) is less than the PRE (Preset) then the RTO will write a "1" to the TT (Timer Timing) bit.
If the RTO is true and the ACC (Accumulated) is greater than or equal to the PRE (Preset) then the RTO will write a "0" to the TT (Timer Timing) bit.
If the RTO is false then the RTO will write a "0" to the TT (Timer Timing) bit.

timer11.png

Rung 12

If the RTO is true and the ACC (Accumulated) is less than the PRE (Preset), the RTO will write a "0" to the DN (Done) bit.
If the RTO is true and the ACC (Accumulated) is greater than or equal to the PRE (Preset), the RTO will write a "1" to the DN (Done) bit.
If the RTO is false, the TON does nothing to the DN (Done) bit.

timer12.png

Rung 13

A RES (Reset) instruction writes a "0" to the ACC (Accumulated) value, EN (Enable) bit, TT (Timer Timing) bit, and DN (Done) bits.

A RES (Reset) instruction can be used on any type of timer but is commonly used with the RTO instruction since unlike the TON and TOF instruction, its ACC (Accumulated) value and DN (Done) bit do not go to "0" when the RTO is false.

timer13.png

Rung 14

The EN, TT, and DN aren't the only indicators of the timer's status. We can compare the ACC (Accumulated) value to make decisions as well.

timer14.png

These lessons are designed for use with our PLC Trainers.