Timer in Advanced Ladder 
See also: Counters in Advanced Ladder
See also: Project Toolbox for Advanced Ladder
Topic Menu
|
Timer & Counter Setup |
Home > View > Project Toolbox > Timer/Counter Operations
A timer is a PLC instruction measuring the amount of time elapsed following an event. Timer instructions come in two basic types: On-Delay and Off-Delay. Both “On-Delay” and “Off-Delay” timer instructions have single inputs triggering the timed function. Timers set to “On-Delay” have an additional “Retentive” option that will retain the timer accumulator value until the timer is specifically reset using the Reset Input address.
Timer Configuration
Timer Address - Enter the register to be used by the timer. Example %R101. Or enter the desired variable name if using Variable Based Advanced Ladder.
-
When a timer is configured as 16-bit it will use two consecutive addresses.
-
Example %R101 & %R102
-
-
When a timer is configured as 32-bit it will use three consecutive addresses.
-
Example: %R101, %R102, & %R103
-
|
Click on the button marked 16-BIT/32-BIT to select the accumulator size. This button toggles the accumulator size between 16-bit and 32-bit. The default accumulator size is 16-bit, comprised of a 16-Bit Accumulator + 16-bit Flag Word. (two words) |
|
|
Click on the button to toggle from a16-bit timer accumulator to a 32-bit timer accumulator. A 32-bit timer is comprised of a 32-Bit Accumulator + 16-bit Flag Word. (three words) |
|
|
Timers in a Variable Based program use Structures. In this case the graphic shows ‘STRCT.’ |
|
Resolution - This is the timebase value. Use the drop-down list to select a 1 millisecond, 10 milliseconds, 100 milliseconds, or 1 second timebase.
On Delay - The output turns ON when elapsed time equals Pt (Programmed Time).
Off Delay - Output turns ON immediately; Output turns OFF after elapsed time equals Pt.
Pt (Programmed Time or Setpoint) - This is the timeout period expressed in timebase units.
-
Example: If the Resolution (timebase value) is 100 milliseconds and a value of 20 is entered into Pt, the timeout period = 20*100ms, which is 2000 milliseconds or 2 seconds.
-
The Pt field can also be configured to use a %address or variable for dynamic configuration.
The Pt value is a 16-bit INT or UINT.
Retentive Checkbox - Check this box if the timer should retain the accumulator value until it is specifically reset using the Reset Input address, which is shown when the box is checked.
Register Usage
|
16-Bit Timers - Register Based Advanced Ladder |
|
Each 16-bit Timer requires two (2) consecutive 16-bit registers (typically %R).
|
1st word - Timer Accumulator |
Type: INT Max value: 32767 |
|
2nd word - Flags Word. |
Type: Combination decimal + bit level. Bits 1 to 14 - Timer housekeeping area. Do not overwrite. Bit 15 – TON - power to the rung or timing. Bit 15 is not enabled with TOF. Bit 16 – Indicates power flow through the timer function. |
|
32-Bit Timers - Register Based Advanced Ladder |
|
|
1st and 2nd word - Timer Accumulator |
Type: DINT Max value: 2,147,483,647. |
|
3rd word - Flags Word. |
Type: Combination decimal + bit level. Bits 1 to 14 - Timer housekeeping area. Do not overwrite. Bit 15 – TON - power to the rung or timing. Bit 15 is not enabled with TOF. Bit 16 – Indicates power flow through the timer function. |
|
Bit Timers in Variable Based Advanced Ladder |
|
There are two predefined Timer/counter structures available:
-
TimerCounter16 - for 16 Bit Timers/Counters.
-
TimerCounter32 - for 32 Bit Timers/Counters.
To use a timer structure in program logic, the variable will be entered as a prefix and the Acc or Flags are entered as a suffix. Flags.15 and 16 operation is the same as in register-based logic.
Example: To access ACC and Flags of a variable called TMR_Test, use:
For more information on the Timer/Counter structures, see: Predefined Time Counter Structures
On Delay Timer - TON
A TON will delay turning on an output after the input side goes TRUE.
When power is applied to the TON input side the output becomes inactive and the TON counts up to the Pt value at a rate determined by the configured timebase. When the accumulator reaches the Pt value, the output is turned ON and counting stops. When power is removed from the element, the TON accumulator resets to zero and the output side is turned OFF.
TON Power Flow
The timebase is user definable in 1mS, 10mS, 100mS or 1S "ticks". When power is applied to the element, counting proceeds using this timebase.
Return to the Top:Timer in Advanced Ladder
Retentive On Delay Timer - TON_R
A Retentive On Delay Timer is a special case of the "standard" On Delay Timer but differs from the standard timer in that the Retentive Timer does not reset when power is removed from the input side. The Retentive Timer requires that a reset signal be applied to the function in order for the timer to be reset.
Note: Resetting the Retentive Timer requires the use of the Reset Input address, which becomes available when the Retentive checkbox is checked.
Because the Retentive Timer retains its accumulated value, the data stored in its assigned registers may be invalid immediately after downloading the application. To ensure the timer starts with a known value, reset it using the First Scan bit, as shown below:
Return to the Top:Timer in Advanced Ladder
OFF Delay Timer - TOF
Off-delay timers (also known as delay-on-release, delay-on-break, or delay-on-energization timers) delay turning the output side OFF after power is removed from the input side.
Note: Only the On Delay Timer can be configured as retentive
When power is applied to the TOF Timer, the output immediately turns ON. When power is removed from the TOF the output stays ON, and the TOF counts up to the Pt value at a rate determined by the configured timebase. When the accumulator reaches the Pt Value, the output is turned OFF and counting stops. The timeout count remains in the accumulator until power is again applied to the element. When power is applied the TOF accumulator resets to zero.
TOF Power Flow
The timebase is user definable in 1mS, 10mS, 100mS or 1S "ticks". When power is removed to the element, counting proceeds at this timebase.
Return to the Top:Timer in Advanced Ladder
